/*
	This file requires input_utils.js
*/

/********************
* Validation objects
********************/

var intuitLoggedOutValidation =
{
	"^-"      : "We're sorry, but we can't begin or end a domain with hyphens.", /* don't show the error message for ending with a hyphen while the user is typing */
	"[^A-Za-z0-9\-]" : "Please use letters, numbers, or hyphens only."
}

var intuitLoggedOutValidationSubmit =
{
	"^-|-$"    : "We're sorry, but we can't begin or end a domain with hyphens.",
	"[^A-Za-z0-9\-]"  : "Please use letters, numbers, or hyphens only.",
	"^.{0,1}$" : "Please enter a valid domain name of at least 2 characters."
}

var suggestionValidation =
{
	"[^A-Za-z0-9\\s-,]" : "We're sorry, but we can only use letters, numbers, hyphens, or commas." /* we allow spaces, but that's not part of the error message */
}

var suggestionValidationSubmit =
{
	"[^A-Za-z0-9\\s-,]" : "We're sorry, but we can only use letters, numbers, hyphens, or commas.", /* we allow spaces, but that's not part of the error message */
	"^.{0,1}$" : "Please enter at least 2 characters."
}
 
/*************************************
* Wrappers for input_utils.js's checkInput function
*************************************/

function checkDomainIntuitLO(domainNameInputId, errorDivID, bSubmit)
{
	return checkInput(bSubmit ? intuitLoggedOutValidationSubmit : intuitLoggedOutValidation, domainNameInputId, errorDivID);
}

function checkSuggestions(suggestionInputId, errorDivID, bSubmit)
{
	return checkInput(bSubmit ? suggestionValidationSubmit : suggestionValidation, suggestionInputId, errorDivID);
}

