<!--
// Show hide text ------------------------------------------------------------------------------------------------------- //
function toggleText() {
	$("div.hiddenText").toggle();
	
	return false;
}

function toggleTableRow() {
	$("tr.hiddenText").toggle();
	
	return false;
}

// Slow slide to reveal text
function slideText() {
	$("div.hiddenText").slideToggle("slow");
	
	return false;
}

// Delete item --------------------------------------------------------------------------------------------------------- //
function deleteItem() {
	var $me = $(this);	
	var $parent = $(this).parents('tr.rowItem');
	
	var original = $me.html();
	var id = $parent.attr('id');
	var url = $me.attr('href');
	
	//alert($parent.html());	 
	//alert(id);	
	
	if( confirm("Are you sure you want to delete this item?") ) {
		
		$me.html('<img src="/images/icons/loader.gif" alt="Loading" class="absmiddle" border="0" />');
		
		$.post(url, { item_id: id, deleteItem: "1" },
					function (data){
						if (data == 'ok') {
							// deleted
							//$parent.remove();	
							$parent.fadeOut("slow"); 
						} else {
							// not deleted
							alert("Sorry we could not delete this item. Please try again later.");
							$me.html(original);
						}											
					}
				);
				
	}
	
	return false;
}

// Send item --------------------------------------------------------------------------------------------------------- //
function sendItem() {
	var $me = $(this);	
	var $parent = $(this).parents('tr.rowItem');
	
	var original = $me.html();
	var id = $parent.attr('id');
		
	//alert($parent.html());	
	//alert(id);	
	
	if( confirm("Are you sure you want to send this item?") ) {
		
		$me.html('<img src="/images/icons/loader.gif" alt="Loading" class="absmiddle" border="0" />');
		
		$.post("ajaxSendbrief.php", { item_id: id, sendItem: "1" },
					function (data){
						if (data == 'ok') {
							// deleted
							//$parent.remove();	
							//$parent.fadeOut("slow");
							window.location = '/pages/briefs/confirmation.php';
						} else {
							// not deleted
							alert("Sorry we could not send that item. Please try again later.");
							$me.html(original);
						}											
					}
				);
				
	}
	
	return false;
}

// Show progress bar --------------------------------------------------------------------------------------------------- //
function showProgress() {
	document.getElementById('uploadprogress').style.display = 'block';    
   	return true;
}

// Show hidden box if there are errors---------------------------------------------------------------------------------- //
function showHiddenDiv() {
	$(".hiddenText").css( { display: "block" } );
}

// Mouseover functions ------------------------------------------------------------------------------------------------- //
var IMGROOT = "/images/buttons/";

$(function (){
	$('.btn').hover(function(){
		$(this).attr("src",IMGROOT + $(this).attr('rel') + "_over.gif");
	},function(){
		$(this).attr("src",IMGROOT + $(this).attr('rel') + ".gif");
	});
});
-->