function FeaturedPagination(StartLimit, keyword) {
	// alert(StartLimit+" "+keyword);
	$.post("generalResultsPagination.php", {
		s : StartLimit,
		q : keyword
	}, function(data) {
		// alert(data);
			$("#PagingResult").html(data);
		});
}
function speaksPagination(StartLimit, keyword) {
	// alert(StartLimit+" "+keyword);
	$.post("getSpeaksPagination.php", {
		s : StartLimit,
		q : keyword
	}, function(data) {
		// alert(data);
			$("#speaksPaging").html(data);
		});
}
function speaksFull() {
	var SpeakMore = $("#speakMore").is(':hidden');
	if (SpeakMore) {
		$('#speakMore').toggle();
		$('#SpeakShort').toggle();
		$('#speak').html('restore');
	} else {
		$('#speakMore').toggle();
		$('#SpeakShort').toggle();
		$('#speak').html('read more');

	}
}
function blogsFull(blogId) {
	var BlogsMore = $("#blogsMore" + blogId).is(':hidden');
	if (BlogsMore) {
		$('#blogsMore' + blogId).toggle();
		$('#blogShort' + blogId).toggle();
		$('#blogsRead' + blogId).html('restore');
	} else {
		$('#blogsMore' + blogId).toggle();
		$('#blogShort' + blogId).toggle();
		$('#blogsRead' + blogId).html('read more');

	}
}
function discourseFull(discourseId) {
	var BlogsMore = $("#discourseMore" + discourseId).is(':hidden');
	if (BlogsMore) {
		$('#discourseMore' + discourseId).toggle();
		$('#discourseShort' + discourseId).toggle();
		$('#discourseRead' + discourseId).html('restore');
	} else {
		$('#discourseMore' + discourseId).toggle();
		$('#discourseShort' + discourseId).toggle();
		$('#discourseRead' + discourseId).html('read more');

	}
}
/*function suggest(inputString) {
	if (inputString.length == 0) {
		$('#suggestions').fadeOut();
	} else {
		$('#search_option').addClass('load');
		$.post("autosuggest.php", {
			queryString : "" + inputString + ""
		}, function(data) {
			if (inputString == " ")
				alert('Please enter valid text');
			if (data.length > 0) {

				if (data == 'badwords') {
					// alert(data);
				$('#suggestions').fadeOut();
				// $("#search_option").val('');
				// $("#search_option").focus();
				$('#suggestionsList').html('');
				// $('#go_btn').attr("disabled","disabled");

			} else {
				// alert('check hti sout');
				$('#suggestions').fadeIn();
				$('#suggestionsList').html(data);
				$('#search_option').removeClass('load');
				// $('#go_btn').removeAttr("disabled");

			}
		}
	}	);
	}
}*/
function suggest(inputString) {
	if (inputString.length == 0) {
		$('#suggestions').fadeOut();
	} else {
		$.post("PurifyWords.php", {
			queryString : "" + inputString + ""
		}, function(data) {
			//alert(data);
			// $("#PagingResult").html(data);
				if (data == 0) {
					$('#search_option').addClass('load');
					$.post("autosuggest.php", {
						queryString : "" + inputString + ""
					}, function(data) {
						if (inputString == " ")
							alert('Please enter valid text');
						if (data.length > 0) {

							if (data == 'badwords') {
								// alert(data);
							$('#suggestions').fadeOut();
							// $("#search_option").val('');
							// $("#search_option").focus();
							$('#suggestionsList').html('');
							//$('#go_btn').attr("disabled", "disabled");

						} else {
							// alert('check hti sout');
							$('#suggestions').fadeIn();
							$('#suggestionsList').html(data);
							$('#search_option').removeClass('load');
							//$('#go_btn').removeAttr("disabled");

						}
					}
				}	);
				}
				else
				{
					//alert(data+" Bad words Found");
					$("#search_option").val('');
				}
			});
	}
}

function fill(thisValue) {
	$('#search_option').val(thisValue);
	setTimeout("$('#suggestions').fadeOut();", 600);
}
function checkValidation() {
	var cat = $('#search_option').val();
	if ((cat.length) < 3) {
		alert('Please enter atleast 3 characters');
		return false;
	} else
		return true;
}
function showKeyCode(e) {
	// alert("keyCode for the key pressed: " + e.keyCode + "\n");
	if (e.keyCode == 40) {
		// alert("keyCode for the key pressed: " + e.keyCode + "\n");
		$("#disp").focus();
		// $('#suggestionsList').effect('highlight', {color: '#fffacd'},3000);

	}
}

function actionDiscources(disourceId)
{
	//$('#'+disourceId).show();
	var Style=$("#"+disourceId).is(":hidden");
	if(Style)
	{
		$(".discources").hide();
		$("#"+disourceId).show();

	}
	else
	{
		$(".discources").hide();
	}
}
function actionSpeaks(disourceId)
{
	//$('#'+disourceId).show();
	var Style=$("#"+disourceId).is(":hidden");
	if(Style)
	{
		$(".speaks").hide();
		$("#"+disourceId).show();

	}
	else
	{
		$(".speaks").hide();
	}
}
// /////////////////////////////////////////////////
