<!--

//
// start [ random photo variables ]
//

var airickphoto = new Array();
airickphoto[0] = "airick_seated.jpg";
airickphoto[1] = "airick_seated.jpg";
airickphoto[2] = "airick_seated.jpg";
airickphoto[3] = "airick_seated.jpg";
airickphoto[4] = "airick_benched.jpg";
airickphoto[5] = "airick_skyline.jpg";
airickphoto[6] = "airick_ponders.jpg";
airickphoto[7] = "airick_ponders.jpg";
airickphoto[8] = "airick_speaking.jpg";
airickphoto[9] = "airick_speaks.jpg";
airickphoto[10] = "airick_ponders.jpg";
airickphoto[11] = "airick_speaking.jpg";
airickphoto[12] = "airick_speaking.jpg";
airickphoto[13] = "airick_speaks.jpg";
airickphoto[14] = "airick_benched.jpg";
airickphoto[15] = "airick_benched.jpg";
airickphoto[16] = "airick_benched.jpg";
airickphoto[17] = "airick_classroom.jpg";
airickphoto[18] = "airick_freddie.jpg";
airickphoto[19] = "airick_jazz.jpg";
airickphoto[20] = "airick_melissa.jpg";
airickphoto[21] = "airick_sadie.jpg";
airickphoto[22] = "airick_titus.jpg";
airickphoto[23] = "airick_foldedarms.jpg";
airickphoto[24] = "airick_gents.jpg";
airickphoto[25] = "airick_headlock.jpg";

var x = Math.round(25*Math.random());

//
// end [ random photo variables ] 
//



//
// start [ random text variables ]
//

var speakunity = new Array();
speakunity[0] = "the euphoric journey to educational achievement will be one of unity";
speakunity[1] = "the only way forward is together";
speakunity[2] = "when adults fight, children lose";
speakunity[3] = "spread unity. host a <a href=/host.php style='color:#003366;'>home conversation</a>!";
speakunity[4] = "united, we can renew what one person cannot";
speakunity[5] = "unity will lead us to educational achievement";
speakunity[6] = "is <i>disunity</i> good for the children?";
speakunity[7] = "the euphoric journey to educational achievement begins with unity";
speakunity[8] = "the euphoric journey to educational achievement begins with unity";
speakunity[9] = "the euphoric journey to educational achievement will be one of unity";
speakunity[10] = "the euphoric journey to educational achievement will be one of unity";
speakunity[11] = "spread unity. host a <a href=/host.php style='color:#003366;'>home conversation</a>!";
speakunity[12] = "we must be driven by results: keep what is working, replace what is not";
speakunity[13] = "what would be possible if we stood united behind our schools?";
speakunity[14] = "what would be possible if we stood united behind our schools?";
speakunity[15] = "what would be possible if we stood united behind our schools?";
speakunity[16] = "what would be possible if we stood united behind our schools?";
speakunity[17] = "are we being <i>the village</i>?";
speakunity[18] = "we believe in what is possible through unity";
speakunity[19] = "how many children have we left behind?";
speakunity[20] = "children are not only our future, they are our now";
speakunity[21] = "spread unity. host a <a href=/host.php style='color:#003366;'>home conversation</a>!";
speakunity[22] = "unity will lead us to educational achievement";
speakunity[23] = "unity will lead us to educational achievement";
speakunity[24] = "unity will lead us to educational achievement";
speakunity[25] = "now, more than ever, kansas citians desire unity";
speakunity[26] = "united, we can renew what one person cannot";
speakunity[27] = "united, we can renew what one person cannot";
speakunity[28] = "we believe in what is possible through unity";
speakunity[29] = "we believe in what is possible through unity";
speakunity[30] = "we believe in what is possible through unity";
speakunity[31] = "we believe in what is possible through unity";
speakunity[32] = "we believe in what is possible through unity";
speakunity[33] = "our hope is grounded in what is possible through unity";
speakunity[34] = "our hope is grounded in what is possible through unity";
speakunity[35] = "our hope is grounded in what is possible through unity";
speakunity[36] = "our hope is grounded in what is possible through unity";
speakunity[37] = "we believe in what is possible through unity";

//speakunity[] = "";
var i = Math.round(37*Math.random());

//
// end [ random text variables ] 
//



function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_closeBrWindow(theURL,winName) 
		{window.close(theURL,winName);
}

