// JavaScript Document
$(document).ready(function(){
	$("#menu>ul>li").each(function(){
		$(this).mouseover(function(){
			$(this).children("ul").show();
		});
		$(this).mouseout(function(){
			$(this).children("ul").hide();
		});
	});
});

function validateForm(objForm, file, submitOnSuccess)
{
	$("#status").ajaxStart(function(){
		$(this).html('<img src="images/admin/loading.gif" />&nbsp;<span class="gray">Validating Submission...</span>');
	});
	$.ajax({
		type:"POST",
		url: file,
		data:getRequestBody(objForm),
		success:function(xml){
			if(xml == 0){
				if(submitOnSuccess == null){
					$("#status").html('<span class="green">Submission Valid! Processing...</span><br/>');
					objForm.submit();
				}else{
					$("#status").html('');
				}
			}else{
				$("#status").html('<span class="red">' + xml + '</span><br/>');
			}
		}
	});
}
