//Stuff to do on window load...
window.onload = function(){ 
	//set the id tag for <body>... this automatically results in CSS coloring the relevant sectionmenu
	if (typeof sSection == "string") {
		$$('body').addClass('section' + sSection); 
		if (sMenuItem != "") {
			var sElementSelector = "ul#menu" + sSection + " li.m" + sMenuItem;
			$$(sElementSelector).addClass('current');
		}
	}
}
window.addEvent('domready', function(){
	$$('input.DatePicker').each( function(el){
		new DatePicker(el);
	});
});



///////////////////////////////////////////////////////////////
// display toggle. always handy
///////////////////////////////////////////////////////////////
function toggle(obj) {
	var el = document.getElementById(obj);
	if ( el.style.display != 'none' ) {
		el.style.display = 'none';
	}
	else {
		el.style.display = '';
	}
}



///////////////////////////////////////////////////////////////
// open new window
///////////////////////////////////////////////////////////////
function openWindow(pageURL) {
	dlg = window.open (pageURL ,"_blank", "width=560,height=500,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes");
	if (window.focus) { dlg.focus() }
	return false;
}
function openWindowBlank() {
	dlg = window.open ("","newWindow","width=400,height=400,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no");
	dlg.document.write ("<BODY bgColor='#FFFFFF'>");
	dlg.document.write ("<CENTER>This is text that has been added on the fly using Javascript.</CENTER>");
	dlg.document.write ("</body>");
}