// '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
// Preload Object


image1 = new Image();
image1.src = "/images/vote_over.jpg";

image2 = new Image();
image2.src = "/images/campaign_over.jpg";

image3 = new Image();
image3.src = "/images/candidate_over.jpg";

image4 = new Image();
image4.src = "/images/endorse_over.jpg";

image5 = new Image();
image5.src = "/images/unite_over.jpg";

image6 = new Image();
image6.src = "/images/contribute_over.jpg";

image7 = new Image();
image7.src = "/images/contact_over.jpg";



// '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
// Random Photo

imgswap = new Array('/images/sub_photo01.jpg','/images/sub_photo02.jpg','/images/sub_photo03.jpg','/images/sub_photo04.jpg','/images/sub_photo05.jpg','/images/sub_photo06.jpg','/images/sub_photo07.jpg','/images/sub_photo08.jpg','/images/sub_photo09.jpg'); 

rnd.today=new Date(); 
rnd.seed=rnd.today.getTime(); 

function rnd() { 
rnd.seed = (rnd.seed*9301+49297) % 233280; 
return rnd.seed/(233280.0); 
}; 

function rand(number) { 
return Math.ceil(rnd()*number); 
}; 






//	EEEEEEEEE	RRRRRRRRR	RRRRRRRRR	OOOOOOOOO	RRRRRRRRR
//	EEEEEEEEE	RRRRRRRRR	RRRRRRRRR	OOOOOOOOO       RRRRRRRRR
//	EEE		RRR   RRR       RRR   RRR	OOO   OOO       RRR   RRR
//	EEEEEEEEE	RRRRRRR         RRRRRRR  	OOO   OOO	RRRRRRR
//	EEEEEEEEE	RRRRRRR         RRRRRRR  	OOO   OOO       RRRRRRR
//	EEE		RRR  RRR        RRR  RRR 	OOO   OOO       RRR  RRR
//	EEEEEEEEE	RRR   RRR       RRR   RRR	OOOOOOOOO       RRR   RRR
//	EEEEEEEEE	RRR   RRR	RRR   RRR	OOOOOOOOO       RRR   RRR
//
//
//
//	CCCCCCCCC	HHH   HHH	EEEEEEEEE 	CCCCCCCCC	KKK   KKK
//	CCCCCCCCC	HHH   HHH       EEEEEEEEE       CCCCCCCCC	KKK   KKK
//	CCC		HHH   HHH       EEE		CCC		KKK  KKKK
//	CCC		HHHHHHHHH       EEEEEEEEE	CCC		KKKKKK
//	CCC		HHHHHHHHH       EEEEEEEEE	CCC		KKKKKK
//	CCC		HHH   HHH       EEE		CCC		KKK  KKKK
//	CCCCCCCCC	HHH   HHH       EEEEEEEEE       CCCCCCCCC	KKK   KKK
//	CCCCCCCCC	HHH   HHH       EEEEEEEEE       CCCCCCCCC	KKK   KKK


// checkForm() usage examples
//	form, email, required, numeric, phone, compare, alpha, minimum, maximum, prefix, showall
//	checkForm('form=FORMNAME','email=ELEMENTNAME','required=ELEMENTNAME','numeric=ELEMENTNAME','phone=ELEMENTNAME','compare=ELEMENTNAME1/ELEMENTNAME2','alpha=ELEMENTNAME','minimum=ELEMENTNAME1/MINIMUM_LENGTH','maximum=ELEMENTNAME1/MAXIMUM_LENGTH','prefix=ELEMENT_PREFIX','show=SINGLE|ALL|HIGHLIGHT');
//	checkForm('form=test','email=frmEmail1,frmEmail2','required=frmUserName,frmEmail1','numeric=frmZipCode','phone=frmHomePhone,frmWorkPhone','compare=frmPass1/frmPass2','alpha=frmCity','minimum=frmZipCode/5,frmHomePhone/7','maximum=frmZipCode/9,frmHomePhone/15');
//	<a href="javascript:checkForm('form=myform','required=frmName,frmEmail','numeric=frmZipCodeCode','show=all');">
//	<a href="javascript:checkForm('form=signup','email=frmEmail','required=frmCreditCard','compare=frmCreatePassword/frmConfirmPassword');">

