var linkclear_count = 0;
var searchclear_count = 0;

function bump_link_before(prefix, link_id)
{
	if (prefix != '') {prefix = prefix+'_'; }
	Element.hide(''+prefix+'ajax_bump_it_id_'+link_id+'');
	Element.hide(''+prefix+'ajax_dump_it_id_'+link_id+'');
	Effect.Fade(''+prefix+'total_bumps_id_'+link_id+'', { queue: { position: 'end', scope: ''+link_id+'' } });
}

function bump_link_complete(prefix, link_id)
{
	if (prefix != '') { prefix = prefix+'_'; }
	Effect.Appear(''+prefix+'total_new_bumps_id_'+link_id+'', { queue: { position: 'end', scope: ''+link_id+'' } });
	Effect.Appear(''+prefix+'bumped_id_'+link_id+'', { queue: { position: 'end', scope: ''+link_id+'' } });
}

function dump_link_before(prefix, link_id)
{
	if (prefix != '') {prefix = prefix+'_'; }
	Element.hide(''+prefix+'ajax_dump_it_id_'+link_id+'');
	Element.hide(''+prefix+'ajax_bump_it_id_'+link_id+'');
	Effect.Fade(''+prefix+'total_bumps_id_'+link_id+'', { queue: { position: 'end', scope: ''+link_id+'' } });
}

function dump_link_complete(prefix, link_id)
{
	if (prefix != '') { prefix = prefix+'_'; }
	Effect.Appear(''+prefix+'total_new_bumps_id_'+link_id+'', { queue: { position: 'end', scope: ''+link_id+'' } });
	Effect.Appear(''+prefix+'dumped_id_'+link_id+'', { queue: { position: 'end', scope: ''+link_id+'' } });
}

function toggle_it( targetId )
{
	if ( document.getElementById )
	{
		target = document.getElementById( targetId );
		if ( target.style.display == "none" )
		{
			target.style.display = "";
		} 
		else
		{
			target.style.display = "none";
		}
	}
	return false;
}

function searchclear(thisfield)
{
	if (searchclear_count == 0) {
		thisfield.value = "";
		searchclear_count++;
	}
}

function linkclear(thisfield)
{
	if (linkclear_count == 0) {
		thisfield.value = "";
		linkclear_count++;
	}
}

function clickrecall(thisfield, defaulttext)
{
	if (thisfield.value == "")
	{
		thisfield.value = defaulttext;
	}
}

function session_expired()
{
	alert("Your session has expired. Please login.");
	window.location = "/login";
}

function spam_control()
{
	alert("It looks like you may be a spammer.");
	window.location = "/logout";
}


function login_to_comment()
{
	alert("You must login to comment.");
	window.location = "/login";
}

function untrusted()
{
	alert("Because this link has less than 20 bumps, it's not trusted. You can login to view the external URL.");
	return false;
}