//------------------------------------------------------------------------------
//  WAX 1.4 - general-purpose web application library
//  Copyright (C) 2000-2008 SnapWorks
//  Website : http://www.snap-works.com/
//  Email   : info@snap-works.com
//------------------------------------------------------------------------------

//------------------------------------------------------------------------------
//  Browser detection
//------------------------------------------------------------------------------

var Browsers = {
	Other	: 0,
	Gecko	: 1,
	MSIE		: 2,
	Opera	: 3
}

var browser = Browsers.Other;
    
if (window.opera) {
    browser = Browsers.Opera;
} else if (navigator.userAgent.match(/Gecko/)) {
    browser = Browsers.Gecko;
} else if(window.clipboardData) {
    browser = Browsers.MSIE;
}

//------------------------------------------------------------------------------
//  void ExtendClass(Object superClass, Object baseClass)
//------------------------------------------------------------------------------
function ExtendClass(superClass, baseClass) // {{{
{
    function inheritance() {}
    inheritance.prototype = baseClass.prototype;
    superClass.prototype = new inheritance();
    superClass.prototype.constructor = superClass;
} // }}}

//------------------------------------------------------------------------------
//  DomNode $(id)
//  Return dom node by id.  
//------------------------------------------------------------------------------
function $(id)
{
    return document.getElementById(id);
}

function registerStartupFunction(func) {
	
	var currentOnLoadFunc = window.onload;
	
	if (! window.onload) {
		window.onload = func;
	} else {
		window.onload = function() {
			currentOnLoadFunc();
			func();
		}
	}
}