function checkForm()
{
	// SECTION 1: PARSE ARGUMENTS, SET VARIABLES

	$form = 'none';
	$Email = new Array('none');
	$Required = new Array('none');
	$Numeric = new Array('none');
	$Phone = new Array('none');
	$Compare = new Array('none');
	$Alpha = new Array('none');
	$Minimum = new Array('none');
	$Maximum = new Array('none');
	$Credit = new Array('none');

	$ErrorMsg = new Array();
	$ErrorLoc = new Array();

	$errors = '';
	$show = 'single';
	$prefix = 'frm';
	$errorCount = 0;

	for ($x=0; $x < arguments.length; $x++)
	{
		$title = arguments[$x].split('=')[0];
		if ($title == 'form')
		{
			$form = arguments[$x].split('=')[1];
		}

		if ($title == 'prefix')
		{
			$prefix = arguments[$x].split('=')[1];
		}

		if ($title == 'show')
		{
			$show = arguments[$x].split('=')[1];
		}

		if ($title == 'required')
		{
			$Required = arguments[$x].split('=')[1].split(',');
		}

		if ($title == 'email')
		{
			$Email = arguments[$x].split('=')[1].split(',');
		}

		if ($title == 'numeric')
		{
			$Numeric = arguments[$x].split('=')[1].split(',');
		}

		if ($title == 'phone')
		{
			$Phone = arguments[$x].split('=')[1].split(',');
		}

		if ($title == 'compare')
		{
			$Compare = arguments[$x].split('=')[1].split(',');
		}

		if ($title == 'alpha')
		{
			$Alpha = arguments[$x].split('=')[1].split(',');
		}

		if ($title == 'minimum')
		{
			$Minimum = arguments[$x].split('=')[1].split(',');
		}

		if ($title == 'maximum')
		{
			$Maximum = arguments[$x].split('=')[1].split(',');
		}

		if ($title == 'credit')
		{
			$Credit = arguments[$x].split('=')[1].split(',');
		}
	}

	if ($form != 'none')
	{

		// SECTION 2: CHECK REQUIRED
		if ($Required[0] != "none")
		{
			$requiredLength = $Required.length;
			for ($x=0; $x < $requiredLength; $x++)
			{
				if (document.forms[$form].elements[$Required[$x]].value == "")
				{
					$ErrorMsg[$errorCount] = "A value must be entered for " + $Required[$x].replace($prefix,'') + ".\n";
					$ErrorLoc[$errorCount] = $Required[$x];
					$errorCount++;
				}
			}
		}


		// SECTION 3: VALIDATE EMAIL
		if ($Email[0] != "none")
		{
			$emailProblems = 0;
			$mailLength = $Email.length;
			for ($x=0; $x < $mailLength; $x++)
			{
				$temp = document.forms[$form].elements[$Email[$x]];
				$atSym = $temp.value.indexOf('@');
				$lastDot = $temp.value.lastIndexOf('.');
				$firstDot = $temp.value.indexOf('.');
				$lastAtSym = $temp.value.lastIndexOf('@');
				$mailSize = $temp.value.length - 1;
				$checkEmail = $temp.value
				$emailOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789-_.@";
				for ($i = 0;  $i < $checkEmail.length;  $i++)
				{
					$ch = $checkEmail.charAt($i);
					for ($j = 0;  $j < $emailOK.length+1;  $j++)
					{

						if ($ch == $emailOK.charAt($j))
						{
							break;
						}

						if ($j == $emailOK.length)
						{
							$emailProblems = 1;
			      				break;
						}
					}
				}
				if ($emailProblems != 0)
				{
					$ErrorMsg[$errorCount] = "Please enter only letters, numbers and '- _ . @' characters in " + $Email[$x].replace($prefix,'') + ".\n";
					$ErrorLoc[$errorCount] = $Email[$x];
					$errorCount++;
				}



				if ($atSym == -1)
				{
					$ErrorMsg[$errorCount] = $Email[$x].replace($prefix,'') + " needs to contain an '@' symbol.\n";
					$ErrorLoc[$errorCount] = $Email[$x];
					$errorCount++;
				}

				if ($lastDot == -1)
				{
					$ErrorMsg[$errorCount] = $Email[$x].replace($prefix,'') + " needs to contain a '.' symbol.\n";
					$ErrorLoc[$errorCount] = $Email[$x];
					$errorCount++;
				}

				if ($atSym > -1 && $lastDot > -1)
				{
					if ($atSym < 1)
					{
						$ErrorMsg[$errorCount] = $Email[$x].replace($prefix,'') + " cannot begin with '@'.\n";
						$ErrorLoc[$errorCount] = $Email[$x];
						$errorCount++;
					}

					if ($firstDot != $lastDot)
					{
						if ($lastDot <= $atSym+1)
						{
							$ErrorMsg[$errorCount] = "There must be at least one valid character between '@' and '.' in " + $Email[$x].replace($prefix,'') + "\n";
							$ErrorLoc[$errorCount] = $Email[$x];
							$errorCount++;
						}
					}

					if ($lastDot == $mailSize)
					{
						$ErrorMsg[$errorCount] = "There must be at least one valid character after '.' in " + $Email[$x].replace($prefix,'') + "\n";
						$ErrorLoc[$errorCount] = $Email[$x];
						$errorCount++;
					}

					if ($lastDot < $atSym)
					{
						$ErrorMsg[$errorCount] = "There needs to be a '.' after the '@' in " + $Email[$x].replace($prefix,'') + ".\n";
						$ErrorLoc[$errorCount] = $Email[$x];
						$errorCount++;
					}

					if ($atSym != $lastAtSym)
					{
						$ErrorMsg[$errorCount] = $Email[$x].replace($prefix,'') + " contains too many @ symbols.\n";
						$ErrorLoc[$errorCount] = $Email[$x];
						$errorCount++;
					}
				}
			}
		}

		// SECTION 4: VALIDATE NUMERIC
		if ($Numeric[0] != "none")
		{
			$numLength = $Numeric.length;
			$numericProblems = 0;
			for ($x=0; $x < $numLength; $x++)
			{
				$temp = document.forms[$form].elements[$Numeric[$x]];
				$checkNumeric = $temp.value;
				$numericOK = "0123456789";
				for ($i = 0;  $i < $checkNumeric.length;  $i++)
				{
					$ch = $checkNumeric.charAt($i);
					for ($j = 0;  $j < $numericOK.length+1;  $j++)
					{

						if ($ch == $numericOK.charAt($j))
						{
							break;
						}

						if ($j == $numericOK.length)
						{
							$numericProblems = 1;
			      				$problems = 1;
			      				break;
						}
					}
				}
				if ($numericProblems != 0)
				{
					$ErrorMsg[$errorCount] = "Please enter only numeric characters in " + $Numeric[$x].replace($prefix,'') + ".\n";
					$ErrorLoc[$errorCount] = $Numeric[$x];
					$errorCount++;
				}
			}
		}

		// SECTION 5: VALIDATE PHONE NUMBERS
		if ($Phone[0] != "none")
		{
			$phoneLength = $Phone.length;
			$phoneProblems = 0;
			for ($x=0; $x < $phoneLength; $x++)
			{
				$temp = document.forms[$form].elements[$Phone[$x]];
				$checkPhone = $temp.value;
				$phoneOK = "0123456789().- ";
				for ($i = 0;  $i < $checkPhone.length;  $i++)
				{
					$ch = $checkPhone.charAt($i);
					for ($j = 0;  $j < $phoneOK.length+1;  $j++)
					{

						if ($ch == $phoneOK.charAt($j))
						{
							break;
						}

						if ($j == $phoneOK.length)
						{
							$phoneProblems = 1;
			      				$problems = 1;
			      				break;
						}
					}
				}
				if ($phoneProblems != 0)
				{
					$ErrorMsg[$errorCount] = "Please enter only numbers and '. - ( )' characters in " + $Phone[$x].replace($prefix,'') + ".\n";
					$ErrorLoc[$errorCount] = $Phone[$x];
					$errorCount++;
				}
			}
		}

		// SECTION 6: VALIDATE ALPHA
		if ($Alpha[0] != "none")
		{
			$alphaLength = $Alpha.length;
			$alphaProblems = 0;
			for ($x=0; $x < $alphaLength; $x++)
			{
				$temp = document.forms[$form].elements[$Alpha[$x]];
				$checkAlpha = $temp.value;
				$alphaOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ";
				for ($i = 0;  $i < $checkAlpha.length;  $i++)
				{
					$ch = $checkAlpha.charAt($i);
					for ($j = 0;  $j < $alphaOK.length+1;  $j++)
					{

						if ($ch == $alphaOK.charAt($j))
						{
							break;
						}

						if ($j == $alphaOK.length)
						{
							$alphaProblems = 1;
			      				$problems = 1;
			      				break;
						}
					}
				}
				if ($alphaProblems != 0)
				{
					$ErrorMsg[$errorCount] = "Please enter only alpha characters in " + $Alpha[$x].replace($prefix,'') + ".\n";
					$ErrorLoc[$errorCount] = $Alpha[$x];
					$errorCount++;
				}
			}
		}

		// SECTION 7: COMPARISONS CHECK
		if ($Compare[0] != "none")
		{
			$compareLength = $Compare.length;
			for ($x=0; $x < $compareLength; $x++)
			{
				$temp0 = document.forms[$form].elements[$Compare[$x].split('/')[0]];
				$temp1 = document.forms[$form].elements[$Compare[$x].split('/')[1]];

				if ($temp0.value != $temp1.value)
				{
					$ErrorMsg[$errorCount] = $Compare[$x].split('/')[0].replace($prefix,'') + " is not the same as " + $Compare[$x].split('/')[1].replace($prefix,'') + ".\n";
					$ErrorLoc[$errorCount] = $Compare[$x].split('/')[1];
					$errorCount++;
				}
			}
		}

		// SECTION 8: MINIMUM CHARACTERS CHECK
		if ($Minimum[0] != "none")
		{
			$minimumLength = $Minimum.length;
			for ($x=0; $x < $minimumLength; $x++)
			{
				$temp0 = document.forms[$form].elements[$Minimum[$x].split('/')[0]];
				$temp1 = $Minimum[$x].split('/')[1];

				if ($temp0.value.length < $temp1)
				{
					$ErrorMsg[$errorCount] = $Minimum[$x].split('/')[0].replace($prefix,'') + " must have at least " + $Minimum[$x].split('/')[1] + " characters.\n";
					$ErrorLoc[$errorCount] = $Minimum[$x];
					$errorCount++;
				}
			}
		}

		// SECTION 9: MAXIMUM CHARACTERS CHECK
		if ($Maximum[0] != "none")
		{
			$maximumLength = $Maximum.length;
			for ($x=0; $x < $maximumLength; $x++)
			{
				$temp0 = document.forms[$form].elements[$Maximum[$x].split('/')[0]];
				$temp1 = $Maximum[$x].split('/')[1];

				if ($temp0.value.length > $temp1)
				{
					$ErrorMsg[$errorCount] = $Maximum[$x].split('/')[0].replace($prefix,'') + " must have fewer " + $Maximum[$x].split('/')[1] + " characters.\n";
					$ErrorLoc[$errorCount] = $Maximum[$x];
					$errorCount++;
				}
			}
		}

		// SECTION 10: CREDIT CARD NUMBER VALIDATION
		if ($Credit[0] != "none")
		{
			$shouldLength = 0;
			$cardName = "";

			$creditLength = $Credit.length;
			for ($x=0; $x < $creditLength; $x++)
			{
				$CCnumber = document.forms[$form].elements[$Credit[$x]].value;

				// 1) Get rid of spaces and non-numeric characters.
				$CCnumber = OnlyNumericSolution($CCnumber);

				// 2) Do the first four digits fit within proper ranges?
				//	 If so, who's the card issuer and how long should the number be?
				$numberLeft = $CCnumber.substr(0, 4);
				$numberLength = $CCnumber.length;

				if ($numberLeft >= 3000 && $numberLeft <= 3059)
				{
					$cardName = "Diners Club";
					$shouldLength = 14;
				}

				else if ($numberLeft >= 3600 && $numberLeft <= 3699)
				{
					$cardName = "Diners Club";
					$shouldLength = 14;
				}

				else if ($numberLeft >= 3800 && $numberLeft <= 3889)
				{
					$cardName = "Diners Club";
					$shouldLength = 14;

				}

				else if ($numberLeft >= 3400 && $numberLeft <= 3499)
				{
					$cardName = "American Express";
					$shouldLength = 15;
				}

				else if ($numberLeft >= 3700 && $numberLeft <= 3799)
				{
					$cardName = "American Express";
					$shouldLength = 15;
				}

				else if ($numberLeft >= 3528 && $numberLeft <= 3589)
				{
					$cardName = "JCB";
					$shouldLength = 16;
				}

				else if ($numberLeft >= 3890 && $numberLeft <= 3899)
				{
					$cardName = "Carte Blache";
					$shouldLength = 14;

				}

				else if ($numberLeft >= 4000 && $numberLeft <= 4999)
				{
					$cardName = "Visa";
					if ($numberLength > 14)
					{
						$shouldLength = 16;
					}
					else if ($numberLength < 14)
					{
						$shouldLength = 13;
					}
					else
					{
						$ErrorMsg[$errorCount] = "The Visa number entered, " + $CCnumber + ", is 14 digits long. Visa cards usually have 16 digits, though some have 13. Please check the number && try again.\n";
						$ErrorLoc[$errorCount] = $Credit[$x];
						$errorCount++;
					}
				}

				else if ($numberLeft >= 5100 && $numberLeft <= 5599)
				{
					$cardName = "MasterCard";
					$shouldLength = 16;

				}

				else if ($numberLeft == 5610)
				{
					$cardName = "Australian BankCard";
					$shouldLength = 16;

				}

				else if ($numberLeft == 6011)
				{
					$cardName = "Discover/Novus";
					$shouldLength = 16;
				}

				else
				{
					$ErrorMsg[$errorCount] = "The first four digits of the credit card number entered are " + $numberLeft + ". If that is correct, we do not accept that type of credit card. If it is wrong, please try again.\n";
					$ErrorLoc[$errorCount] = $Credit[$x];
					$errorCount++;
				}

				// 3) Is the number the right length?
				if ($numberLength != $shouldLength)
				{
					$missing = $numberLength - $shouldLength;
					if ($missing < 0)
					{
						$ErrorMsg[$errorCount] = "The " + $cardName + " number entered, " + $CCnumber + ", is missing " + Math.abs($missing) + " digit(s). Please check the number and try again.\n";
						$ErrorLoc[$errorCount] = $Credit[$x];
						$errorCount++;
					}
					else
					{
						$ErrorMsg[$errorCount] = "The " + $cardName + " number entered, " + $CCnumber + ", has " + Math.abs($missing) + " too many digit(s). Please check the number and try again.\n";
						$ErrorLoc[$errorCount] = $Credit[$x];
						$errorCount++;
					}
				}

				// 4) Does the number pass the Mod 10 Algorithm Checksum?
				if (Mod10Solution($CCnumber) == false)
				{
					$ErrorMsg[$errorCount] = "The " + $cardName + " number entered, " + $CCnumber + ", is invalid. Please check the number and try again.\n";
					$ErrorLoc[$errorCount] = $Credit[$x];
					$errorCount++;
				}
			}
		}

		// SECTION 11: WRAP THINGS UP

		if ($ErrorMsg.length == 0)
		{
			document.forms[$form].submit();
			return true;
		}
		else
		{
			if ($show == 'all')
			{
				for ($x=0;  $x < $ErrorMsg.length; $x++)
				{
					$errors += $x + ". " + $ErrorMsg[$x];
				}
				alert($errors);
			}
			else if ($show == 'single')
			{
				alert($ErrorMsg[0]);
				document.forms[$form].elements[$ErrorLoc[0]].focus();
			}
			else
			{
				alert($ErrorMsg[0]);
				document.forms[$form].elements[$ErrorLoc[0]].focus();
			}
		}
	} // end if ($form != 'none')
}

function OnlyNumericSolution($CCnumber)
{
	// Remove any non numeric characters.
	// Ensure number is no more than 19 characters long.
	return $CCnumber.replace("[^0-9]","").substr(0,19);
}

function Mod10Solution($CCnumber)
{
	$numberLength = $CCnumber.length;
	$checksum = 0;

	// Add even digits in even length strings
	// or odd digits in odd length strings.
	for ($location = 1 - ($numberLength % 2); $location < $numberLength; $location += 2)
	{
		$checksum += parseInt($CCnumber.substr($location,1));
	}

	// Analyze odd digits in even length strings
	// or even digits in odd length strings.
	for ($location = ($numberLength % 2); $location < $numberLength; $location += 2)
	{
		$digit = $CCnumber.substr($location,1) * 2;
		if ($digit < 10)
		{
			$checksum += parseInt($digit);
		}
		else
		{
			$checksum += parseInt($digit - 9);
		}
	}

	// Is the checksum divisible by ten?
	$result = $checksum % 10;

	if ($result == 0)
	{
		return true;
	}
	else
	{
		return false;
	}
}





-->