$(document).ready(function() {
	$("#preloader").hide();
	$("#contentunderloading").hide();
	$("#commentpreloader").hide();

	$('#htmlForm').ajaxForm({
		target:         '#searchresults',
		beforeSubmit:     showPreloader,
		success:         hidePreloader
	});

	$('#commentForm').ajaxForm({
			target:         '#commentresults',
			beforeSubmit:     showcomPreloader,
			success:         hidecomPreloader
	});

	$("#content4").click(function()
 	{
 		$("#contentunderloading").show();
 		$("#suggest").hide();
 		$("#contentundervideo").append('<div id="subscribe"></div>')
 			.children("#subscribe").hide()
 			.load("../_AJAX/_subscribe.php", function()
 		{
 			$("#contentunderloading").hide();
 //			$("#subscribe").slideDown("slow");
 			$("#subscribe").show();
 		});
 		return false;
 	});

 	$("#content5").click(function()
 	{
 		$("#contentunderloading").show();
 		$("#subscribe").hide();
 		$("#contentundervideo").append('<div id="suggest"></div>')
 			.children("#suggest").hide()
 			.load("../_AJAX/_suggest.php", function()
 		{
 			$("#contentunderloading").hide();
 			$("#suggest").show();
 		});
 		return false;
 	});
});

function showPreloader() {
	$("#preloader").show();
	$("#searchresults").hide();
}

function hidePreloader() {
	$("#preloader").hide();
	$("#searchresults").show();
}

function showcomPreloader() {
	$("#commentpreloader").show();
	$("#commentresults").hide();

}

function hidecomPreloader() {
	$("#commentpreloader").hide();
	$("#commentresults").show();
}


function hide() {

inputform=document.getElementById('commentForm').style;
inputform.display = 'none';
inputform2=document.getElementById('NoComments').style;
inputform2.display = 'none';

}

