var submitted = false;
function CheckSubmit(){
	if (submitted == false){
		submitted = true;
		return true;
	}else{
		alert('You already submitted form, please wait.');
		return false;
	}
}
function CheckLinkExchangeData(theForm){
	
	theForm.lnkSite.required = true;
	theForm.lnkSite.requiredError = 'Ooops! You forgot to enter your site URL.';
	
	theForm.lnkName.required = true;
	theForm.lnkName.requiredError = 'Ooops! Your name is missing.';
	
	theForm.lnkName.pattern = 'alphabetic';
	theForm.lnkName.patternError = '[Name_alphabetic_error]';
	
	theForm.lnkEmail.required = true;
	theForm.lnkEmail.requiredError = 'Ooops! You email is missing.';
	
	theForm.lnkEmail.pattern = 'email';
	theForm.lnkEmail.patternError = 'Ooops! Email not valid.';
	
	var errors = getFormErrors(theForm);
	if (errors.length > 0) {
		var errorMessage = 'The form was not submitted due to the following problem(s):\n\n';
		for (var errorIndex = 0; errorIndex < errors.length; errorIndex++) {
			errorMessage += '* ' + errors[errorIndex] + '\n';
		}
		errorMessage += '\nPlease fix problem(s) and resubmit the form.';
		alert(errorMessage);
		return false;
	}
	return CheckSubmit();
}
