function k$(str) {
	if(document.getElementById(str)) {
		return document.getElementById(str);
	}
	else return undefined;
}
function dteSearchFocus() {
	if(k$('dteSearchTxt').value == 'search dog trials') {
		k$('dteSearchTxt').value = '';
	}
}
function dteSearchBlur() {
	if(k$('dteSearchTxt').value == '') {
		k$('dteSearchTxt').value = 'search dog trials';
	}
}
function IsNumeric(sText)
{
   var ValidChars = "0123456789.";
   var IsNumber=true;
   var Char;
   if ((sText.length==0) ||
	   (sText==null))
   {
   	  IsNumber=false;
   }
   else
   {
   		for (i = 0; i < sText.length && IsNumber == true; i++)
   		   {
   		   Char = sText.charAt(i);
   		   if (ValidChars.indexOf(Char) == -1)
   		      {
   		      IsNumber = false;
   		      }
   		   }
   		return IsNumber;
   }
   return IsNumber;
}

// moved from selTrial.php
function dte_waiverset() {
	if (document.trialinfo.getWaiver.checked==true)
	{
	    alert('Thank you. Your agreement to the waivers and releases has been noted. Enjoy the event.');
	}else
	{
	    alert('Please agree to the waivers and releases to enter this event.');
	}
	
}

// jmb
function IsPswd(sText) 
{
  // quotes, ampersands, commas, and < > etc. are not allowed. Tildi is ok.
  // ValidChars is what is allowed.
   var ValidChars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz~!@#$%_";
   var IsPswd=true;
   var Char;
   if ((sText.length<4) ||
	   (sText==null))
   {
   	  IsPswd=false;
   }
   else
   {
   		for (i = 0; i < sText.length && IsPswd == true; i++)
   		   {
   		   Char = sText.charAt(i);
   		   if (ValidChars.indexOf(Char) == -1)
   		      {
   		      IsPswd = false;
   		      }
   		   }
   		return IsPswd;
   }
   return IsPswd;
}
// jmb
function IsText(sText) 
{
  // quotes, ampersands, commas, and < > etc. are not allowed. Tildi and backtic(by tildi on keyboard) are ok.
  // ValidChars is what is allowed.
   var ValidChars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz@#$_~`";
   var IsText=true;
   var Char;
   if ((sText.length<1) ||
	   (sText==null))
   {
   	  IsText=false;
   }
   else
   {
   		for (i = 0; i < sText.length && IsText == true; i++)
   		   {
   		   Char = sText.charAt(i);
   		   if (ValidChars.indexOf(Char) == -1)
   		      {
   		      IsText = false;
   		      }
   		   }
   		return IsText;
   }
   return IsText;
}

