if(typeof(sRoot) == 'undefined')
	sRoot = '';
	
if(typeof(sCommon) == 'undefined')
	sCommon = '/js/common';

function include(sJsFile) {
	document.writeln('<script src="' + sRoot + sJsFile + '"></script>');
}
function includes() {
	for(var iInc = 0; iInc < arguments.length; iInc++) {
		include(arguments[iInc]);
	}
}

function includeCss(sCssFile) {
	document.writeln('<link href="' + sRoot + sCssFile + '" rel="stylesheet" />');
}

if(typeof(Events) != 'undefined') {
	// common.js has already been included once; this is a problem
	//alert('common.js is being included more than once on this page; please remove the extra script src="" tags');
} else {
	includes(
		sCommon + '/js/array.js',
		sCommon + '/js/string.js',

		sCommon + '/onload.js',
		sCommon + '/countlog.js',

		sCommon + '/css/cssclasslist.js',

		sCommon + '/dom/attribute.js',
		sCommon + '/dom/pseudoclass.js',
		sCommon + '/dom/simpleselector.js',
		sCommon + '/dom/selector.js',
		sCommon + '/dom/tag.js',

		sCommon + '/event/events.js',
		sCommon + '/event/event.js',
		sCommon + '/event/binding.js'
	);
}