// JavaScript Document
re = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/

		function checkEmail() {
			if (re.test(document.frmCreate.txtEmail.value)) {
				checkForm()
				return true
			}
			alert("Invalid email address")
			document.frmCreate.txtEmail.focus()
			document.frmCreate.txtEmail.select()
			return false
		}
	
function dates (){
if (document.frmCreate.txtEmail.value =="")
	{
	alert ("Please enter your email address")
	document.frmCreate.txtEmail.focus();
	return false;
	}		
if (document.frmCreate.txtEmail.value !="")
	{
	checkEmail()
	return false;
	}
}
function checkForm(){
if (document.frmCreate.txtEmailConfirm.value =="")
	{
	alert ("Please confirm your email address")
	document.frmCreate.txtEmailConfirm.focus();
	return false;
	}
if (document.frmCreate.txtEmailConfirm.value != document.frmCreate.txtEmail.value)
	{
	alert ("Your email addresses do not match")
	document.frmCreate.txtEmailConfirm.focus();
	document.frmCreate.txtEmailConfirm.select();
	return false;
	}
	if (document.frmCreate.txtPassword.value =="")
	{
	alert ("Please enter a password")
	document.frmCreate.txtPassword.focus();
	return false;
	}
	if (document.frmCreate.txtPasswordConfirm.value =="")
	{
	alert ("Please confirm your password")
	document.frmCreate.txtPasswordConfirm.focus();
	return false;
	}
	if (document.frmCreate.txtPasswordConfirm.value != document.frmCreate.txtPassword.value)
	{
	alert ("Your passwords do not match")
	document.frmCreate.txtPasswordConfirm.focus();
	document.frmCreate.txtPasswordConfirm.select();	
	return false;
	}
	
        var d = new Date(); //creates a new date
var dd = d.getDate(); //retrieves the date from the system
var mm = d.getMonth() + 1; //retrieves the month JS starts counting at zero, so add a 1 to start January at 1
var yyyy = d.getYear(); //retrieves the year
if (yyyy < 1000) yyyy = yyyy + 1900;
var hh = d.getHours();
var mins = d.getMinutes();
var sec = d.getSeconds();
var now = dd + "/" + mm + "/" + yyyy +" "+ hh +":"+ mins +":"+ sec; //formats the date*/
document.frmCreate.txtStart.value = now; //puts the value retrieved from the system in the sysDt field
document.frmCreate.submit();
return true
    } 


function enter()
{
document.frmMain.txtEmail.focus();
}

i=0
function rotate()
{
	if (i<3)
	{
		i++
		logo.src="C:/WINDOWS/Desktop/rotate"+i+".jpg"
	}
	else
	{
		i=1
		logo.src="C:/WINDOWS/Desktop/rotate"+i+".jpg"
	}
	setTimeout("rotate()",1500)
}

function pledge (){
if (document.frmCreate.txtName.value =="")
	{
	alert ("Please enter your name")
	document.frmCreate.txtName.focus();
	return false;
	}
if (document.frmCreate.txtAddress.value =="")
	{
	alert ("Please enter your address")
	document.frmCreate.txtAddress.focus();
	return false;
	}
if (document.frmCreate.txtTelephone.value =="")
	{
	alert ("Please enter your telephone number")
	document.frmCreate.txtTelephone.focus();
	return false;
	}
if (document.frmCreate.txtEmail.value =="")
	{
	alert ("Please enter your email address")
	document.frmCreate.txtEmail.focus();
	return false;
	}
if (document.frmCreate.txtDonation.value !="ns")
    {
        var d = new Date(); //creates a new date
var dd = d.getDate(); //retrieves the date from the system
var mm = d.getMonth() + 1; //retrieves the month JS starts counting at zero, so add a 1 to start January at 1
var yyyy = d.getYear(); //retrieves the year
if (yyyy < 1000) yyyy = yyyy + 1900;
var hh = d.getHours();
var mins = d.getMinutes();
var sec = d.getSeconds();
var now = dd + "/" + mm + "/" + yyyy +" "+ hh +":"+ mins +":"+ sec; //formats the date*/
document.frmCreate.txtStart.value = now; //puts the value retrieved from the system in the sysDt field
document.frmCreate.submit();
return true
    } 
alert("Please select the amount you wish to pledge"); 
        document.frmCreate.txtDonation.focus();
        return false;
}




function rotate()

{	i=0

	if (i<3)
	{
		i++
		document.getElementById("logo").src="../images/rotate"+i+".jpg"
	}
	else
	{
		i=1
		document.getElementById("logo").src="../images/rotate"+i+".jpg"
	}
	setTimeout("rotate()",10000)
}


