function getDomain()
{
	domain = 'http://' + document.location.toString().match(/:\/\/(.[^\/]+\/(cms.bg){0,1})/)[1];
	return domain;
}

function secureFORM()
{
	domain = getDomain();
	
	$('input[name="submit"]').ajaxStop(function()
	{
		$(this).val($(this).attr('title'));
		$(this).get(0).disabled = false;
	});
	
	$.ajax(
	{
		
		type: "GET",
		url: domain + 'libraries/services/token.php',
		cache: false,
		success: function(response)
		{
			var token = $('<input type="hidden">');
			$(token).attr('name','security').val(response).appendTo('#cmsform');
		}
	});
}