function vFields(field,alerttxt){
	with (field) {
		if (value==null||value==""){
			alert(alerttxt);
			return false
		}
		else {
			return true
		}
	}
}
function vEmail(field,alerttxt){
	with (field){
		apos=value.indexOf("@")
		dotpos=value.lastIndexOf(".")
		if (apos<1||dotpos-apos<2) 
			  {alert(alerttxt);return false}
		else {return true}
	}
}

function contactForm(thisform){
	with (thisform){
		if (vFields(firstName,"Please enter your first name")==false){
			firstName.focus();
			return false
		}
		if (vFields(lastName,"Please enter your last name")==false){
			lastName.focus();
			return false
		}
		if (vEmail(emailAdd,"Sorry, Not a valid e-mail address!")==false){
			emailAdd.focus();
			return false
		}
		if (vFields(emailSubject,"Please enter the subject of your email")==false){
			emailSubject.focus();
			return false
		}
		if (vFields(emailEnquiry,"Please type in the message you would like to send to us.")==false){
			emailEnquiry.focus();
			return false
		}
	}
}

function loginForm(thisform){
	with (thisform){
		if (vEmail(loginEmail,"Sorry, Not a valid e-mail address!")==false){
			loginEmail.focus();
			return false
		}
		if (vFields(loginPassword,"Please enter your password")==false){
			loginPassword.focus();
			return false
		}
	}
}

function pcgcFlash(itemname, width, height, itemid){
   document.write('<object style="border:0;padding:0;margin:0;" type="application/x-shockwave-flash" data="images/'+itemname+'.swf" width="'+width+'" height="'+height+'" title="Flash Movie" id="'+itemid+'">\n');
   document.write('<param name="movie" value="images/'+itemname+'.swf" />\n');
   document.write('<param name="wmode" value="transparent" />\n');
   document.write('<param name="quality" value="high" />\n');
   document.write('</object>\n');
}

//Function for the Confirm Alert Box
function confirmRemoval() {
	var confirmBox = confirm("Are you sure you want to completely remove this item from the website.");
	if (confirmBox == false) { return false; }
}
