function checkEmail(eAddress){

 var filter=/^.+@.+\..{2,3}$/

 if (filter.test(eAddress))
 	{
    	return true;
	}
 else 
 	{
    	return false;
	}
}

function trim(tStr) {
	var whitespace = ' \n\r\t\f\x0b\xa0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000';
	for (var i = 0; i < tStr.length; i++) {
		if (whitespace.indexOf(tStr.charAt(i)) === -1) {
			tStr = tStr.substring(i);
			break;
		}
	}
	for (i = tStr.length - 1; i >= 0; i--) {
		if (whitespace.indexOf(tStr.charAt(i)) === -1) {
			tStr = tStr.substring(0, i + 1);
			break;
		}
	}
	return whitespace.indexOf(tStr.charAt(0)) === -1 ? tStr : '';
}

function PermitContinue(which) 
{
	var permit = true;
	
	var Email1 = which.Email_Address.value;
	var Email2 = which.SecondaryEmail_Address.value;

	document.getElementById("PreResponse1").value = "";																
	document.getElementById("PreResponse2").value = "";
	document.getElementById("PreResponse3").value = "";
	document.getElementById("PreResponse3").value = "";	
	
	if (trim(which.TransactionID.value) == "")
		{
			document.getElementById("TransactionID_Label").innerHTML = "<span class=\"red\" >*Transaction ID</span>";
			permit = false;
		} 
	else
		{
			document.getElementById("TransactionID_Label").innerHTML = "*Transaction ID";
		} 		
		
	if (checkEmail(Email1) == false)
		{
			document.getElementById("Email_Address_Label").innerHTML = "<span class=\"red\" >*Email</span>";
			permit = false;
		}
	else
		{
			document.getElementById("Email_Address_Label").innerHTML = "*Email";
		}		
		
	if (checkEmail(Email2) == false)
		{
			document.getElementById("SecondaryEmail_Address_Label").innerHTML = "<span class=\"red\" >*Secondary Email</span>";
			permit = false;
		}
	else
		{
			document.getElementById("SecondaryEmail_Address_Label").innerHTML = "*Secondary Email";
		}	
				
	if (trim(which.ContactName.value) == "")
		{
			document.getElementById("ContactName_Label").innerHTML = "<span class=\"red\" >*Contact Name</span>";
			permit = false;
		} 
	else
		{
			document.getElementById("ContactName_Label").innerHTML = "*Contact Name";
		} 			
		
	if (parseInt(which.OS_QuestionType.value) == 0)
		{
			document.getElementById("OS_QuestionType_Label").innerHTML = "<span class=\"red\" >*Operating System</span>";
			permit = false;
		} 
	else
		{
			document.getElementById("OS_QuestionType_Label").innerHTML = "*Operating System";
		} 		
		
	if (parseInt(which.OS_QuestionType.value) == 1)
		{
			document.getElementById("OS_QuestionTypeString").value = "Microsoft Windows 7 Ultimate";
				
		} 
	else if (parseInt(which.OS_QuestionType.value) == 2)
		{
			document.getElementById("OS_QuestionTypeString").value = "Microsoft Windows 7 Professional";					
		}
	else if (parseInt(which.OS_QuestionType.value) == 3)
		{
			document.getElementById("OS_QuestionTypeString").value = "Microsoft Windows 7 Home Premium";					
		}
	else if (parseInt(which.OS_QuestionType.value) == 4)
		{
			document.getElementById("OS_QuestionTypeString").value = "Microsoft Windows Vista Ultimate";					
		}
	else if (parseInt(which.OS_QuestionType.value) == 5)
		{
			document.getElementById("OS_QuestionTypeString").value = "Microsoft Windows Vista Enterprise";					
		} 
	else if (parseInt(which.OS_QuestionType.value) == 6)
		{
			document.getElementById("OS_QuestionTypeString").value = "Microsoft Windows Vista Business";						
		} 
	else if (parseInt(which.OS_QuestionType.value) == 7)
		{
			document.getElementById("OS_QuestionTypeString").value = "Microsoft Windows Vista Home Premium";
		} 
	else if (parseInt(which.OS_QuestionType.value) == 8)
		{
			document.getElementById("OS_QuestionTypeString").value = "Microsoft Windows Vista Home Basic";
					} 
	else if (parseInt(which.OS_QuestionType.value) == 9)
		{
			document.getElementById("OS_QuestionTypeString").value = "Microsoft Windows XP Professional";		
		} 
	else if (parseInt(which.OS_QuestionType.value) == 10)
		{
			document.getElementById("OS_QuestionTypeString").value = "Microsoft Windows XP Home";
		} 
	else if (parseInt(which.OS_QuestionType.value) == 11)
		{
			document.getElementById("OS_QuestionTypeString").value = "Microsoft Windows XP Media Center Edition";
		} 
	else if (parseInt(which.OS_QuestionType.value) == 12)
		{
			document.getElementById("OS_QuestionTypeString").value = "Microsoft Windows 2000";
		} 
	else if (parseInt(which.OS_QuestionType.value) == 13)
		{
			document.getElementById("OS_QuestionTypeString").value = "Microsoft Windows NT";
		} 								
	else if (parseInt(which.OS_QuestionType.value) == 14)
		{
			document.getElementById("OS_QuestionTypeString").value = "Microsoft Windows Mobile 6";
		} 								
	else if (parseInt(which.OS_QuestionType.value) == 15)
		{
			document.getElementById("OS_QuestionTypeString").value = "Microsoft Windows Vista Ultimate on Intel Mac";
		} 								
	else if (parseInt(which.OS_QuestionType.value) == 16)
		{
			document.getElementById("OS_QuestionTypeString").value = "Microsoft Windows Vista Enterprise on Intel Mac";
		} 								
	else if (parseInt(which.OS_QuestionType.value) == 17)
		{
			document.getElementById("OS_QuestionTypeString").value = "Microsoft Windows Vista Business on Intel Mac";
		} 		
	else if (parseInt(which.OS_QuestionType.value) == 18)
		{
			document.getElementById("OS_QuestionTypeString").value = "Microsoft Windows Vista Home Premium on Intel Mac";
		} 		
	else if (parseInt(which.OS_QuestionType.value) == 19)
		{
			document.getElementById("OS_QuestionTypeString").value = "Microsoft Windows Vista Home Basic on Intel Mac";
		} 		

	if (parseInt(which.Knowledge_QuestionType.value) == 0)
		{
			document.getElementById("Knowledge_QuestionType_Label").innerHTML = "<span class=\"red\" >*Technical Knowledge</span>";
			permit = false;
		} 
	else
		{
			document.getElementById("Knowledge_QuestionType_Label").innerHTML = "*Technical Knowledge";
		} 		
		
	if (parseInt(which.Knowledge_QuestionType.value) == 1)
		{
			document.getElementById("Knowledge_QuestionTypeString").value = "Expert";
					
		} 
	else if (parseInt(which.Knowledge_QuestionType.value) == 2)
		{
			document.getElementById("Knowledge_QuestionTypeString").value = "Computer Literate";
								
		} 
	else if (parseInt(which.Knowledge_QuestionType.value) == 3)
		{
			document.getElementById("Knowledge_QuestionTypeString").value = "I know a little bit about computers";			
		} 
	else if (parseInt(which.Knowledge_QuestionType.value) == 4)
		{
			document.getElementById("Knowledge_QuestionTypeString").value = "Beginner";
		} 


	if (parseInt(which.Tech_QuestionType.value) == 0)
		{
			document.getElementById("Tech_QuestionType_Label").innerHTML = "<span class=\"red\" >*Question</span>";
			permit = false;
		} 
	else
		{
			document.getElementById("Tech_QuestionType_Label").innerHTML = "*Question";
		} 

	if (parseInt(which.Tech_QuestionType.value) == 1)
		{
			document.getElementById("Tech_QuestionTypeString").value = "Renewals";
			
			if (parseInt(which.OS_QuestionType.value) == 11)
				{
					document.getElementById("PreResponse1").value = "<p>Customers that renew their GamBlock&reg; license are eligible for a two month free extension to their next license period, irrespective of their previous license type. For example: pay for twelve months protection and receive 14 months. To qualify, all you need is to provide your previous valid Transaction ID to us after registration.<p><p>Please go to <a href=\"http://www.gamblock.com\">www.gamblock.com</a>, select \"Download\" on the left menu and follow the prompts. Pricing and license periods are displayed on the page. GamBlock&reg; licenses are per computer. <u>Discounts apply for multiple licenses</u> at the time of purchase. If you are outside the USA, Australia or do not use Euro, the amount is displayed in US dollars, Euro or AUD and charged in your own currency. The current exchange rate can be viewed using the <a href=\"http://www.xe.com/ucc\">Universal Currency Converter</a>.</p>";
					document.getElementById("PreResponse2").value = "<p>All versions of GamBlock&reg; block all forms of online gambling. Please go to <a href=\"http://www.gamblock.com\">www.gamblock.com</a> and read our Testimonials.</p><p>GamBlock&reg; is continually tested by independent Microsoft Certified Professionals and CompTIA A+ Certified Computer Technicians (Wintel Hardware and Microsoft Windows operating systems).</p>";
					document.getElementById("PreResponse3").value = "<p>GamBlock&reg; uses sophisticated analyses that block new gambling sites, unlike other programs that require constant updating of website lists, thus eliminating a potentially vulnerable time for users.</p>";
					document.getElementById("PreResponse4").value = "<p>Please do not hesitate to contact us if you have any questions about versions or any other query regarding GamBlock&reg;.</p>";										
				}
			else
				{
					document.getElementById("PreResponse1").value = "<p>Customers that renew their GamBlock&reg; license are eligible for a two month free extension to their next license period, irrespective of their previous license type. For example: pay for twelve months protection and receive 14 months. To qualify, all you need is to provide your previous valid Transaction ID to us after registration.<p><p>Please go to <a href=\"http://www.gamblock.com\">www.gamblock.com</a>, select \"Download\" on the left menu and follow the prompts. Pricing and license periods are displayed on the page. GamBlock&reg; licenses are per computer. <u>Discounts apply for multiple licenses</u> at the time of purchase. If you are outside the USA, Australia or do not use Euro, the amount is displayed in US dollars, Euro or AUD and charged in your own currency. The current exchange rate can be viewed using the <a href=\"http://www.xe.com/ucc\">Universal Currency Converter</a>.</p>";
					document.getElementById("PreResponse2").value = "<p>All versions of GamBlock&reg; block all forms of online gambling. Please go to <a href=\"http://www.gamblock.com\">www.gamblock.com</a> and read our Testimonials.</p><p>GamBlock&reg; Platinum entitles you to a higher level of customer support, the ability to block Stock Trading and/or Sports Scores, alternative or no messages when gambling activity is detected, alternative renewal messages, variable countdown times, changeable passwords, manual updates, keep count of gambling activity, three or two year licenses, site submissions and can be controlled by the person who installs GamBlock&reg; Platinum via GamBlock&reg; Manager.</p>";
					document.getElementById("PreResponse3").value = "<p>GamBlock&reg; Platinum allows the person who installs GamBlock&reg; Platinum to conduct research using the GamBlock&reg; Manager. GamBlock&reg; Platinum resumes normal operation after the person who installs GamBlock&reg; Platinum has completed their work.</p><p>GamBlock&reg; is continually tested by independent Microsoft Certified Professionals and CompTIA A+ Certified Computer Technicians (Wintel Hardware and Microsoft Windows operating systems).</p>";
					document.getElementById("PreResponse4").value = "<p>GamBlock&reg; uses sophisticated analyses that block new gambling sites, unlike other programs that require constant updating of website lists, thus eliminating a potentially vulnerable time for users.</p><p>Please do not hesitate to contact us if you have any questions about versions or any other query regarding GamBlock&reg;.</p>";														
				}				
		} 
	else if (parseInt(which.Tech_QuestionType.value) == 2)
		{
			document.getElementById("Tech_QuestionTypeString").value = "Registration";
			
			if (parseInt(which.OS_QuestionType.value) == 11)
				{
					document.getElementById("PreResponse1").value = "<p>Did you follow the <a href=\"http://www.gamblock.com/faq/mobileinstall.php\">mobile installation instructions</a> exactly?";																							
				}
			else
				{
					document.getElementById("PreResponse1").value = "<p>Please click the link below on the computer(s) you wish to use.<br>";
					document.getElementById("PreResponse2").value = "<a href=\"http://www.gamblock.com/update/v7/Update.exe\">http://www.gamblock.com/update/v7/Update.exe</a></p>";
					document.getElementById("PreResponse3").value = "<p>If the link is broken or the information that activates the link has been stripped out, copy it to the Address Box of your browser and press \"Enter\" on your keyboard. If the Address Box is not visible: open Microsoft Internet Explorer and right-click on the Menu Bar (which includes \"Help\") and select \"Address Bar\".</p>";
					document.getElementById("PreResponse3").value = "<p>Make sure the internet is connected and permit GamBlock&reg; Update through the firewall. This will enable us to send a link to the registered version of GamBlock&reg;.</p>";									
				}									
		} 
	else if (parseInt(which.Tech_QuestionType.value) == 3)
		{
			document.getElementById("Tech_QuestionTypeString").value = "Download/Installation";
			
			if (parseInt(which.OS_QuestionType.value) == 11)
				{
					document.getElementById("PreResponse1").value = "<p>Did you follow the <a href=\"http://www.gamblock.com/faq/mobileinstall.php\">mobile installation instructions</a> exactly?</p>";																							
				}
			else
				{
					document.getElementById("PreResponse1").value = "<p>Did you follow the \"Installation\" instructions exactly on the left menu at <a href=\"http://www.gamblock.com\">www.gamblock.com</a>?</p><p>Did you click on the download link at the end of the WorldPay payment process and open the file? If not, click the link below on the computer(s) you wish to use.<br>";															
					document.getElementById("PreResponse2").value = "<a href=\"http://www.gamblock.com/update/v7/Update.exe\">http://www.gamblock.com/update/v7/Update.exe</a><br>Make sure that the hyperlink has not wrapped over more then one line or it might not work properly. If the link is not active, copy it to the address box of your browser and click \"Enter\".</p>";
					document.getElementById("PreResponse3").value = "<p>Make sure the internet is connected and permit GamBlock&reg; Update through the firewall. This will enable us to send a link to the registered version of GamBlock&reg;.</p>";
					document.getElementById("PreResponse3").value = "<p>Did you click \"OK\" on the GamBlock&reg; window in the top left of your screen as opposed to manually rebooting during installation?</p>";
				}			
									
		} 
	else if (parseInt(which.Tech_QuestionType.value) == 4)
		{
			document.getElementById("Tech_QuestionTypeString").value = "Keeping Updated/GamBlock&reg; Refresh";
			
			if (parseInt(which.OS_QuestionType.value) == 11)
				{
					document.getElementById("PreResponse1").value = "<p>It is important to keep GamBlock&reg; updated. For example, when the latest versions of other software are released, we update GamBlock&reg; accordingly.</p>";															
					document.getElementById("PreResponse2").value = "<p>GamBlock&reg; is dedicated to answering your questions and providing technical support. In order to meet that goal, our staff may require more information regarding the specific technical issue than initially provided. If you believe this is the case, please provide a detailed explanation so that we can help you with the technical support issue.</p>";								

				}
			else
				{
					document.getElementById("PreResponse1").value = "<p>GamBlock&reg; Updates automatically on Microsoft Windows Vista after GamBlock&reg; is registered. Non-Vista users should permit GamBlock&reg; Refresh through the firewall, after which, clicking on the link above is not required in order to update.</p>";															
					document.getElementById("PreResponse2").value = "<p>It is important to keep GamBlock&reg; updated. For example, when the latest versions of other software are released, we update GamBlock&reg; accordingly. If GamBlock&reg; Refresh is permitted through a computer's firewall, GamBlock&reg; will update automatically.</p>";
					document.getElementById("PreResponse3").value = "<p>GamBlock&reg; is dedicated to answering your questions and providing technical support. In order to meet that goal, our staff may require more information regarding the specific technical issue than initially provided. If you believe this is the case, please provide a detailed explanation and screen shots if applicable (Alt + Print Screen) so that we can help you with the technical support issue.</p>";
				}			
			
		} 
	else if (parseInt(which.Tech_QuestionType.value) == 5)
		{
			document.getElementById("Tech_QuestionTypeString").value = "Purchased for a Friend";
			
			if (parseInt(which.OS_QuestionType.value) == 11)
				{
					document.getElementById("PreResponse1").value = "<p>Please forward the model number of the mobile phone or device that your friend is using.</p>";																							

				}
			else
				{
					document.getElementById("PreResponse1").value = "<p>If you do not wish to install GamBlock&reg; on your computer, do not click the link below on your computer. GamBlock&reg; is managed by the <a href=\"http://www.piratelock.com\">PirateLock</a>&#8482; license management system. If registration is completed on your computer, the system will see the registration submission on your friend's computer as attempted piracy.</p><p>Ask your friend to click the link below on the computer(s) they wish to use.<br>";															
					document.getElementById("PreResponse2").value = "<a href=\"http://www.gamblock.com/update/v7/Update.exe\">http://www.gamblock.com/update/v7/Update.exe</a></p><p>If the link is broken or the information that activates the link has been stripped out, copy it to the Address Box of your browser and press \"Enter\" on your keyboard. If the Address Box is not visible: open Microsoft Internet Explorer and right-click on the Menu Bar (which includes \"Help\") and select \"Address Bar\".</p>";
					document.getElementById("PreResponse3").value = "<p>Please inform us if your friend or family member uses a mobile device and we will guide them through the installation process.</p>";
					document.getElementById("PreResponse3").value = "<p>Make sure the internet is connected and permit GamBlock&reg; Update through the firewall. This will enable us to send a link to the registered version of GamBlock&reg;.</p>";
				}			
					
		} 
	else if (parseInt(which.Tech_QuestionType.value) == 6)
		{
			document.getElementById("Tech_QuestionTypeString").value = "Credit Card Protection/Spyware";
					
			if (parseInt(which.OS_QuestionType.value) == 11)
				{
					document.getElementById("PreResponse1").value = "<p><a href=\"http://www.ftc.gov/bcp/edu/microsites/idtheft/video/avoid-identity-theft-video.html\" target=\"_blank\">This video</a> refers to real world identity theft. Please let us know if you have any questions in regard to mobile devices.</p>";																							

				}
			else
				{
					document.getElementById("PreResponse1").value = "<p><a href=\"http://www.ftc.gov/bcp/edu/microsites/idtheft/video/avoid-identity-theft-video.html\" target=\"_blank\">This video</a> refers to real world identity theft. Please let us know if you have any questions in regard to mobile devices.</p>";															
				}			
					
		} 
	else if (parseInt(which.Tech_QuestionType.value) == 7)
		{
			document.getElementById("Tech_QuestionTypeString").value = "Licence Periods/Expiry";
			
			if (parseInt(which.OS_QuestionType.value) == 11)
				{
					document.getElementById("PreResponse1").value = "<p>It is important to keep GamBlock&reg; updated. For example, when the latest versions of other software are released, we update GamBlock&reg; accordingly.</p>";															
					document.getElementById("PreResponse2").value = "<p>GamBlock&reg; is dedicated to answering your questions and providing technical support. In order to meet that goal, our staff may require more information regarding the specific technical issue than initially provided. If you believe this is the case, please provide a detailed explanation so that we can help you with the technical support issue.</p>";
				}
			else
				{
					document.getElementById("PreResponse1").value = "<p>GamBlock&reg; Refresh must be permitted through a firewall in order for GamBlock&reg; to update during a licence period or for a licence to expire automatically.</p>";															
					document.getElementById("PreResponse2").value = "";
					document.getElementById("PreResponse3").value = "";
					document.getElementById("PreResponse3").value = "";
				}			
			
		} 
	else if (parseInt(which.Tech_QuestionType.value) == 8)
		{
			document.getElementById("Tech_QuestionTypeString").value = "Stopped blocking as I did not register";
			
			if (parseInt(which.OS_QuestionType.value) == 11)
				{
					document.getElementById("PreResponse1").value = "<p>GamBlock&reg; must be registered in order to continue blocking.</p>";															
					document.getElementById("PreResponse2").value = "<p>Select \"Register\" on the Manager menu. On most mobile devices Manager will be on the bottom left of your screen.</p>";
					document.getElementById("PreResponse3").value = "<p>This will enable us to send you a link to the registered version of GamBlock&reg;.</p>";
					document.getElementById("PreResponse3").value = "";								

				}
			else
				{
					document.getElementById("PreResponse1").value = "<p>GamBlock&reg; must be registered in order to continue blocking.</p>";															
					document.getElementById("PreResponse2").value = "<p>Click the link below on the computer(s) you wish to use.<br><a href=\"http://www.gamblock.com/update/v7/Update.exe\">http://www.gamblock.com/update/v7/Update.exe</a><br>";
					document.getElementById("PreResponse3").value = "If the link does not start a file download, please copy the link into your \"Address Bar\" and click \"Enter\". Please make sure you are connected to the internet and permit GamBlock&reg; Update through your firewall.</p>";
					document.getElementById("PreResponse3").value = "<p>This will enable us to send you a link to the registered version of GamBlock&reg;.</p>";
				}
		} 
	else if (parseInt(which.Tech_QuestionType.value) == 9)
		{
			document.getElementById("Tech_QuestionTypeString").value = "Not receiving emails";
			
			document.getElementById("PreResponse1").value = "<p>Check your spam filter settings. We use a specialized email system that ensures we receive all emails. We answer all correspondence that we receive which include a valid email address, do not request the removal of GamBlock&reg; during a license period, do not contain offensive language and contain legal content. Please provide a <a href=\"http://www.gamblock.com/faq/_seceml.html\">secondary email address</a> in case your ISP is blocking emails regarding gambling. If you are using Microsoft Outlook for example, please check that our emails are not being seen as gambling spam in the Junk E-mail box.</p>";
			
		} 
	else if (parseInt(which.Tech_QuestionType.value) == 10)
		{
			document.getElementById("Tech_QuestionTypeString").value = "Other";
		} 						
		
	if (trim(which.Message.value) == "")
		{
			document.getElementById("Message_Label").innerHTML = "<span class=\"red\" >*Message</span>";
			permit = false;
		} 
	else	
		{
			document.getElementById("Message_Label").innerHTML = "*Message";
		} 																									 
		
   return permit;
     
}

