// JavaScript Document

function savesearch(url, page)
{
	var title = '';
	var title_length = 9999;
	var promt = '';
	while ((title_length > 50) || (title == ''))
	{
		theprompt = 'Please enter a title for this search';
		title = prompt(theprompt, title);
		if (title == null)
		{
			title_length = 1;
		}
		else
		{
			title_length = title.length;
			if (title_length > 50)
			{
				alert('You have typed more than 50 letters. Please amend and resubmit.');
			}
			if (title == '')
			{
				alert('Please enter a title for this search.')
			}
		}
	}
	if ((title != '') && (title != null)) {
		window.location.href=page+"~action=savesearch,title="+title+",url="+url;
	}
}

function savesearch2()
{
	var title = '';
	var title_length = 9999;
	var promt = '';
	while ((title_length > 50) || (title == ''))
	{
		theprompt = 'Please enter a title for this search';
		title = prompt(theprompt, title);
		if (title == null)
		{
			title_length = 1;
		}
		else
		{
			title_length = title.length;
			if (title_length > 50)
			{
				alert('You have typed more than 50 letters. Please amend and resubmit.');
			}
			if (title == '')
			{
				alert('Please enter a title for this search.')
			}
		}
	}
	if ((title != '') && (title != null)) {
		document.getElementById('SSF_title').value = title;
		document.SSF_Form.submit();
	}
}


