function AnswerVal(frm)
{
    if (frm.body.value == "")
	{
		alert("Oh dear! Please fill in an Answer.");
		
		return false;
	}	
	return true;
}

$(document).ready(function(){	
	$('#searchtoggle').click(function () {
		$('#top-search').slideToggle(300, function(){
			$('#searchtoggle').toggleClass('up');
		});
    });

});

$(document).ready(function() {
	$('#breadcrumb').hover(function() {
		$(this).removeClass('off');
	}, function () {
		$(this).addClass('off');
	});
});

$(document).ready(function() {
	$('#slickbox').hide();

	$('a#slick-toggle').click(function() {
    $('#slickbox').toggle(400);
	    return false;
  	});	
  	
	$('a#slick-hide').click(function() {
	$('#slickbox').hide('fast');
	   	return false;	
  	});
});

$(document).ready(function() {
	

	$(".search_submit").click(function(){

		$("#search_box").slideToggle(300);
		$(this).toggleClass("active"); 

		return false;
	});
	
});

$(document).ready(function(){

	$("ul.subnav").parent().append("<span></span>"); //Only shows drop down trigger when js is enabled (Adds empty span tag after ul.subnav*)

	$("ul.topnav li a").hover(function() { //When trigger is clicked...

		//Following events are applied to the subnav itself (moving subnav up and down)
		$(this).parent().find("ul.subnav").slideDown('fast').show(); //Drop down the subnav on click

		$(this).parent().hover(function() {
		}, function(){
			$(this).parent().find("ul.subnav").slideUp('slow'); //When the mouse hovers out of the subnav, move it back up
		});

		//Following events are applied to the trigger (Hover events for the trigger)
		}).hover(function() {
			$(this).addClass("subhover"); //On hover over, add class "subhover"
		}, function(){	//On Hover Out
			$(this).removeClass("subhover"); //On hover out, remove class "subhover"
	});

});

function lookup(inputString) {
	if(inputString.length == 0) {
		$('#suggestions').hide();
	} else {
		$.post("http://www.booglam.com/dosearch.php", {queryString: ""+inputString+""}, function(data){
			if(data.length >0) {
				$('#suggestions').show();
				$('#autoSuggestionsList').html(data);
			}
		});
	}
}
	
function fill(thisValue) {
	$('#inputString').val(thisValue);
	setTimeout("$('#suggestions').hide();", 200);
}

function subFill(thisValue) {
	$('#inputStrings').val(thisValue);
	setTimeout("$('#suggestions_sub').hide();", 200);
}

function lookup_sub(inputString) {
	if(inputString.length == 0) {
		// Hide the suggestion box.
		$('#suggestions_sub').hide();
	} else {
		$.post("http://www.booglam.com/dosearch2.php", {queryString: ""+inputString+""}, function(data){
			if(data.length >0) {
				$('#suggestions_sub').show();
				$('#autoSuggestionsList_sub').html(data);
			}
		});
	}
} // lookup
	

