// GLOBAL JS FUNCTIONS

function autoFill(id, text, startColor, endColor)
{
	$(id).unbind().css({ color: startColor }).attr({ value: text }).focus(function()
	{
		if($(this).val()==text)
		{
			$(this).val("").css({ color: endColor });
		}
	}).blur(function()
	{
		if($(this).val()=="")
		{
			$(this).css({ color: startColor }).val(text);
		}
	});		
}

function ajaxLightbox(the_url, the_data, title)
{
	$.ajax({
		type: 'POST',
		url: the_url,
		data: the_data,
		success: function(data)
		{
			openLightbox(data, title);
		}
	});
	return false;
}

function openLightbox(content, title)
{
	$('#lightbox').overlay(
	{
	   	expose:
		{
			color: '#000', 
	       	loadSpeed: 200, 
	       	opacity: 0.2 
	   	},
	   	api: true
	}).load();
	$('#lightbox .title').html(title);
	$('#lightbox .content').html(content);
	$('#lightbox .close').html('Close');
	return false;
}

function closeLightbox()
{
	$('#lightbox').close();
}
