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 (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.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.QuestionType.value) == 0)
		{
			document.getElementById("QuestionType_Label").innerHTML = "<span class=\"red\" >*Question Type</span>";
			permit = false;
		} 
	else
		{
			document.getElementById("QuestionType_Label").innerHTML = "*Question Type";
		} 


	if (parseInt(which.QuestionType.value) == 1)
		{
			document.getElementById("QuestionTypeString").value = "How much does GamBlock&reg; cost?";
			
			document.getElementById("PreResponse1").value = "<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.QuestionType.value) == 2)
		{
			document.getElementById("QuestionTypeString").value = "What editions of GamBlock&reg; are available?";
			
			document.getElementById("PreResponse1").value = "<p>There are three editions of GamBlock&reg;:</p><p>GamBlock&reg; Corporate (Multiple Licence) for large organizations and is installed by the System Administrator.</p><p>GamBlock&reg; Corporate Small Business for organizations that do not use a System Administrator.</p><p>GamBlock&reg; Personal is for people who use their computers for personal use only.</p>";
			document.getElementById("PreResponse2").value = "<p>Within each of these categories there are three versions available:</p><p>GamBlock&reg; Platinum, GamBlock&reg; Gold and GamBlock&reg; Silver.</p>";
			document.getElementById("PreResponse3").value = "<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("PreResponse4").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><a href=\"http://www.gamblock.com/versions.html\">More information</a> is available on our website.<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.QuestionType.value) == 3)
		{
			document.getElementById("QuestionTypeString").value = "How do I purchase for a friend?";
			
			document.getElementById("PreResponse1").value = "<p>If you would like to purchase GamBlock&reg; for remote computers, please purchase GamBlock&reg; without downloading GamBlock&reg;, send us an email containing your transaction ID and a request to install GamBlock&reg; remotely; after which, we will send you a link that can be used to activate GamBlock&reg; remotely. Please note: This link will need to be activated on the remote computers. These are the computers that will have Gamblock&reg; installed on them. You might like to email the link to the remote computers. Please read &quot;<a href=\"http://www.gamblock.com/questions/miscellaneous/family-member-or-friend.html\">Can I buy GamBlock&reg; for a family member or friend?</a>&quot; on our Questions page.</p>";
			document.getElementById("PreResponse2").value = "<p>GamBlock&reg; Platinum Remote Install customers can download GamBlock&reg; R emote Install Reminder to display renewal messages and renewal reminders can be sent by email.</p><p>All versions of GamBlock&reg; block all forms of online gambling.</p> <p>GamBlock&reg; is continually tested by independent Microsoft Certified Professionals.</p><p>Please go to gamblock.com and read our Testimonials.</p>";
			document.getElementById("PreResponse3").value = "<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 licences, site submissions and can be controlled by the person who installs GamBlock&reg; Platinum via GamBlock&reg; Manager.</p>";
			document.getElementById("PreResponse4").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; 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.QuestionType.value) == 4)
		{
			document.getElementById("QuestionTypeString").value = "When does GamBlock&reg; expire?";
			
			document.getElementById("PreResponse1").value = "<p>GamBlock&reg; expires automatically after a licence period has ended, provided GamBlock&reg; is registered and <a href=\"http://www.gamblock.com/questions/updating-gamblock/licence-has-expired.html\">GamBlock&reg; Refresh</a> is permitted through the firewall.</p>";			

		} 
	else if (parseInt(which.QuestionType.value) == 5)
		{
			document.getElementById("QuestionTypeString").value = "Can you help protect my credit card details?";
			
			document.getElementById("PreResponse1").value = "<p>It is vitally important that the effects of irresponsible online gambling vendors are eradicated from your computer in order to protect your money and personal information from being stolen. Do not use your credit card until you have used <a href=\"http://www.nirsoft.net/utils/pspv.zip\">Protected Storage PassView</a>. <a href=\"http://www.javacoolsoftware.net.nyud.net:8090/downloads/spywareguardsetup.exe\">SpywareGuard</a> and <a href=\"http://www.lavasoftusa.com\">Ad-Aware</a> (free for home use) will help repair your PC as well as protect your money and personal information from irresponsible gambling software hidden on your computer.</p>";			
		} 
	else if (parseInt(which.QuestionType.value) == 6)
		{
			document.getElementById("QuestionTypeString").value = "Why are my emails not being answered?";
			
			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/questions/miscellaneous/secondary-email-address.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.QuestionType.value) == 7)
		{
			document.getElementById("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("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("Knowledge_QuestionType").value = 0;	
	document.getElementById("Knowledge_QuestionType_Label").innerHTML = "*Technical Knowledge";
	document.getElementById("Knowledge_QuestionTypeString").value = "";

	document.getElementById("QuestionType").value = 0;	
	document.getElementById("QuestionType_Label").innerHTML = "*Question Type";
	document.getElementById("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 = "";
}