function ClearValues()
{

	document.getElementById("TransactionID_Label").innerHTML = "*Transaction ID";
	document.getElementById("TransactionID").value = "";
	document.getElementById("Email_Address_Label").innerHTML = "*Email";
	document.getElementById("Email_Address").value = "";	
	document.getElementById("SecondaryEmail_Address_Label").innerHTML = "*Secondary Email";
	document.getElementById("SecondaryEmail_Address").value = "";
	document.getElementById("ContactName_Label").innerHTML = "*Contact Name";
	document.getElementById("ContactName").value = "";

	document.getElementById("CounselorEmail_Label").innerHTML = "Counselor Email";
	document.getElementById("CounselorEmail").value = "";
	
	document.getElementById("SponsorEmail_Label").innerHTML = "Sponsor Email";
	document.getElementById("SponsorEmail").value = "";
	
	document.getElementById("OS_QuestionType").value = 0;	
	document.getElementById("OS_QuestionType_Label").innerHTML = "*Operating System";
	document.getElementById("OS_QuestionTypeString").value = "";
	
	document.getElementById("Knowledge_QuestionType").value = 0;	
	document.getElementById("Knowledge_QuestionType_Label").innerHTML = "*Technical Knowledge";
	document.getElementById("Knowledge_QuestionTypeString").value = "";
	
	document.getElementById("Tech_QuestionType").value = 0;	
	document.getElementById("Tech_QuestionType_Label").innerHTML = "*Technical Knowledge";
	document.getElementById("Tech_QuestionTypeString").value = "";	
		
	document.getElementById("PreResponse1").value = "";
	document.getElementById("PreResponse2").value = "";
	document.getElementById("PreResponse3").value = "";
	document.getElementById("PreResponse4").value = "";
	document.getElementById("Message_Label").innerHTML = "*Message";
	document.getElementById("Message").value = "";
}
