<!--
/* Shih Tzu Club feedback form validation script */
/* Originally written by Daniel Bloor, modified by Adam Crossley */

/* Some constant text things I need for my message boxes */
var q="\""
var a="Please enter"
var b=" your"
var c=" a"
var f=" Email Address"
var g=" Name"
var j=" Message Subject"
var k=" Message for us!"
var s=false

function FFV(tF){
/* check the field called Name has something in it */
if(tF.name.value=="")
/* if not show a message */
{alert(a+b+g)

tF.name.focus();return(s)}

/* Check that the Email field has something in it */
if(tF.email.value=="")
{alert(a+b+f)
tF.email.focus();return(s)}

var pV=tF.email.value;
var at=pV.indexOf("@",0)
var dot=pV.indexOf(".",at)
var el=pV.length
/* validate the email address 
 Check it contains an @ and at least 1 dot
 Check there's something before the @
 Check that there's atleast 2 characters after the dot */
if (at<1||((el-dot)<2))
{alert(a+"a valid "+q+f+q+".")
tF.email.focus();return(s)}

/* check the field called subject has something in it */
if(tF.subject.value=="")
/* if not show a message */
{alert(a+c+j)

tF.subject.focus();return(s)}

/* check the filed called msg has something in it */
if(tF.msg.value=="")
/* if not show a message */
{alert(a+c+k)

tF.msg.focus();return(s)}

return (true);}
//-->