function selectTextarea(theId)
{
	document.getElementById(theId).select()
}



function showLoading()
{
	$('#loading').show();
}
function hideLoading()
{
	$('#loading').hide();
}
function hideStatus()
{
	$('.error').hide();
	$('.warning').hide();
	$('.success').hide();
}


function trashIt()
{
	var pattern = /^[a-zA-Z0-9\-\._]+@[a-zA-Z0-9\-_]+(\.?[a-zA-Z0-9\-_]*)\.[a-zA-Z]{2,8}$/;
	var ascObj 	= document.getElementById("ascii");
	var uniObj 	= document.getElementById("unicode");
	var s 		= ascObj.value.toLowerCase();
	var strLen 	= s.length;
	var noErrs 	= true;
	
	if (strLen == 0)
	{
		alert('enter the email address then...');
		noErrs = false;
	}
	else
	{
		if (!pattern.test(s))
		{
			if (!confirm("the crap you entered:\n\n\"" + s + "\"" + "\n\ndoesn't look like a valid email address. \n\ndo you want to carry on anyway?"))
			{
				noErrs = false;
			}
		}
	}
	if (noErrs)
	{
		newStr = "";
		for (i=strLen-1; i>-1; i--)
		{
			newStr = "&#" + s.charCodeAt(i) + ";" + newStr;
		}
		uniObj.value = newStr;
	}
}

















// on dom load
$(function()
{
	// get the current path...
	var path = location.pathname;
	
	// highlight current navigation link
	$('#navigation li a').each(function()
	{
		if ( path.indexOf($(this).attr('href')) != -1 )
		{
			$(this).addClass('currentNavigation');
		}
	});
	// highlight current pageNav link
	$('#pageMenu li a').each(function()
	{
		//alert($(this).attr('href'));
		if ( $(this).attr('href') == path )
		{
			$(this).addClass('currentPageNav');
		}
	});
	

	
	// h1 clickable to homepage
	$('h1').click(function()
	{
		window.location = '/index.php';
	});
	
	// buttons...
	$('form input[@type=submit]').addClass('formButton');
	$('form input[@type=reset]').addClass('formButton');
	$('form input[@type=button]').addClass('formButton');
	
	
	// make the symbols bigger on the html special characters page
	$('table.niceTable tr').each(function()
	{
		$('td:first', this).css('font-size', '1.4em');
	});
	
	
	// domaincount - clear textarea button
	$('#clearDomains').click(function()
	{
		$('#domains').text('');
	});
	
	
	$('#ideaBoxOpen').click(function()
	{
		$('#ideaBoxWrap').show();
		return false;
	});
	
});
