// JavaScript Document

function isValidEmail(e)
{
	// assume an email address cannot start with an @ or white space, but it
	// must contain the @ character followed by groups of alphanumerics and '-'
	// followed by the dot character '.'
	// It must end with 2 or 3 alphanumerics.
	//
	var alnum="a-zA-Z0-9";
	exp="^[^@\\s]+@(["+alnum+"+\\-]+\\.)+["+alnum+"]["+alnum+"]["+alnum+"]?$";
	emailregexp = new RegExp(exp);

	result = e.match(emailregexp);
	if (result != null)
	{
		return true;
	}
	else
	{
		return false;
	}
}

// checks whether a field is empty
function isblank(s)
{
    for(var i = 0; i < s.length; i++) {
        var c = s.charAt(i);
        if ((c != ' ') && (c != '\n') && (c != '\t')) return false;
    }
    return true;
}
function stripHTMLTags(str)
{	var mystr="";
	var chr="";
	var skip=false;
	var skipcancel=false;
	
	for (x=0; x<str.length; x++)
	{
		if (skipcancel==true){skip=false;}
		chr=str.charAt(x);
		if (chr=="<"){skip=true;skipcancel=false;}
		else if (chr==">" && skip==true){skipcancel=true;}
		
		if (skip==false) mystr=mystr+chr;
	}
	return mystr;
}