/* display flight details in dispatch -> flight search */
function displayDetail(rn) {
	drows = document.getElementsByClassName('detail');
	$A(drows).each(function(r){
		if (r.id != rn) {
			if (r.getStyle('display') != 'none') Effect.SlideUp(r,{duration:0.8});
		}
	});
	new Effect.toggle($(rn),'slide',{duration:0.5});
}

/*
** Ajax function to swap and store the status of the drop-box for more options
*/
function dropThis(param) {
	new Effect.toggle($('dropselect'),'slide',{duration:0.6});
	if ($('dropselect').getStyle('display') == 'none') {
		$('dropIcon').src = 'media/layout/tables/dispatch/fold.gif';
		$('dropIcon').title = 'hide options';
		$('bottomselect').title = 'hide options';
	} else {
		$('dropIcon').src = 'media/layout/tables/dispatch/drop.gif';
		$('dropIcon').title = 'more options';
		$('bottomselect').title = 'more options';
	}
	x_dropstore( $('dropselect').getStyle('display'),function(r){} );
}
function dropSet(dv) {
	$('dropselect').setStyle({
		display: dv
	});
}

// set the checkbox and submit the form 
function check_weekday(sbox,mmode) {
	if (mmode < 1) {
		$('checkday').checked = (!$('checkday').checked)? true : false;
	}
	sboxValue = $(sbox).options.selectedIndex+1;
	$('checkday').value = sboxValue;
	$('searchForm').submit();
}

// set any given checkbox on/off
function set_check(what) {
	$(what).checked = (!$(what).checked)? true : false;
}