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_address = document.getElementById('address').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. Please retype the verification code.');	
	}
	else
	{
			if(str_fname == '')
			{
				alert("Please provide your First name");
			}
			else
			{
				if(str_lname == '')
				{
					alert("Please provide your Surname");
				}
				else
				{
					if(str_msg == '')
					{
						alert("Please enter your enquiry.");
					}
					else
					{
						if(str_email == '')
						{
							alert("Please provide an Email address");
						}
						else
						{
							var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
							if(reg.test(str_email) == false)
							{
								alert('Please provide a valid Email address');
							}
											
							else
							{
								
								var str_data = 'fname='+str_fname+'&surname='+str_lname+'&address='+str_address+'&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' enctype='text/plain'>");
document.write("<div class='horse-sale'><img src='design/images/thumb-box/ttsc-horse-thumb-box-head.jpg' width='477' height='17' style='clear:both' />");
document.write("<table width='460' border='0' cellspacing='0' align='center' cellpadding='5' style='font-weight:bold;'> ");
  document.write("<tr>");
    document.write("<td width='48%'><span style='width: 20%;'>First name*</span></td>");
    document.write("<td width='52%'><input size='20' name='firstname' id = 'firstname' type='text' tabindex='31' /></td>");
  document.write("</tr>");
  document.write("<tr>");
    document.write("<td>Surname*</td>");
    document.write("<td><input size='20' name='surname' id='surname' type='text' tabindex='32' /></td>");
 document.write(" </tr>");
  document.write("<tr>");
      document.write("<td>Address</td>");
    document.write("<td><input size='20' name='address' id='address' type='text' value = '' tabindex='33' /></td>");
	 document.write("</tr>");
  document.write("<tr>");
    document.write("<td>Mobile Phone</td>");
    document.write("<td><input size='20' name='mobilephone' id='mobilephone' type='text' tabindex='34' /></td>");
 document.write(" </tr>");
  document.write("<tr>");
    document.write("<td><span style='width: 20%;'>Email*</span></td>");
    document.write("<td><input size='20' name='email' id='email' type='text' value = '' tabindex='35' /></td>");
  document.write("</tr>");
  document.write("<tr>");
    document.write("<td><span style='width: 20%;'>State</span></td>");
    document.write("<td><select name='state' id='slist' tabindex='36'>");
      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>");
    document.write("<td>Horse, General or Expression of Interest Enquiry</td>");
    document.write("<td><select name='horse' id='hlist' tabindex='37' >");
      document.write("<option value='General Enquiry' selected='selected'>- General Enquiry -</option>");
	  document.write("<option value='Expression Of Interest - Share Purchase'>- Expression Of Interest - Share Purchase -</option>");
	  document.write("<option value='Expression Of Interest - TTSC Racehorse Syndication Service'>- Expression Of Interest - Syndication Service -</option>");
	  document.write("<option value='Dubai Destination x Bedouin Princess'>Dubai Destination x Bedouin Princess</option>");
	  document.write("<option value='Haradasun x Moment I Treasure'>Haradasun x Moment I Treasure</option>");
	  document.write("<option value='Host x Eve Ho'>Host x Eve Ho</option>");
	  document.write("<option value='Zeditave x Whiz Bang Lady'>Zeditave x Whiz Bang Lady</option>");
	  document.write("<option value='Lion Heart x Raging Inferno'>Lion Heart x Raging Inferno</option>");
	  document.write("<option value='Lago Delight x Annie Joy'>Lago Delight x Annie Joy</option>");
	  document.write("<option value='Pins x Shes Innocent'>Pins x Shes Innocent</option>");
    document.write("</select></td>");
  document.write("</tr>");
  document.write("<tr><td>&nbsp;</td><td><span style='width: 30%;'>Message*</span></td></tr>");
  document.write("<tr>");
    document.write("<td valign='top'>");
    	document.write("<p style='font-weight:normal'><input type=checkbox name='syndicationupdates' id='syndicationupdates' checked='yes'/> Keep me updated about horses the TTSC are syndicating.</p>");
      	document.write("<p style='font-weight:normal'><input type=checkbox name='syndservice' id='syndservice' /> Please send me information on the TTSC Racehorse Syndication.</p>");
      	//document.write("<p><input type=checkbox name='emailnewsletter' value='Yes' checked='yes' /> Keep me updated about horses the TTSC are syndicating.</p>");
	document.write("</td>");
    document.write("<td valign='top'><textarea rows='5' cols='25' name='message' id='msg' tabindex='38'></textarea></td>");
  document.write("</tr>");
  document.write("<tr><td>&nbsp;</td><td>&nbsp;</td></tr>");
  document.write("<tr>");
    document.write("<td>Validation code <img src='include/ver-img.JPG' /></td>");
    document.write("<td><span style='width: 30%'>Enter code* <input name='vercode' id='vcode' type='text' value = '' size='8' tabindex='39' /></span></td>");
  document.write("</tr>");
  document.write("<tr><td>&nbsp;</td><td><span style='width: 15%;'><input value='Submit' onclick = 'pop_up()' type='button'  tabindex='40' /></span></td></tr>");
document.write("</table><div class='extras-container'></div></div>");
document.write("</form>");




