var errMsgHeader = "<strong>Some of your information is incorrect or missing: </strong>";
var errMsgFormatEmail = "The email information you entered is not in the proper format for an email address. Please update your information using the following format: Name@companyname.com";
var errMsgMatchEmail = "The email addresses you entered do not match. Please re-enter your email address.";


//Dynamiclly display message instead of refresh the page with asp
function displayText (message, id)
{
		
		var errMsgHeader = "<strong>Some of your informatin is incorrect or missing: </strong>";
		if (document.getElementById) 
		{   doc = document.getElementById(id); 
			doc.innerHTML = ''; 
			doc.innerHTML = message; 
		} 
		else if (document.all)
			{document.all[id].innerHTML =  message}
		else if (document.layers) 
		{	doc = document.layers[id];
			doc.document.open();
	        doc.write(message);
	        doc.close();
		}
		
		
}


//Check field's value for bad words
function chkProf(strField) {

	var wordlist = "fuck|shit|nigger|nigga|niggaz|niggas|bitch|cunt|asshole|pussy|cocksucker|piss|tits|titties|whore|ass";
	wordlistarray = wordlist.split("|");
	var strText = ""
	strText = strField.toLowerCase();
	for(i=0; i<=wordlistarray.length-1; i++)
	{	
		if (strText.indexOf(wordlistarray[i]) != -1)
			{return true;}
	}
	return false;
}


//Check if a field has any thing(include space)
function isblank(svalue)
{	svalue1 = new String(svalue);
	for(var i = 0; i < svalue1.length; i++) 
	{	var c = svalue1.charAt(i);
		if((c != ' ') && (c != '\n') && (c!='\t')) return false;
	} return true;
}
//Check if the email format is correct
function isEmail(string) {
    if (string.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1)
        return true;
    else
        return false;
}
//Check if a field's value is integer.
function isInteger (s)
{   var i;
    // Search through string's characters one by one
    // until we find a non-numeric character.
    // When we do, return false; if we don't, return true.
    for (i = 0; i < s.length; i++)
    {  // Check that current character is number.
        var c = s.charAt(i);
        if (!isDigit(c)) return false;
    } return true;
}
function isDigit (c)
{   return ((c >= "0") && (c <= "9"))}

