


var libs = new Array(
	new ObjectTag(true, "msxml", "CLSID:2933BF90-7B36-11d2-B20E-00C04F983E60"),
	"/ajax/javascripts/uiutils.js",	
	"/javascripts/mm.js",
	"/ajax/javascripts/ajax.js",
	"/ajax/javascripts/uitoolkit.jsp"	
	
);

var html_doc;

var isIE = document.all?true:false;

function ObjectTag(ieonly, id, classid)
{
	this.ieonly = ieonly;
	this.id = id;
	this.classid = classid;
}

function loadLibScripts()
{
	html_doc = document.getElementsByTagName('head').item(0);
	var ext;
	var filepath;
	
	for(var i=0; i<libs.length; i++)
	{
		filepath = libs[i];
		if(filepath instanceof ObjectTag)
		{
			loadObject(filepath);
		}
		else
		{
			ext = filepath.substring(filepath.lastIndexOf('.')+1);	
	
			if(ext == 'css')
			{
				loadCSS(filepath);
			}
			else if(ext.indexOf('js')==0)
			{
				if(isIE)
				{
					altLoadScript(filepath);
				}
				else
				{
					loadScript(filepath);
				}
			}
		}
	}

	if(typeof(onLoad) != "undefined")
	{
		onLoad();
	}
}

function loadObject(objtag)
{
	if(!objtag.ieonly || isIE)
	{
		document.write('<object id="');
		document.write(objtag.id);
		document.write('" width="1" height="1" classid="');
		document.write(objtag.classid);
		document.write('" ></object>');
	}
}

function altLoadScript(scriptsrc)
{
	document.write('<script language="javascript" type="text/javascript" src="');
	document.write( scriptsrc);
	document.write('"></script>');
}

function loadScript(scriptsrc)
{
	var js = document.createElement('script');
	js.setAttribute('language', 'javascript');
	js.setAttribute('type', 'text/javascript');
	js.setAttribute('src', scriptsrc);
	html_doc.appendChild(js);    
}

function loadCSS(csssrc)
{
	var file = document.createElement('link');
	file.setAttribute('rel','stylesheet');
	file.setAttribute('type','text/css');
	file.setAttribute('href', csssrc);
	html_doc.appendChild(file);    
}

loadLibScripts();
