   var submitcount=0;
   function checkSubmit() {

      if (submitcount == 0)
      {
      submitcount++;
      document.Surv.submit();
      }
   }


function wordCounter(field, countfield, maxlimit) {
wordcounter=0;
for (x=0;x<field.value.length;x++) {
      if (field.value.charAt(x) == " " && field.value.charAt(x-1) != " ")  {wordcounter++}  // Counts the spaces while ignoring double spaces, usually one in between each word.
      if (wordcounter > 250) {field.value = field.value.substring(0, x);}
      else {countfield.value = maxlimit - wordcounter;}
      }
   }

function textCounter(field, countfield, maxlimit) {
  if (field.value.length > maxlimit)
      {field.value = field.value.substring(0, maxlimit);}
      else
      {countfield.value = maxlimit - field.value.length;}
  }
function setPointer(theRow, thePointerColor)
{
    if (thePointerColor == '' || typeof(theRow.style) == 'undefined') {
        return false;
    }
    if (typeof(document.getElementsByTagName) != 'undefined') {
        var theCells = theRow.getElementsByTagName('td');
    }
    else if (typeof(theRow.cells) != 'undefined') {
        var theCells = theRow.cells;
    }
    else {
        return false;
    }

    var rowCellsCnt  = theCells.length;
    for (var c = 0; c < rowCellsCnt; c++) {
        theCells[c].style.backgroundColor = thePointerColor;
    }

    return true;
}

function mark(face,field_color,text_color){

	if (document.documentElement){//if browser is IE5+ or NS6+
		face.style.backgroundColor=field_color;
		face.style.color=text_color;
	}

}

// Macromedia functions
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

// Pop-up Windows
function popWin( url, name, width, height, scroller )
{
	var outStr = 'height=' + height + ',width=' + width;
	outStr = outStr + ',menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=' + scroller + ',resizable=no';
	window.open(url, name, outStr);
}





function wordCounter(field, countfield, maxlimit) {
wordcounter=0;
for (x=0;x<field.value.length;x++) {
      if (field.value.charAt(x) == " " && field.value.charAt(x-1) != " ")  {wordcounter++}  // Counts the spaces while ignoring double spaces, usually one in between each word.
      if (wordcounter > 250) {field.value = field.value.substring(0, x);}
      else {countfield.value = maxlimit - wordcounter;}
      }
   }

function textCounter(field, countfield, maxlimit) {
  if (field.value.length > maxlimit)
      {field.value = field.value.substring(0, maxlimit);}
      else
      {countfield.value = maxlimit - field.value.length;}
  }


function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

function showHide(id, triggerFlag)
{
	var srcElement, targetElement;
	var srcElement    = document.getElementById(id);
	var targetElement = document.getElementById("T" + id);
	
	if (srcElement.value == triggerFlag)
		targetElement.style.display = "";
	else
		targetElement.style.display = "none";
}

<!-- Original:  Jerome Caron (jerome.caron@globetrotter.net) -->

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
team = new Array(
new Array(
new Array("Training 1-2", "Training 1-2"),
new Array("Training 3-4", "Training 3-4"),
new Array("First 1-2", "First 1-2"),
new Array("First 3-4", "First 3-4"),
new Array("Second Level", "Second Level"),
new Array("Third Level & Up", "Third Level & Up")
),
new Array(
new Array("Beginner Novice", "Beginner Novice"),
new Array("Novice", "Novice"),
new Array("Training", "Training"),
new Array("Preliminary", "Preliminary")
),
new Array(
new Array("--", "--")
),
new Array(
new Array("Beginning", "Beginning"),
new Array("Intermediate", "Intermediate"),
new Array("Advanced", "Advanced")
),
new Array(
new Array("2'6 & under", "2'6 & under"),
new Array("2'6 - 3'", "2'6 - 3'"),
new Array("3' - 3'3", "3' - 3'3"),
new Array("3'3 - 3'6", "3'3 - 3'6"),
new Array("3'6 & over", "3'6 & over")
),
new Array(
new Array("--", "--")
),
new Array(
new Array("--", "--")
),
new Array(
new Array("--", "--")
)
);

