// JavaScript Document
/**
This is a JavaScript library 

*/
var SIDString = '';
function getRandomLetter() {
	return String.fromCharCode(getRandom(65, 90));
}

function getRandom(lowerBound, upperBound) {
	return Math.floor((upperBound - lowerBound + 1) * Math.random() + lowerBound);
}

function SetSID()
	{
	if (SIDString.length > 0)
	{
	return SIDString;
	}

sidc = 0;
	while (sidc < 32)
	{
		SIDString = SIDString + getRandomLetter();
		sidc++;
	}
	return SIDString;
}



/**
check the fields

*/

function CheckMultiple17(frm, name) {
				for (var i=0; i < frm.length; i++)
				{
					fldObj = frm.elements[i];
					fldId = fldObj.id;
					if (fldId) {
						var fieldnamecheck=fldObj.id.indexOf(name);
						if (fieldnamecheck != -1) {
							if (fldObj.checked) {
								return true;
							}
						}
					}
				}
				return false;
			}
			
		
		function CheckForm17(f) {
			var fname = "CustomFields_1_17";
			var fld = document.getElementById(fname);
			if (fld.value == "") {
				alert("Please enter your Name");
				fld.focus();
				return false;
			}

			if (f.email.value == "") {
				alert("Please enter your EMail address.");
				f.email.focus();
				return false;
			}
		
			if (f.format.selectedIndex == -1) {
				alert("Please choose a format to receive your email from us in");
				f.format.focus();
				return false;
			}
			if (f.captcha.value == "") {
				alert("Please enter the security code shown");
				f.captcha.focus();
				return false;
			}

		
			var fldcheck = CheckMultiple17(f, "CustomFields[30_17]");
			if (!fldcheck) {
				alert("Please select a Software Testing Program.");
				return false;
			}
		
			var fname = "CustomFields_22_17";
			var fld = document.getElementById(fname);
			if (fld.value == "") {
				alert("Please let us know how much experience you have with our software.");
				fld.focus();
				return false;
			}
		
			var fname = "CustomFields_23_17";
			var fld = document.getElementById(fname);
			if (fld.value == "") {
				alert("Please let us know what type of productions you typically use our product(s)");
				fld.focus();
				return false;
			}
		
			var fldcheck = CheckMultiple17(f, "CustomFields[29_17]");
			if (!fldcheck) {
				alert("Please let us know if you'll have access to testing our product (not in show environments).");
				return false;
			}
		
			var fname = "CustomFields_25_17";
			var fld = document.getElementById(fname);
		
				if (fld.value == "") {
					alert("Please let us know how many hours a week can you devote to testing.");
					fld.focus();
					return false;
				}

			var fname = "CustomFields_27_17";
			var fld = document.getElementById(fname);
			if (fld.value == "") {
				alert("Please let us know how many hours a week can you devote to testing.");
				fld.focus();
				return false;
			}
		
				return true;
			}

/*
			CheckNum = parseInt(fld.value);
			if(fld.value != "" && isNaN(CheckNum)) {
				alert("Please enter a numeric value indicating how many hours a week can you devote to testing.");
				fld.select();
				fld.focus();
				return false;
			}
		
				return true;
			}
			
*/

