/****************************************************************************************
Copyright (c) 2007 Ethicon Endo-Surgery, Inc.(EES).

This software is the confidential and proprietary information of EES. ("Confidential Information"). You shall not disclose such Confidential Information and shall use it only in accordance with the terms of the license agreement you entered into with EES.

VERSION 	1.0
AUTHOR		Doug Scamahorn

DATE       	NAME           	DESCRIPTON
03/27/2007 	Doug Scamahorn  Initial creation.

****************************************************************************************/
/* GLOBAL UTILITY FUNCTIONS ---------------------------------------------------------------------------- */
//Get current page URI protocol or path, scheme://host.domain:port/path/filename
//Make sure the browser understands the DOM methods
function fncValidateDomSupport(){
	if (!document.getElementsByTagName) return false;
	if (!document.getElementById) return false;
}
//getElementsByClass - http://www.dustindiaz.com/getelementsbyclass/
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;
}
//
function ieFlicker(){
	try {
		document.execCommand('BackgroundImageCache', false, true);
	} 
	catch(e) {}
}
//onLoad Function
function addLoadEvent(func){
	var oldonload=window.onload;
	if(typeof window.onload != 'function'){
		window.onload=func;
	} else {
		window.onload=function(){
			oldonload();
			func();
		}
	}
}
/* LOAD FUNCTIONS ---------------------------------------------------------------------------------- */
addLoadEvent(ieFlicker);