
function setup() {
//if(self.name==top.name){document.location='start.html';}
dotlocation=location.pathname.lastIndexOf('.');
if(location.pathname.lastIndexOf('/')==0){slashlocation=location.pathname.lastIndexOf('\\')+1;}
else{slashlocation=location.pathname.lastIndexOf('/')+1;}
if(location.pathname.lastIndexOf('_')>slashlocation){dotlocation=location.pathname.lastIndexOf('_');dontsend=true;}
QuestionName=location.pathname.substring(slashlocation,dotlocation);
//alert(nextQuestionName);
   var moz;
   canbeginnow = true;
   if (navigator.appName == "Mozilla" || (navigator.appName == "Netscape" && navigator.appVersion.indexOf("4.") == -1))
      moz = true;
   if (navigator.appName == "Microsoft Internet Explorer") {
      wdth = document.body.clientWidth;
   }
   else if (navigator.appName == "Netscape" && navigator.appVersion.indexOf("4.") != -1){
      wdth = window.innerWidth;
      document.captureEvents(Event.KEYPRESS);
   }
   else if (moz)
      document.addEventListener("keyup",keypress,true);
   if (!moz)
      document.onkeypress=keypress;
      this.focus();
   }
   if (window.Event)
      document.captureEvents(Event.MOUSEUP);
   function nocontextmenu(){
      event.cancelBubble = true
      event.returnValue = false;
      return false;
   }
 /*  function norightclick(e){
      if (window.Event){
         if (e.which == 2 || e.which == 3)
            return false;
      }
      else
         if (event.button == 2 || event.button == 3){
            event.cancelBubble = true;
            event.returnValue = false;
            return false;
         }
      }
      if (document.layers){
         document.captureEvents(Event.MOUSEDOWN);
      }
      document.oncontextmenu = nocontextmenu;*/
     // document.onmousedown = norightclick;
     // document.onmouseup = norightclick;
   function keypress(e) {
      if (!canbeginnow) return;
      if (navigator.appName == "Microsoft Internet Explorer")
         tmp = window.event.keyCode;
      else if (moz)
         tmp = e.which;
      // if space bar hit
      if (tmp == 32) {
    window.close();
    return;
      }
   }


//####################
function writeNextButton(thisform){
dashlocation=QuestionName.lastIndexOf('-')+1;
QuestionNameText=QuestionName.substring(0,dashlocation);
QuestionNameNumber=eval(QuestionName.substring(dashlocation,dotlocation));
if(QuestionNameNumber<9){nextQuestionName=QuestionNameText+"0"+(QuestionNameNumber+1)+".htm";}
else{nextQuestionName=QuestionNameText+(QuestionNameNumber+1)+".htm";}
//document.location=nextQuestionName;
if(questionType=="i"){document.location=nextQuestionName;}
else if(NextQuestion(thisform)){document.location=nextQuestionName;}
}

//####################

