/*
	Name         : /publisher/js/publisher.js
	Author       : Frank Marion
	Created      : Wednesday, June 20, 2007; 6:41 PM
	Last Updated : Wednesday, June 20, 2007; 6:41 PM
	History      : Creation.
	Purpose		 : Error checking for the article search field
*/

// Error checking for the article search field
function CompleteMe() {
	var f = document.getElementById('article_search_field');
	var colour = 'salmon';
	var errorstring='';
	if (f.value.length == 0) {
		errorstring += 'Please enter one or more words to search against';
	}
	if (f.value == 'Keywords') {
		errorstring += 'Please enter one or more words to search against';
	}
	if (errorstring != '') {
		f.style.backgroundColor=colour;
		alert(errorstring);
		return false;
	} else {
		return true;
	}
}


// Does error checking on the membership login form

function CompleteLogin(theForm) {
var userName = document.getElementById('MemberUserName');
var password = document.getElementById('MemberPassword');
var errorstring='';
	 if (userName.value.length == 0)
		errorstring += 'your login name\n';
	 if (userName.value == 'Your login name')
		errorstring += 'your login name \n';
	 if (password.value.length == 0)
		errorstring += 'your password \n';
	 if (password.value == 'Your password')
		errorstring += 'your password \n';
if (errorstring != '')
	{
	userName.style.backgroundColor='salmon';
	password.style.backgroundColor='salmon';
	alert('Please enter \n' + errorstring);
	return false;
	} else {
	return true;
	}
}
