<!--
      function ProperCase(strWord2Change){
         var UCaseNext = false;
         var iLength = strWord2Change.length;
         if(iLength==0){ return "";}
         var strReturnValue = strWord2Change.charAt(0).toUpperCase();
         for(var iCounter=1;iCounter < iLength;iCounter++){
            if(UCaseNext == true){
               strReturnValue += strWord2Change.charAt(iCounter).toUpperCase();
            }
            else{
               strReturnValue += strWord2Change.charAt(iCounter).toLowerCase();
            }
            var iChar = strWord2Change.charCodeAt(iCounter);
            if(iChar == 45 || iChar == 46 || iChar == 32){
               UCaseNext = true;
            }
            else{
               if(iChar == 99 || iChar == 67){
                  if(strWord2Change.charCodeAt(iCounter-1) == 77 || strWord2Change.charCodeAt(iCounter-1) == 109){
                     UCaseNext = true;
                  }
               }
               else {
                  UCaseNext = false;
               }
            }
         } 
         return strReturnValue;
      }
             
      function TitleCase(str2Check) {
         var strWord;
         var isPrep;
         var arrWords = str2Check.split(" ");
         var arrPrepositions = Array("a","about","above","according to","across","after","against","ahead of","along","alongside","amid","among","an","and","apart from","as","aside from","as for","as of","as to","around","at","away from","because of","before","behind","below","beneath","beside","besides","between","beyond","but","by","by means of","concerning","consisting of","down","due to","during","except","except for","for","from","from among","in","in addition to","in back of","in front of","inside","in place of","in regard to","in spite of","instead of","into","like","near","Next to","nor","of","off of","on account of","or","out","onto","out of","outside","outside of","over","owing to","past","prior to","regarding","since","subsequent to","the","through","till","to it","to me","to the","to them","to us","to you","together with","toward","towards","throughout","under","underneath","until","up","upon","w/","w/o","w/out","w/ out","with","within","without")
         for (var iWordCounter = 0; iWordCounter < arrWords.length;iWordCounter++) {
            isPrep = false;
            for (var iPrepCounter = 0; iPrepCounter < arrPrepositions.length;iPrepCounter++) {
               if (arrWords[iWordCounter].toLowerCase() == arrPrepositions[iPrepCounter]) {
                  isPrep = true;
                  break;
               }
            }
            if (isPrep != true) { arrWords[iWordCounter] = ProperCase(arrWords[iWordCounter]) }               
         }
         str2Check = arrWords.join(" ");
         return str2Check;
      } 
      
      function GetDescription() {
         var strText = document.forms.main.fDescription.value;
         if (strText.length == 0) {
            strText = document.forms.main.fPageText.value;
            strText = StripHTML(strText);            
            if (strText.length > 255) {
               var intPosition = strText.indexOf('.',200);
               if (intPosition !=-1 && intPosition <=255) {
                  strText = strText.substring(0,intPosition+1);
               }
               else {
                  var intPosition = strText.indexOf(' ',225);
                  strText = strText.substring(0,intPosition);
               }
            }
            document.forms.main.fDescription.value = strText;
         }
      }
      function GetName() {
         var iCounter;
         var str2Find;
         var strText = TitleCase(document.forms.main.fHeadline.value);
         if (document.forms.main.fTitle.value.length < 1) {
               document.forms.main.fTitle.value = strText
            }
         if (document.forms.main.fName.value.length < 1) {
            if (strText.length > 50) {
               strText = " " + strText + " ";
               strPrepositions = "a,about,above,according to,across,after,against,ahead of,";
               strPrepositions += "along,alongside,amid,among,an,and,apart from,as,aside from,as for,";
               strPrepositions += "as of,as to,around,at,away from,because of,before,behind,below,beneath,";
               strPrepositions += "beside,besides,between,beyond,but,by,by means of,concerning,consisting of,";
               strPrepositions += "down,due to,during,except,except for,for,from,from among,in,in addition to,";
               strPrepositions += "in back of,in front of,inside,in place of,in regard to,in spite of,instead of,";
               strPrepositions += "into,like,near,next to,nor,of,off of,on account of,or,out,onto,";
               strPrepositions += "out of,outside,outside of,over,owing to,past,prior to,regarding,since,";
               strPrepositions += "subsequent to,the,through,till,to it,to me,to the,to them,to us,";
               strPrepositions += "to you,together with,toward,towards,throughout,under,underneath,";
               strPrepositions += "until,up,upon,w/,w/o,w/out,w/ out,with,within,without";
               var arrPrepositions = strPrepositions.split(",");            
               for (iCounter = 0; i < arrPrepositions.length; ++ iCounter) {
                  str2Find = "/ " + arrPrepositions[i] + " /i";
                  strText.replace(str2Find," ");
               }
               strText = strText.replace(/^\s*|\s*$/g,"");
            }
            document.forms.main.fName.value = strText
         }
      }

      function CheckLength(fieldName,friendlyName,maxLength){
         var objField = eval("document.main." + fieldName)         
         var strText = objField.value;
         if (strText.length > maxLength) {
            alert("Please check the length of your entry for " + friendlyName + "! The text can be no longer than " + maxLength + " characters long.")
         }	
      }

      function StripHTML(ToCheck) {
        ToCheck = ToCheck.replace(/Dear FIRST_NAME;/gi, "")
        ToCheck = ToCheck.replace(/Dear FIRST_NAME:/gi, "")
        ToCheck = ToCheck.replace(/Dear FIRST_NAME,/gi, "")
        var re = new RegExp("<(.|\n)+?>", "g");
        ToCheck = ToCheck.replace(re,"");
        ToCheck = ToCheck.replace(/&nbsp;/gi, " ")
        re = new RegExp("\n|\r", "g");
        ToCheck = ToCheck.replace(re," ");
        re = new RegExp("\s{2,}", "g");
        do {
           ToCheck = ToCheck.replace(/  /g, " ")         
        }
        while (ToCheck.indexOf("  ") !=-1);
        ToCheck = ToCheck.replace(/^\s*|\s*$/g,"");
        return ToCheck;
      }
//-->    

