function Show(id){
	
	var answer = confirm ("Will Make this Entry as being Shown on the Public Website.\nAre you sure you wish to continue ? ");

	if (answer)	{
		
		var absolute = confirm ("Are you Absolutely Positive ? ");
		if (absolute)	{
			
			window.location.href = "?action=show&id=" + id + "&display=y";
		}
		
	}
	
}

function Hide(id){
	
	var answer = confirm ("Will Make this Entry as being Hidden on the Public Website.\nAre you sure you wish to continue ? ");

	if (answer)	{
		
		var absolute = confirm ("Are you Absolutely Positive ? ");
		if (absolute)	{
			
			window.location.href = "?action=show&id=" + id + "&display=n";
		}
		
	}
	
}
function CompetitionEntry(){
	
	var frm = document.competitionform;

	
	if ( frm.event.value == '' ) {
		alert("Must Enter Event or Show Photo Take At");
		frm.event.focus();
		return false;
	}

	if ( frm.photo.value == '' ) {
		alert("Must Select a Photo To Upload");
		frm.photo.focus();
		return false;
	}

	if ( frm.caption.value == '' ) {
		alert("Must Give the Photo A Caption");
		frm.caption.focus();
		return false;
	}


	if ( frm.firstname.value == '' ) {
		alert("Must Supply your First Name");
		frm.firstname.focus();
		return false;
	}


	
	if ( frm.surname.value == '' ) {
		alert("Must Supply your Surname");
		frm.surname.focus();
		return false;
	}

	if ( frm.suburb.value == '' ) {
		alert("Must Provide your Suburb");
		frm.suburb.focus();
		return false;
	}	
	
	if ( frm.state.value == '' ) {
		alert("Must Select a State");
		frm.state.focus();
		return false;
	}

	if ( frm.telephone.value == '' ) {
		alert("Must Provide your Telephone Contact");
		frm.telephone.focus();
		return false;
	}

	if ( frm.email.value == '' ) {
		alert("Must Provide your Email Contact");
		frm.email.focus();
		return false;
	}	

	if ( frm.confirmemail.value == '' ) {
		alert("Must Confirm Your Email");
		frm.confirmemail.focus();
		return false;
	}	
	
	if ( frm.email.value != frm.confirmemail.value ) {
		alert("Emails do Not Match");
		frm.email.focus();
		return false;
	}
	
	if ( !ValidEmailAddress( frm.email.value ) ) {
		alert("Email does not appear to be valid");
		frm.email.focus();
		return false;
	}

	frm.action = "?action=submit";
	frm.submit();
}


function ValidEmailAddress(strEmailAddress) {
	// Used to check if an email address is valid or not. Returns true if valid, otherwise returns false.
	var re = /^[a-zA-Z0-9\_\-\'\&\*\!\#]+(\.[a-zA-Z0-9\_\-\'\&\*\!\#]+)*\@[a-zA-Z0-9\_\-\'\&\*\!\#]+(\.[a-zA-Z0-9\_\-\'\&\*\!\#]+)*\.([A-Za-z]{2,4}|[0-9]{1,3})$/;
	if (!re.test(strEmailAddress))
		return false;
	return true;
}