function getKrusemarkCategory(theField){
	
	var theForm = theField.form;
	var theAcc = theForm.krusemarkAcc;
	
	$("select#krusemarkHours").html("");
	$("div#searchKrusemarkHours").slideUp("fast");
	
	if(theAcc.value!=""){
		$.ajax({
		   type: "POST",
		   url: "/webservice/krusemark_categories.asp",
		   data: "acc=" + theAcc.value,
		   success: function(msg){
				showKrusemarkCategories(msg);
		   }
		 });
	 }else{
		$("select#krusemarkCategory").html("");
		$("div#searchKrusemarkCategory").slideUp("fast");
	 }
}

function showKrusemarkCategories(msg){
		
	if(msg.length > 0){
		$("select#krusemarkCategory").html(msg);
		$("div#searchKrusemarkCategory").slideDown("slow", function(){
			$("select#krusemarkCategory").animate({backgroundColor:"#FFBFBF"}, 500).animate({backgroundColor:"#FFFFFF"}, 1000);
		});
	}else{
		$("div#searchKrusemarkCategory").slideUp("slow");
	}
}

function getKrusemarkHours(theField){
	
	var theForm = theField.form;
	var theCategory = theForm.krusemarkCategory;
	var theAcc = theForm.krusemarkAcc;
	
	if(theCategory.value!=""){
		$.ajax({
		   type: "POST",
		   url: "/webservice/krusemark_hours.asp",
		   data: "cid=" + theCategory.value + "&acc=" + theAcc.value,
		   success: function(msg){
				showKrusemarkHours(msg);
		   }
		 });
	}else{
		$("div#searchKrusemarkHours").slideUp("fast");
		$("select#krusemarkHours").html("");
	}
}

function showKrusemarkHours(msg){
	
	if(msg.length > 0){
		$("select#krusemarkHours").html(msg);
		$("div#searchKrusemarkHours").slideDown("slow", function(){
			$("select#krusemarkHours").animate({backgroundColor:"#FFBFBF"}, 500).animate({backgroundColor:"#FFFFFF"}, 1000);
		});
	}else{
		$("div#searchKrusemarkHours").slideUp("slow");
	}

}								

function submitKrusemarkForm(theForm){
	if(theForm.krusemarkAcc.value != "" && theForm.krusemarkCategory.value == ""){
		theForm.action = "/store/category.asp?qType=ce&qValue=6&format=6&acc=" + theForm.krusemarkAcc.value;
	}else if(theForm.krusemarkCategory.value != "" && theForm.krusemarkHours.value == ""){
		theForm.action = "/store/category.asp?qType=ce&qValue=6&format=6&acc=" + theForm.krusemarkAcc.value + "&sid=" + theForm.krusemarkCategory.value;
	}else if(theForm.krusemarkHours.value != ""){
		theForm.action = "/store/category.asp?qType=ce&qValue=6&format=6&acc=" + theForm.krusemarkAcc.value + "&sid=" + theForm.krusemarkCategory.value + "&hours=" + theForm.krusemarkHours.value;						
	}else{
		theForm.action = "/store/category.asp?qType=ce&qValue=6";
	}

}	