
function linkDetailVerification()
{
	var themessage = "You are required to complete the following fields:\n\r";
	if (document.myform.link_url.value=="")
	{
		themessage = themessage + " - Full URL\n\r";
	}
	if (document.myform.link_description.value=="")
	{
		themessage = themessage + " - Description\n\r";
	}
	if (!isInteger(document.myform.link_orderby.value))
	{
		themessage = themessage + " - Order must be an integer\n\r";
	}
	if (document.myform.link_url.value.match("<") == '<'
		|| document.myform.link_description.value.match("<") == '<'
		|| document.myform.link_text.value.match("<") == '<'
		|| document.myform.link_orderby.value.match("<") == '<')
	{
		themessage = themessage + " - No HTML allowed, please\n\r";
	}

	if (themessage == "You are required to complete the following fields:\n\r")
	{
		document.myform.submit();
	}
	else
	{
		alert(themessage);
		return false;
	}
}


function bioVerification()
{
	var themessage = "You are required to complete the following fields:\n\r";
	if (document.myform.columnist_first.value=="")
	{
		themessage = themessage + " - First Name\n\r";
	}
	if (document.myform.columnist_password.value=="")
	{
		themessage = themessage + " - Password\n\r";
	}

	if (themessage == "You are required to complete the following fields:\n\r")
	{
		document.myform.submit();
	}
	else
	{
		alert(themessage);
		return false;
	}
}


function askVerification()
{
	var themessage = "You are required to complete the following fields:\n\r";
	if (document.myform.qtext.value=="")
	{
		themessage = themessage + " - Question\n\r";
	}
	if (document.myform.qtext.value.match("<") == '<')
	{
		themessage = themessage + " - No hyperlinks allowed, please\n\r";
	}
	if (themessage == "You are required to complete the following fields:\n\r")
	{
		document.myform.submit();
	}
	else
	{
		alert(themessage);
		return false;
	}
}


function contactVerification()
{
	var themessage = "You are required to complete the following fields:\n\r";
	if (document.myform.comments.value=="")
	{
		themessage = themessage + " - Comments\n\r";
	}
	if (document.myform.email_address.value==""
		|| document.myform.email_address.value.indexOf("@") < 0
		|| document.myform.email_address.value.indexOf(".") < 0)
	{
		themessage = themessage + " - Email Address\n\r";
	}
	if (document.myform.first_name.value=="")
	{
		themessage = themessage + " - First Name\n\r";
	}
	if (document.myform.last_name.value=="")
	{
		themessage = themessage + " - Last Name\n\r";
	}
	if (document.myform.comments.value.match("<") == '<'
		|| document.myform.email_address.value.match("<") == '<'
		|| document.myform.first_name.value.match("<") == '<'
		|| document.myform.last_name.value.match("<") == '<')
	{
		themessage = themessage + " - No hyperlinks allowed, please\n\r";
	}
	if (themessage == "You are required to complete the following fields:\n\r")
	{
		document.myform.submit();
	}
	else
	{
		alert(themessage);
		return false;
	}
}


function updateVerification()
{
	var themessage = "You are required to complete the following fields:\n\r";
	if (document.myform.last_name.value=="")
	{
		themessage = themessage + " - Last Name\n\r";
	}
	if (document.myform.first_name.value=="")
	{
		themessage = themessage + " - First Name\n\r";
	}
	if (document.myform.email_address.value==""
		|| document.myform.email_address.value.indexOf("@") < 0
		|| document.myform.email_address.value.indexOf(".") < 0)
	{
		themessage = themessage + " - Email Address\n\r";
	}
	if (document.myform.email_address.value.match("<") == '<'
		|| document.myform.first_name.value.match("<") == '<'
		|| document.myform.last_name.value.match("<") == '<')
	{
		themessage = themessage + " - No hyperlinks allowed, please\n\r";
	}

	if (themessage == "You are required to complete the following fields:\n\r")
	{
		document.myform.submit();
	}
	else
	{
		alert(themessage);
		return false;
	}
}


function answerVerification()
{
	var themessage = "You are required to complete the following fields:\n\r";
	if (document.myform.answer_text.value=="")
	{
		themessage = themessage + " - Your Answer\n\r";
	}

	if (themessage == "You are required to complete the following fields:\n\r")
	{
		document.myform.submit();
	}
	else
	{
		alert(themessage);
		return false;
	}
}


function openme(url)
{
	var isIE3=false;
	var aV=navigator.appVersion.charAt(0);
	if(aV>3 && navigator.appCodeName=='Mozilla')
	{
	}
	else if(aV==2)
	{
		isIE3=(-1<navigator.userAgent.toLowerCase().indexOf('msie'));
	}
	if( isIE3 )
	{
		alert('IE3 is not compatible with this Pop-Up');
		return;
	}
	var where=url;
	open(where,"SBWIN","toolbar=yes,directories=no,location=yes,status=no,menubar=yes,resizable=no,screenx=10,screeny=10,width=590,height=370,top=10,left=10,scrollbars=yes");
}


function isInteger(s)
{
	var i;

	if (isEmpty(s))
	if (isInteger.arguments.length == 1) return 0;
	else return (isInteger.arguments[1] == true);

	for (i = 0; i < s.length; i++)
	{
		var c = s.charAt(i);
		if (!isDigit(c)) return false;
	}
	return true;
}


function isEmpty(s)
{
	return ((s == null) || (s.length == 0))
}


function isDigit (c)
{
	return ((c >= "0") && (c <= "9"))
}
