// JavaScript Document


function popupWindow(url) {
  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=300,height=300,screenX=150,screenY=150,top=150,left=150')
}

function verify(form)
        {
		
		
		if (window.document.myform.title_add.value=="")
{
alert("please enter your Title!");
window.document.myform.title_add.focus();
return false;
}


if (window.document.myform.name_add.value=="")
{
alert("please enter the Name of person to prayed for!");
window.document.myform.name_add.focus();
return false;
}

if (window.document.myform.request_add.value=="")
{
alert("please type your Prayer reuest!");
window.document.myform.request_add.focus();
return false;
}

if (window.document.myform.fname_add.value=="")
{
alert("please enter your name!");
window.document.myform.fname_add.focus();
return false;
}

if (window.document.myform.lname_add.value=="")
{
alert("please enter your last name!");
window.document.myform.lname_add.focus();
return false;
}
		
		
        var passed = false;
        var blnRetval, intAtSign, intDot, intComma, intSpace, intLastDot, intDomain, intStrLen;
        if (form.email_add){
                       intAtSign=form.email_add.value.indexOf("@");
                        intDot=form.email_add.value.indexOf(".",intAtSign);
                        intComma=form.email_add.value.indexOf(",");
                        intSpace=form.email_add.value.indexOf(" ");
                        intLastDot=form.email_add.value.lastIndexOf(".");
                        intDomain=intDot-intAtSign;
                        intStrLen=form.email_add.value.length;
                // *** CHECK FOR BLANK EMAIL VALUE
                   if (form.email_add.value == "" || form.email_add.value == "Email" )
                   {
                alert("You have not entered an email address.");
                form.email_add.focus();
                passed = false;
                }
                // **** CHECK FOR THE  @ SIGN?
                else if (intAtSign == -1)
                {

                alert("Your email address is missing the \"@\".");
                        form.email_add.focus();
                passed = false;

                }
                // **** Check for commas ****

                else if (intComma != -1)
                {
                alert("Email address cannot contain a comma.");
                form.email_add.focus();
                passed = false;
                }

                // **** Check for a space ****

                else if (intSpace != -1)
                {
                alert("Email address cannot contain spaces.");
                form.email_add.focus();
                passed = false;
                }

                // **** Check for char between the @ and dot, chars between dots, and at least 1 char after the last dot ****

                else if ((intDot <= 2) || (intDomain <= 1)  || (intStrLen-(intLastDot+1) < 2))
                {
                alert("Please enter a valid Email address.\n" + form.email_add.value + " is invalid.");
                form.email_add.focus();
                passed = false;
                }
                else {
                        passed = true;
                }
        }
        else    {
                passed = true;
        }
        return passed;
		
		var agree=confirm("Are you sure you wish to continue?");
		if (agree)
		return true ;
		else
		return false ;
	
  	}
	
