var checkedNavigationCallbackFunc_g = 0;

function setCheckedNavigationCallback( paramCallbackFunc ) {
	checkedNavigationCallbackFunc_g = paramCallbackFunc;
}

function navigateToCheckedThroughCallback( paramLocation ) {
	if ( 0 != checkedNavigationCallbackFunc_g ) {
		checkedNavigationCallbackFunc_g( paramLocation );
	} else {
		window.location = paramLocation;
	}
}

function isTrue( paramIsTrueString ) {
	return ( "true" == paramIsTrueString );
}

function confirmActionBeforeSubmit( paramConfirmString ) {
	var agree = confirm( paramConfirmString );
	if (agree) {
		return true;
	} else {
		return false;
	}
}

function goLocationSubmit( paramDoConfirm, paramConfirmString, paramLocationPage ) {
	execute = true;
	if ( paramDoConfirm ) {
		execute = confirmActionBeforeSubmit( paramConfirmString );
	}
	
	if ( execute ) {
		document.listForm.cmd.value = 'Null';
		document.listForm.action = paramLocationPage;
		document.listForm.submit();
	}
}

function goToViewList( paramDoConfirm, paramConfirmString ) {
	goLocationSubmit( paramDoConfirm, paramConfirmString, 'viewList.php' );
}

function goToEditListItems( paramDoConfirm, paramConfirmString ) {
	goLocationSubmit( paramDoConfirm, paramConfirmString, 'editList.php' );
}

function goToReorderOrArchiveItems( paramDoConfirm, paramConfirmString ) {
	goLocationSubmit( paramDoConfirm, paramConfirmString, 'reorderArchiveListItems.php' );
}


function goLocation( paramDoConfirm, paramConfirmString, paramLocationPage ) {
	execute = true;
	if ( paramDoConfirm ) {
		execute = confirmActionBeforeSubmit( paramConfirmString );
	}
	
	if ( execute ) {
		window.location.href = paramLocationPage;
	}
}

function toggleCommand( whichLayerPrefix ) {
	var styleBody;
	var styleTriDown;
	var styleTriRight;
	var styleTitle;

	if (document.getElementById) {
		// this is the way the standards work
		styleBody = document.getElementById( whichLayerPrefix + "Body" ).style;
		styleTriDown = document.getElementById( whichLayerPrefix + "TriDown" ).style;
		styleTriRight = document.getElementById( whichLayerPrefix + "TriRight" ).style;
		styleTitle = document.getElementById( whichLayerPrefix + "Title" ).style;
	} else if ( document.all ) {
		// this is the way old msie versions work
		styleBody = document.all[ whichLayerPrefix + "Body" ].style;
		styleTriDown = document.all[ whichLayerPrefix + "TriDown" ].style;
		styleTriRight = document.all[ whichLayerPrefix + "TriRight" ].style;
		styleTitle = document.all[ whichLayerPrefix + "Title" ].style;
	} else if (document.layers) {
		// this is the way nn4 works
		styleBody = document.layers[ whichLayerPrefix + "Body" ].style;
		styleTriDown = document.layers[ whichLayerPrefix + "TriDown" ].style;
		styleTriRight = document.layers[ whichLayerPrefix + "TriRight" ].style;
		styleTitle = document.layers[ whichLayerPrefix + "Title" ].style;
	}

	if ( "none" == styleBody.display ) {
		styleBody.display = "block";
		styleTriDown.display = "inline";
		styleTriRight.display = "none";
		styleTitle.background = "#779";
	} else {
		styleBody.display = "none";
		styleTriDown.display = "none";
		styleTriRight.display = "inline";
		styleTitle.background = "#AAA";
	}
	
	window.status = '';
}