/*
	$Date: 2006/04/10 20:56:01 $
	$Revision: 1.2 $
	$Author: jbelew $
	$Id: common.ognc.js,v 1.2 2006/04/10 20:56:01 jbelew Exp $

	$Log: common.ognc.js,v $
	Revision 1.2  2006/04/10 20:56:01  jbelew
	Added support for the 'Global Sites' drop down ...
	
	Revision 1.1  2006/04/06 18:45:22  jbelew
	Refactored directory structures ...

	Revision 1.1  2006/04/03 17:19:42  jbelew
	Updated page to use a table based layout ...

	Revision 1.1  2006/03/22 22:48:00  jbelew
	Initial asset checkin ...

*/

// Setup the rollover images ...
image_products = new Image();
image_products.src = "../img/common/products_on.en-us.gif";
image_applications = new Image();
image_applications.src = "../img/common/applications_on.en-us.gif";
image_support = new Image();
image_support.src = "../img/common/support_on.en-us.gif";

// Addresses IE bug preventing us from accessing a tag by name ...
function getElementsByClass(searchClass,node,tag) {
	var classElements = new Array();

	if ( node == null )
		node = document;
	if ( tag == null )
		tag = '*';

	var els = node.getElementsByTagName(tag);
	var elsLen = els.length;
	var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)");

	for (i = 0, j = 0; i < elsLen; i++) {
		if ( pattern.test(els[i].className) ) {
			classElements[j] = els[i];
			j++;
		}
	}
	return classElements;
}

// Support code for the Global Sites dropdown ...
sfHover = function() {
	var sfEls = document.getElementById("global-sites").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);