function pop_up()
{
	var str_fname = document.getElementById('firstname').value;
	var str_lname = document.getElementById('surname').value;
	var str_email = document.getElementById('email').value;
	var str_vcode = document.getElementById('vcode').value;
	var str_mobile = document.getElementById('mobilephone').value;
	var str_state = document.getElementById('slist').value;
	var str_horse = document.getElementById('hlist').value;
	var str_msg = document.getElementById('msg').value;
	var str_synd_update = document.getElementById('syndicationupdates').checked;
	var str_synd_service = document.getElementById('syndservice').checked;
	//var str_accnt_service = document.getElementById('accntservice').checked;



	if(str_vcode != '655ca')
	{
		alert('invalid verification code');	
	}
	else
	{
			if(str_email == '')
			{
				alert("Email cannot be empty");
			}
			else
			{
				var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
				if(reg.test(str_email) == false)
				{
					alert('Invalid Email Address');
				}
								
				else
				{
					
					var str_data = 'fname='+str_fname+'&surname='+str_lname+'&email='+str_email+'&mobile='+str_mobile+'&state='+str_state+'&horse='+str_horse+'&message='+str_msg+'&syndupdate='+str_synd_update+'&syndservice='+str_synd_service;
					document.getElementById('form1').reset();
					window.open('include/confirm.asp?'+str_data,'confirmation','height=150,width=200,screenX=20,screenY=50','resizable=no');
					if (window.focus) {newwindow.focus()}
					
				}
			
			}
	}
}

//document.write("<FORM ID='form1' METHOD='POST' ACTION='/include/send-email.asp' ENCTYPE='text/plain' WIDTH='960' >");
document.write("<FORM ID='form1' METHOD='POST' ENCTYPE='text/plain' WIDTH='960' >");
document.write("<font color='white'><table border='0' cellpadding='4' width='100%' style='background-color: #783f47;>");
document.write("<tbody>");
document.write("<tr style='background-color: #783f47;' align='left' valign='top'>");
document.write("<td style='width: 20%;'>First Name</td>");
document.write("<td>Mobile Phone</td>");

document.write("<td colspan='2' style='width: 30%;'>Message</td>");
//document.write("<td></td>");
//document.write("<td style='width: 15%;' rowspan='4' align='left' valign='top'>Keep me updated about horses the TTSC are syndicating."); 
//document.write("<br /><center><input type=checkbox name=emailnewsletter value='Yes' checked=yes></center></td>");
document.write("</tr>");
document.write("<tr style='background-color: #783f47;' align='left' valign='top'>");
document.write("<td><input size='20' name='firstname' id = 'firstname' type='text' tabindex=31 /></td>");
document.write("<td><input size='20' name='mobilephone' id='mobilephone' type='text' tabindex=32 /></td>");






document.write("<td rowspan='3' colspan='2'><textarea rows='3' cols='30' name='message' id='msg' tabindex=37></textarea></td>");
document.write("<td style='width: 15%;' rowspan='4' align='left' valign='top'>"); 
document.write("<br /><left></left></td>");

document.write("</tr>");

//document.write("<tr style='background-color: #783f47;' align='left' valign='top'>");
//document.write("<td>Last Name</td>");
//document.write("</tr>");

//document.write("<tr style='background-color: #783f47;' align='left' valign='top'>");
//document.write("<td><input size='20' name='lname' id='lname' type='text' tabindex=32 /></td>");
//document.write("</tr>");

document.write("<tr style='background-color: #783f47;' align='left' valign='top'>");
document.write("<td>Surname</td>");
document.write("<td style='width: 20%;'>State</td>");

document.write("</tr>");


document.write("<tr style='background-color: #783f47;' align='left' valign='top'>");
document.write("<td><input size='20' name='surname' id='surname' type='text' tabindex=32 /></td>");
document.write("<td><select name='state' id='slist' tabindex=34 />");
document.write("<option value='' selected='selected'>- Select -</option>");
document.write("<option value='ACT'>ACT</option>");
document.write("<option value='NSW'>NSW</option>");
document.write("<option value='NT'>NT</option>");
document.write("<option value='QLD'>QLD</option>");
document.write("<option value='SA'>SA</option>");
document.write("<option value='TA'>TA</option>");
document.write("<option value='VIC'>VIC</option>");
document.write("<option value='WA'>WA</option>");
document.write("</select></td>");



document.write("</tr>");


