function PasswordReminder()
	{
		if (document.frmlogin.email.value == "")
				{
				alert('Please enter your email address first, then click the Password Reminder link');
				return false;
				}
			else
				{
				alert('A password reminder will be sent to your email address');
				document.frmlogin.actionx.value=3;
				document.frmlogin.submit();
				return true;
				}
	}


function clickthru(target)
	{
	$.get("refer.aspx", { referurl: encodeURIComponent(target)} );
	return true;
	}


function doTimeout()
{

// Redirect after 10 mins etc
	setTimeout( "timedRedirect()", 20*60*1000 );
	return true; 
}

function timedRedirect()
{
	var sTargetURL = "login.aspx?actionx=2";
    window.location.href = sTargetURL;
	alert('You have been logged out of My Gift of the Year');
}



function addproductphotos(productid,orgid)	{
	var mywin=window.open( 'photoupload.aspx?productid=' + productid + '&orgid=' + orgid, 'uploadphotos', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=450,height=480' );
	mywin.focus();
	}


/*
function checkout(f) {

    if (f.cardtype.value == 0) {
        alert('ok');
	        alert('Please select your payment method');
	        return false;
	    }
	    else if (f.cardnumber.value == "" && (f.cardtype.value != 10)) {
	        alert('Please enter your credit or debit card number');
	        return false;
	    }
	    else if ((f.cardnumber.value.length != 15) && (f.cardnumber.value.length != 16) && (f.cardnumber.value.length != 18) && (f.cardtype.value != 10)) {
	        alert('Please make sure you enter all the digits of your credit or debit card number');
	        return false;
	    }
	    else if (f.cardstartdate.value == "" && (f.cardtype.value != 10)) {
	        alert('Please enter the card start date');
	        return false;
	    }
	    else if (f.cardexpiry.value == "" && (f.cardtype.value != 10)) {
	        alert('Please enter the card expiry date');
	        return false;
	    }
	    else if (((f.cardsecurity.value.length < 3) || (f.cardsecurity.value.length > 4)) && (f.cardtype.value != 10)) {
	        alert('Please enter the security number\nFor most cards this is the last 3 digits on the BACK of the card at the top of the signature strip\nFor American Express it is the 4 digits printed on the FRONT of the card above the account number');
	        return false;
	    }
	    else if (f.cardholder.value == "" && (f.cardtype.value != 10)) {
	        alert('Please enter the card holder name');
	        return false;
	    }
//	    else if (f.charity.value != "" && isNaN(f.charity.value) == true && (f.cardtype.value != 10)) {
	    else if (f.charity.value != "") {
	        if (isNaN(f.charity.value) == true) {
	            alert('Please enter a number in the Charity contribution field, do not prefix it with currency symbol');
	            return false;
	        }
	    }
	    else if (!(f.declaration.checked)) {
	        alert('Please confirm you have read the conditions of entry - see the left side menu');
	        return false;
	    }

	    else
	        return true;

	}

*/

function check_organisation(f) {
    if (f.email.value == "") {
	        alert('Please enter your email address');
	        return false;
	    }
	    else if (f.organisation.value == "") {
	        alert('Please enter company name');
	        return false;
	    }
	    else if (f.contactname.value == "") {
	        alert('Please enter contact name');
	        return false;
	    }
	    else if (f.addr1.value == "" || f.city.value == "" || f.postcode.value == "") {
	        alert('Please enter full postal address (first line of address, city, and postcode)');
	        return false;
	    }

	    else
	        return true;

	}


function checkout(f)
	{
	
	if  (f.cardtype.value==0)
			{
			alert('Please select your payment method');
			return false;
			}
		else if (f.cardnumber.value == "" && (f.cardtype.value != 10) ) 
			{
			alert('Please enter your credit or debit card number');
			return false;
			}
			else if ((f.cardnumber.value.length != 15) && (f.cardnumber.value.length != 16) && (f.cardnumber.value.length != 18) && (f.cardtype.value != 10))
			{
			alert('Please make sure you enter all the digits of your credit or debit card number');
			return false;
			}
			else if (f.cardstartdate.value == "" && (f.cardtype.value != 10))
			{
			alert('Please enter the card start date');
			return false;
			}
			else if (f.cardexpiry.value == "" && (f.cardtype.value != 10))
			{
			alert('Please enter the card expiry date');
			return false;
			}
			else if (((f.cardsecurity.value.length < 3) || (f.cardsecurity.value.length > 4)) && (f.cardtype.value != 10))
			{
			alert('Please enter the security number\nFor most cards this is the last 3 digits on the BACK of the card at the top of the signature strip\nFor American Express it is the 4 digits printed on the FRONT of the card above the account number');
			return false;
			}
			else if (f.cardholder.value == "" && (f.cardtype.value != 10)) 
			{
			alert('Please enter the card holder name');
			return false;
			}

			else if (f.charity.value != "" && isNaN(f.charity.value) == true) {
			        alert('Please enter a number in the Charity contribution field, do not prefix it with currency symbol');
			        return false;
			}


		else if  ( !(f.declaration.checked ))   
			{
			alert('Please confirm you have read the conditions of entry - see the left side menu');
			return false;
			}

		else
			return true;
	
	}


/*
function checkouttickets(f)
	{
	
	if (f.tables.value == 0 && f.tickets.value == 0)
			{
			alert('Please specify the number of tables or single tickets you require');
			return false;
			}
		else if (f.email.value == "") 
			{
			alert('Please enter email address');
			return false;
			}
		else if (f.contactname.value == "") 
			{
			alert('Please enter contact name');
			return false;
			}
		else if (f.addr1.value == "" || f.city.value== "" || f.postcode.value == "") 
			{
			alert('Please enter address details');
			return false;
			}
		else if  (f.cardtype.value==0 && f.paymentmethod.value==0)
			{
			alert('Please select your card type');
			return false;
			}
		else if (f.cardnumber.value == ""  && f.paymentmethod.value==0) 
			{
			alert('Please enter your credit or debit card number');
			return false;
			}
		else if ( (f.cardnumber.value.length != 15) && (f.cardnumber.value.length != 16) && (f.cardnumber.value.length != 18)  && (f.paymentmethod.value==0) )
			{
			alert('Please make sure you enter all the digits of your credit or debit card number');
			return false;
			}
		else if  (f.cardstartdate.value == ""  && f.paymentmethod.value==0)
			{
			alert('Please enter the card start date');
			return false;
			}
		else if  (f.cardexpiry.value == ""  && f.paymentmethod.value==0)
			{
			alert('Please enter the card expiry date');
			return false;
			}
		else if  ( (f.cardsecuritynumber.value.length < 3)  || (f.cardsecuritynumber.value.length > 4 )  && (f.paymentmethod.value==0) )
			{
			alert('Please enter the security number\nFor most cards this is the last 3 digits on the BACK of the card at the top of the signature strip\nFor American Express it is the 4 digits printed on the FRONT of the card above the account number');
			return false;
			}
		else if   (f.cardholdername.value == ""  && f.paymentmethod.value==0) 
			{
			alert('Please enter the card holder name');
			return false;
			}
		else if  ( !(f.declaration.checked ))   
			{
			alert('Please confirm you have read the conditions of entry - see the left side menu');
			return false;
			}

		else
			return false;
	
	}
*/