var Accordion = false;

if(document.getElementById('errorBox') != null) {
	var Accordion = true;
}
if(document.getElementById('noticeBox') != null) {
	var Accordion = true;
}
if(document.getElementById('infoBox') != null) {
	var Accordion = true;
}
if(document.getElementById('diagBox') != null) {
	var Accordion = true;
}

if(Accordion == true) {
	var detailsAccordion = new Fx.Accordion($$('.slideToggler'), $$('.slideContent'), { display:-1, opacity:false, initialDisplayFx:false, alwaysHide: true });
}

function checkUncheckAll(theElement) {
	var theForm = theElement.form, z = 0;
	for(z=0; z<theForm.length;z++){
		if(theForm[z].type == 'checkbox' && theForm[z].name != 'checkall'){
			theForm[z].checked = theElement.checked;
		}
	}
}

function postForm(form, url) {
	if(url != null) {
		document.getElementById(form).action = url;
	}
	document.getElementById(form).submit();
}

function openOverlay(id) {	
	$(id).fade('hide');	
	var fx = new Fx.Tween(id);
	fx.set('display', 'inherit');	
	$(id).fade('show');	
}

function closeOverlay(id) {
	$(id).fade('hide');
}