document.write("<tr style='background-color: #783f47;' align='left' valign='top'>");
document.write("<td style='width: 20%;'>Email*</td>");
document.write("<td>Horse*</td>");
//document.write("<td></td>");

document.write("<td colspan='1' align = 'center'>Validation code</td>");
document.write("<td align='left' style='width: 30%'>Enter code</td>");
//document.write("<td style='width: 15%;' rowspan='2' align='center' valign='middle'><input value='Submit' onclick = 'display()' type='button'  tabindex=39 /></td>");
document.write("</tr>");
document.write("<tr style='background-color: #783f47;' align='left' valign='top'>");
document.write("<td><input size='20' name='email' id='email' type='text' value = '' tabindex=33 /></td>");


//horse list starts here
// to add any horses here, just add the <option></option> element with appropriate values in the following list.
document.write("<td><select name='horse' id='hlist' tabindex=35 />");
document.write("<option value='' selected='selected'>- Select -</option>");
document.write("<option value='Pins x Chuckle(Danehill) Colt'>Pins x Chuckle(Danehill) Colt</option>");
document.write("<option value='Nadeem x  Mascara Magic Colt'>Nadeem x  Mascara Magic Colt</option>");
//document.write("<option value='Rock of Gibraltar x Arboretum(Woodman) Filly'>Rock of Gibraltar x Arboretum(Woodman) Filly</option>");
document.write("<option value='Snippetson x Aves Colt'>Snippetson x Aves Colt</option>");
//document.write("<option value='Snitzel x Polka Queen filly'>Snitzel x Polka Queen filly</option>");
//document.write("<option value='Southern Image x Autumn Night(Night Shift) Colt'>Southern Image x Autumn Night(Night Shift) Colt</option>");
//document.write("<option value='Stratum x Smartchat Filly'>Stratum x Smartchat Filly</option>");
document.write("<option value='More Than Ready x Crave Filly'>More Than Ready x Crave Filly</option>");
document.write("<option value='Churchill Downs x Widescreen Colt'>Churchill Downs x Widescreen Colt</option>");
//document.write("<option value='Starcraft (NZ) x Carina Colt'>Starcraft (NZ) x Carina Colt</option>");
document.write("</select></td>");

// horse list ended


//document.write("<td></td>");
document.write("<td align='center'><img src='include/ver-img.JPG'></td>");
document.write("<right><td><input name='vercode' id='vcode' type='text' value = '' size='8' tabindex=38 /></td></right>");
//document.write("<td style='width: 15%;' rowspan='2' align='left' valign='middle'><input value='Submit' onclick = 'pop_up()' type='button'  tabindex=39 /></td>");
//document.write("</td>");
document.write("<tr><td></td></tr>");


document.write("<tr style='background-color: #783f47;' align='left' valign='top'>");
document.write("<td style='width: 40%;' rowspan='4' colspan='0' align='left' valign='top'>"); 
document.write("<left><input type=checkbox name='syndicationupdates' id='syndicationupdates'></left>Keep me updated about horses the TTSC are syndicating.</td>");
document.write("</tr>");

//document.write("<tr style='background-color: #783f47;' align='left' valign='top'>");
//document.write("<td style='width: 20%;' rowspan='4' colspan='0' align='left' valign='top'>"); 
//document.write("<left><input type=checkbox name='accntservice' id='accntservice'></left>Please send me information on the TTSC Accounting Service.</td>");
//document.write("</tr>");

document.write("<tr style='background-color: #783f47;' align='left' valign='top'>");
document.write("<td style='width: 40%;' rowspan='4' colspan='0' align='left' valign='top'>"); 
document.write("<left><input type=checkbox name='syndservice' id='syndservice'></left>Please send me information on the TTSC Syndication Service.</td>");
document.write("</tr>");

document.write("<tr style='background-color: #783f47;' align='left' valign='top'>");
document.write("<td style='width: 15%;' rowspan='2' align='left' valign='middle'></td>");
document.write("</td>");
document.write("</tr>");

document.write("<tr style='background-color: #783f47;' align='left' valign='top'>");
document.write("<td style='width: 15%;' rowspan='2' align='left' valign='middle'><input value='Submit' onclick = 'pop_up()' type='button'  tabindex=39 /></td>");
document.write("</td>");
document.write("</tr>");



document.write("</tbody>");
document.write("</table></font>");
document.write("</FORM>");