champ = new Array(
new Array(
new Array("Preliminary", "Preliminary"),
new Array("Training", "Training"),
new Array("Novice", "Novice")
),
new Array(
new Array("Training Level", "Training Level"),
new Array("First Level", "First Level"),
new Array("Second Level & Up", "Second Level & Up"),
new Array("Quadrille Division", "Quadrille Division")
),
new Array(
new Array("Juniors", "Juniors"),
new Array("Seniors", "Seniors"),
new Array("Advanced", "Advanced")
),
new Array(
new Array("Intermediate Pony", "Intermediate Pony"),
new Array("Intermediate Horse", "Intermediate Horse"),
new Array("Advanced", "Advanced")
),
new Array(
new Array("Junior D", "Junior D"),
new Array("Senior D", "Senior D"),
new Array("Junior C", "Junior C"),
new Array("Senior C/B", "Senior C/B"),
new Array("B/H/H-A/A", "B/H/H-A/A")
),
new Array(
new Array("Modified", "Modified"),
new Array("Regular", "Regular")
),
new Array(
new Array("Senior Boy", "Senior Boy"),
new Array("Senior Girl", "Senior Girl"),
new Array("Junior Boy", "Junior Boy"),
new Array("Junior Girl", "Junior Girl"),
new Array("Novice Boy", "Novice Boy"),
new Array("Novice Girl", "Novice Girl")
)
);

champ_comp = new Array(
new Array(
new Array("Preliminary", "Preliminary"),
new Array("Training", "Training"),
new Array("Novice", "Novice")
),
new Array(
new Array("Training Level", "Training Level"),
new Array("First Level", "First Level"),
new Array("Second Level & Up", "Second Level & Up"),
new Array("Quadrille Division", "Quadrille Division")
),
new Array(
new Array("Juniors", "Juniors"),
new Array("Seniors", "Seniors"),
new Array("Advanced", "Advanced")
),
new Array(
new Array("Intermediate Pony", "Intermediate Pony"),
new Array("Intermediate Horse", "Intermediate Horse"),
new Array("Advanced", "Advanced")
),
new Array(
new Array("Junior D", "Junior D"),
new Array("Senior D", "Senior D"),
new Array("Junior C", "Junior C"),
new Array("Senior C/B", "Senior C/B"),
new Array("B/H/H-A/A", "B/H/H-A/A")
),
new Array(
new Array("Modified Large Pony", "Modified Large Pony"),
new Array("Modified Horse I", "Modified Horse I"),
new Array("Regular Horse II", "Regular Horse II"),
new Array("Regular Horse III", "Regular Horse III"),
new Array("Regular Horse IV", "Regular Horse IV")
),
new Array(
new Array("Senior Boy", "Senior Boy"),
new Array("Senior Girl", "Senior Girl"),
new Array("Junior Boy", "Junior Boy"),
new Array("Junior Girl", "Junior Girl"),
new Array("Novice Boy", "Novice Boy"),
new Array("Novice Girl", "Novice Girl")
)
);

function fillSelectFromArray(selectCtrl, itemArray, goodPrompt, badPrompt, defaultItem) {
var i, j;
var prompt;
// empty existing items
for (i = selectCtrl.options.length; i >= 0; i--) {
selectCtrl.options[i] = null; 
}
prompt = (itemArray != null) ? goodPrompt : badPrompt;
if (prompt == null) {
j = 0;
}
else {
selectCtrl.options[0] = new Option(prompt);
j = 1;
}
if (itemArray != null) {
// add new items
for (i = 0; i < itemArray.length; i++) {
selectCtrl.options[j] = new Option(itemArray[i][0]);
if (itemArray[i][1] != null) {
selectCtrl.options[j].value = itemArray[i][1]; 
}
j++;
}
// select first item (prompt) for sub list
selectCtrl.options[0].selected = true;
   }
}
//  End -->
