// This file holds functions that help these kind of expand/collapse
// menus from not flickering on certain browsers.
// Taken from a public blog's help response and then amended.
// Credits/Source:	Dean Edwards/Matthias Miller/John Resig
//			http://dean.edwards.name/weblog/2006/06/again/

function byz_ecm_init()
{
    // quit if this function has already been called
    if (arguments.callee.done) return;

    // flag this function so we don't do the same thing twice
    arguments.callee.done = true;

    // kill the timer
    if (_timer) clearInterval(_timer);

    byz_ecm_showhideall();
};

/* for Mozilla/Opera9 */
if (document.addEventListener)
{
	document.addEventListener("DOMContentLoaded",byz_ecm_init, false);
}

/* for Internet Explorer */
/*@cc_on @*/
/*@if (@_win32)
document.write("<scr"+"ipt id=__ie_onload defer src=javascript:void(0)><\/scr"+"ipt>");
var script = document.getElementById("__ie_onload");
script.onreadystatechange = function() {
if (this.readyState == "complete")
	{
		// call the onload handler
		byz_ecm_init();
        }
};
/*@end @*/

/* for Safari */
if (/WebKit/i.test(navigator.userAgent)) { // sniff
var _timer = setInterval(function() {
if (/loaded|complete/.test(document.readyState))
{
	// call the onload handler
	byz_ecm_init();
}
}, 10);
}

/* for other browsers */
window.onload = byz_ecm_init;
