function LoadCategory(name,ClickElement) {
	$('#Slider1Title').html(name.replace(/\+/gi," "));
	$('#SliderContent').html('<img src="images/pre.gif" />');
	if ($('#Slider1').is(":visible")==false) { $('#Slider1').slideDown(); }
	$('#SliderContent').load("ajax.php?action=category&value="+name);
}

function Comment(guid) {
	nameinp=document.getElementById('comName');
	comment=document.getElementById('comBody');
	fbidinp=document.getElementById('fbid');
	if (fbidinp) { var fbid=fbidinp.value; }
	if (nameinp.value=="" || nameinp.value=="undefined") {
		alert("You forgot to enter your name!");
	} else if (comment.value=="" || comment.value=="undefined") {
		alert("You forgot to enter your comment!");
	} else {
		$('#comArea').html('<center><img src="images/pre.gif" /></center>');//ajaxpage("addcomment.php?name="+name.value+"&comment="+comment.value.replace(/\n/g,"<br>")+"&post="+postGUID,"commentArea",2,postTitle);
		$.post('ajax.php?action=subcom&value='+guid+'&name='+nameinp.value,{body: comment.value.replace(/\n/g,"<br>"),fbid: fbid},function(data) { $('#comArea').html(data); });
	}
}

function LoadMoreComments(guid) {
	//$("#comArea").append($.get('ajax.php?action=LoadMoreComments&guid='+guid+'&count='+ComCountLoaded));
	$("#MoreComLoading").html('<img src="images/loading.gif" />');
	$.ajax({ url: 'ajax.php?action=LoadMoreComments&guid='+guid+'&count='+ComCountLoaded, success: function(data){
        $("#comArea").append(data);
		$("#MoreComLoading").html('');
      }});
	ComCountLoaded+=10;
	if (ComCountLoaded>=PostComCount) { 
		$("#ComLoadLink").remove();
	}
}

function EditCommentName() {
	nameinp=document.getElementById('comName');
	$('#nameval').html('<input id="comName" value="'+nameinp.value+'" />');
	$("#comName").focus();
}


function LoadTwitterWidget() {
	$('#botPop1Cont').html('<center><img src="images/pre.gif" /></center>');
	$('#botPop1').show();
	$('#botPop1Cont').load('includes/twitter/widget.php');

}

function isDefined(variable)
{
	return (!(!(document.getElementById(variable))))
}

