<!--	// Browser Wrapper


//****************************************************
// Sentence Case Checker and Setter routine
// for use in Text Form Fields
// C. Sewell 2003
//****************************************************


function checkCase(field)	// check for Sentence case and enforce
{
 var excludes=" the and or a ";	// list of words to Exclude from Sentence Case

	if (field.value == "") return false;
	var textField = field;
	var textValue = new String(textField.value);

  txt=textValue+" ";
  txt=txt.toLowerCase();
  txtl="";
  punc=",.?!:;)'";
  punc+='"';
  while ((txt.length>0)&&(txt.indexOf(" ")>-1)){
   pos=txt.indexOf(" ");
   wrd=txt.substring(0,pos);
   wrdpre="";
   if (punc.indexOf(wrd.substring(0,1))>-1){
    wrdpre=wrd.substring(0,1);
    wrd=wrd.substring(1,wrd.length);
    }
   cmp=" "+wrd+" ";
   for (var i=0;i<9;i++){
    p=wrd.indexOf(punc.substring(i,i+1));
    if (p==wrd.length-1){
     cmp=" "+wrd.substring(0,wrd.length-1)+" ";
     i=9;
     }
    }
   if (excludes.indexOf(cmp)<0){
    ltr=wrd.substring(0,1);
    ltr=ltr.toUpperCase();
    wrd=ltr+wrd.substring(1,wrd.length);
    }
   txtl+=wrdpre+wrd+" "; 
   txt=txt.substring((pos+1),txt.length);
   }
  ltr=txtl.substring(0,1);
  ltr=ltr.toUpperCase();
  txtl=ltr+txtl.substring(1,txtl.length-1);

	textField.value = txtl;
}


//	Browser Wrapper  -->
