window.onload = function() {
	nuFlipperA();	
	nuFlipperB();	
}

function nuFlipperA() {
	if (!document.getElementById("links")) return false;
	var menu = document.getElementById("links");
	var links = menu.getElementsByTagName("li");
	var i;
	for (i=0; i<links.length; i++) {
		links[i].onmouseover = function() {
			this.style.backgroundPosition = "left -30px";
		}
		links[i].onmouseout = function() {
			this.style.backgroundPosition = "left 0";
		}
	}
}

function nuFlipperB() {
	if (!document.getElementById("featuredClick")) return false;
	if (!document.getElementById("featured")) return false;
	var linksA = document.getElementById("featuredClick");
	var bkgd = document.getElementById("featured");
	linksA.onmouseover = function() {
		bkgd.style.backgroundPosition = "left -124px";
	}
	linksA.onmouseout = function() {
		bkgd.style.backgroundPosition = "left 0";
	}
}

var WindowObjectReference = null; // global variable
var PreviousUrl; 

function openRequestedSinglePopup(strUrl)
{
  if(WindowObjectReference == null || WindowObjectReference.closed)
  {
    WindowObjectReference = window.open(strUrl, "SingleSecondaryWindowName",
           "resizable=no,scrollbars=no,status=yes,width=600, height=400");
  }
  else if(previousUrl != strUrl)
  {
    WindowObjectReference = window.open(strUrl, "SingleSecondaryWindowName",
        "resizable=yes,scrollbars=yes,status=yes");
    /* if the resource to load is different,
       then we load it in the already opened secondary window and then
       we bring such window back on top/in front of its parent window. */
    WindowObjectReference.focus();
  }
  else
  {
    WindowObjectReference.focus();
  };
  PreviousUrl = strUrl;
  /* explanation: we store the current url in order to compare url
     in the event of another call of this function. */
}