
   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 switchMenu( id){
         obj = document.getElementById( id);
             if (obj){
                if ( obj.style.display == ""){
                   obj.style.display = "block";
                }
                else{
                    obj.style.display = "";
                }

             }
}



var nameOFcookie = 'slogan';

            var st;

 

            function GetCookie(NameOfCookie){

                        if (document.cookie.length > 0){

                                    begin = document.cookie.indexOf(NameOfCookie+"=");

                                    if (begin != -1){ // Note: != means "is not equal to"

                                                begin += NameOfCookie.length+1;

                                                end = document.cookie.indexOf(";", begin);

                                                if (end == -1) end = document.cookie.length;

                                                            return unescape(document.cookie.substring(begin, end));

                                    }

                        }

                        return null;

            }

 

            function SetCookie(NameOfCookie, value, expiredays){

                        var ExpireDate = new Date ();

                        ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 24 * 3600 * 1000));

                        document.cookie = NameOfCookie + "=" + escape(value) +

                        ((expiredays == null) ? "" : "; expires=" + ExpireDate.toGMTString());

            }

 

            st = GetCookie(nameOFcookie);

            if(!st) st='1';

            st++;

            if(st=='7') st='1'; // up to 4 styles

//          st='1';   // remove comments to set a specific style (ie style 1)



