/* This function includes all necessary js files for the application */
function include(file) {
	var script = document.createElement('script');
	script.src = file;
	script.type = 'text/javascript';
	script.defer = true;
	document.getElementsByTagName('head').item(0).appendChild(script);
}


/* Styleswitcher */
include('../Assets/javascript/jquery.styleswitcher.js');
include('../Assets/javascript/jquery-1.2.1.pack.js');

/* Custom scrollbar */
include('../Assets/javascript/flexcroll.js');

function setScrollbar() {
	var table = document.getElementsByTagName("table");
	var tables = table.length;
	
	for (var i=0; i<tables; i++) { 
		if (document.uniqueID) { /* IE */
			var hasLayout = table[i].getAttribute('className');
		} else { 
			var hasLayout = table[i].getAttribute('class');
		}
	} 
	
	var headerContainer = document.getElementById("headerContainer"); 
	var contentContainer = document.getElementById("contentContainer"); 
	var footerContainer = document.getElementById("footerContainer");
	
	if ((tables!=0)&&(!hasLayout)) { // If there is at least one table that has no layout, set the width to force a scrollbar.
		headerContainer.style.cssText = "width: 184px;";
		contentContainer.style.cssText = "min-width: 100%; width: 178px;";
		footerContainer.style.cssText = "width: 184px;";
	} 
}



