<!--
/*
$('div.bbrLevel2').live('click',function(evt){
  if (evt.button != 0)
  {
    // wasn't the left button - ignore
    return true;
  }

  var elp = $(this);
  $("TogPane",elp).slideToggle("normal");
  $("TogPane",elp).toggleClass("ItemShow").toggleClass("ItemHide");
});


function openAllBBRLinks() {
  $("a.bbrLink").each(function(){
    var elp = $(this).parent();
    $("ul.TogPane",elp).show();
    $(elp).addClass("ItemShow").removeClass("ItemHide");
  });
}
function closeAllBBRLinks() {
  $("a.bbrLink").each(function(){
    var elp = $(this).parent();
    $("ul.TogPane",elp).hide();
    $(elp).removeClass("ItemShow").addClass("ItemHide");
  });
}
*/
$(function() {


	function ShowBox(sBoxID)
	{
		var aOptions = {};
		$(sBoxID).show("blind",aOptions,500);
	        $(sBoxID).toggleClass("ItemShow").toggleClass("ItemHide");
	}


	function HideBox(sBoxID)
	{
		var aOptions = {};
		$(sBoxID).hide("blind",aOptions,500);
	        $(sBoxID).toggleClass("ItemShow").toggleClass("ItemHide");
	}

	function ToggleBox(sBoxID, sButtonID)
	{
		var aOptions = {};
		$(sBoxID).toggle("blind",aOptions,500);
	        $(sBoxID).toggleClass("ItemShow").toggleClass("ItemHide");
	        $(sButtonID).toggleClass("ButtonShow").toggleClass("ButtonHide");
	}

	function ToggleBoxLrg(sBoxID, sButtonID)
	{
		var aOptions = {};
		$(sBoxID).toggle("blind",aOptions,500);
	        $(sBoxID).toggleClass("ItemShow").toggleClass("ItemHide");
	        $(sButtonID).toggleClass("LrgButtonShow").toggleClass("LrgButtonHide");
	}

	$("#showlogin").click(function() {
		ToggleBox("#loginbox", "#showlogin");
		return false;
	});

	$("#showaboutus").click(function() {
		ToggleBox("#aboutusbox");
		return false;
	});

    	$("#showaboutus").hover(function () {
    		$(this).addClass("hilite"); }, function () {$(this).removeClass("hilite");
    	});

	$("#showSearch").click(function() {
		ToggleBox("#searchbox", "#showSearch");
		return false;
	});

	$("#showEditButtons").click(function() {
		ToggleBox("#EditPane", "#showEditButtons");
		$.post("AjaxFunctions.php", {Act: "JQSetValue", ValName: "ShowEdit" } );
		return false;
	});

	$("#showEmoticons").click(function() {
		ToggleBox("#EmoticonPane", "#showEmoticons");
		$.post("AjaxFunctions.php", {Act: "JQSetValue", ValName: "ShowEmoticons" } );
		return false;
	});

	$("#showUserEmoticons").click(function() {
		ToggleBox("#UserEmoticonPane", "#showUserEmoticons");
		$.post("AjaxFunctions.php", {Act: "JQSetValue", ValName: "ShowEmoticons" } );
		return false;
	});

	$("#showAudicons").click(function() {
		ToggleBox("#AudiconPane", "#showAudicons");
		$.post("AjaxFunctions.php", {Act: "JQSetValue", ValName: "ShowAudicons" } );
		return false;
	});

	$("#showBlog").click(function() {
		ToggleBox("#BlogPane", "#showBlog");
		return false;
	});

	$("#showLatest").click(function() {
		ToggleBox("#LatestPane", "#showLatest");
		$.post("AjaxFunctions.php", {Act: "JQSetValue", ValName: "LastestMenu" } );
		return false;
	});

	$("#showActions").click(function() {
		ToggleBox("#ActionsPane", "#showActions");
		$.post("AjaxFunctions.php", {Act: "JQSetValue", ValName: "ActionItems" } );
		return false;
	});

	$("#showBlogRoll").click(function() {
		ToggleBox("#BlogRollPane", "#showBlogRoll");
		$.post("AjaxFunctions.php", {Act: "JQSetValue", ValName: "BlogRoll" } );
		return false;
	});

	$("#showLinks").click(function() {
		ToggleBox("#LinksPane", "#showLinks");
		$.post("AjaxFunctions.php", {Act: "JQSetValue", ValName: "OtherLinks" } );
		return false;
	});

	$("#showShareThis").click(function() {
		ToggleBox("#SharePane", "#showShareThis");
		return false;
	});

	$("#showBlogPost").click(function() {
		ToggleBoxLrg("#BlogPostPane", "#showBlogPost");
		$.post("AjaxFunctions.php", {Act: "JQSetValue", ValName: "Hide" } );
		return false;
	});

	var bLoginVisible = false;

	$("#dialog-form-opts").dialog({
		autoOpen: false,
		resizable: false,
		show: 'slide',
		height: 640,
		width: 380,
		modal: true
	});

	$("#dialog-form-cgpw").dialog({
		autoOpen: false,
		resizable: false,
		show: 'slide',
		height: 400,
		width: 400,
		modal: true
	});

	$('#ChgUserOpts').click(function() {
			$('#dialog-form-opts').dialog('open');
	});

    	$("#ChgUserOpts").hover(function () {
    		$(this).addClass("hilite"); }, function () {$(this).removeClass("hilite");
    	});


	$('#ChgPswd').click(function() {
			$('#dialog-form-cgpw').dialog('open');
	});

    	$("#ChgPswd").hover(function () {
    		$(this).addClass("hilite"); }, function () {$(this).removeClass("hilite");
    	});

	$("#PopCancelOpts").click(function() {
		$("#dialog-form-opts").dialog('close');
	});

	$("#PopCancelCgpw").click(function() {
		$("#dialog-form-cgpw").dialog('close');
	});

	$("#PopSubmitOpts").click(function() {
		$.get("AjaxFunctions.php", $("form#UserOptsForm").serialize(), function(data) { alert("Result: " + data) });
		$("#dialog-form-opts").dialog('close');
	});

	$("#PopSaveCgpw").click(function() {
		$.get("AjaxFunctions.php", $("form#ChgPswd").serialize(), function(data) { alert("Result: " + data) });
		$("#dialog-form-cgpw").dialog('close');
	});

	$('.QuoteButton').live('click',function(evt)
	{
		if (evt.button != 0)
		{
			// wasn't the left button - ignore
			return true;
		}

		var oButton = $(this);
		var oParentDIV = oButton.parent('.BlogComment');
		var sID = oParentDIV.attr("id")
		
		$.get("AjaxFunctions.php", {Act: "QuoteComment", CommentID: sID }, function(xml) 
			{
				$("Comment",xml).each(function(i)
				{
	  				var sComment = $(this).find('CommentText').text();
					$('#MainEdit').val(sComment);
				});
			},"xml"
		);

	});

	$("#refreshComments").click(function() {
		  var oLink = $(this);
		  var oParentDIV = oLink.parent('.FirstComment');
		  var sID = oParentDIV.attr("id")
		$.get("AjaxFunctions.php", {Act: "RefreshComments", BlogID: sID }, function(xml)
			{
				$("Comments",xml).each(function(i)
				{
	  				var sComments = $(this).find('CommentsText').text();
					$('#CommContainer').html(sComments);
				});
			},"xml"
		);
	});



});
//-->

