// TRINPsite, 56.14.2-66.23.5, JS/BodyObjs.js at TRINP = www.trinp.org    -->
// Originally BodyFnct.js minus the parts moved to HeadObjs.js
/*
For JavaScript functions which are or can be called inside the body
statement. (A function such as Load_Images() has to be called outside that
statement, because otherwise an error message may appear while loading.)
*/

function CopyrightF(S) // made part of CenPart.js from F7="65346" 
{
 var alertS = "The symbol (C) stands for 'copyright', "+
"'MVVM' for 'Machiel Vincent van Mechelen', "+
"'ASWW' for '(the number of years) after the Second World War'. "+
"For more information click 'Stichting DNI Foundation' at the bottom "+
"and the (Metric) date at the top of this page."
 alert(alertS)
}

function SnifF()  // this function to be discontinued
{ sniffO() }
function sniffO()  // this function to replace SnifF()
{
 var agtS = navigator.userAgent.toLowerCase();
 var appVerS=navigator.appVersion;
 var majorI = parseInt(appVerS);
 var ieT = (agtS.indexOf("msie")!=-1);
 var navT = ((agtS.indexOf("mozilla")!=-1) && (agtS.indexOf("spoofer")==-1)
  && (agtS.indexOf("compatible")==-1) && (agtS.indexOf("opera")==-1)
  && (agtS.indexOf("webtv")==-1));

 IE4UpT = (ieT && (majorI>=4));
 Nav4UpT = ( navT && (majorI>=4));
 Nav5UpT = ( navT && (majorI>=5));  // for Netscape 6 and 7
 majorI=appVerS.indexOf("MSIE ");
 majorI=parseInt(appVerS.substring(majorI+5))
 IE8UpT = (ieT && (majorI>=8));
}

function NmbToFS(Nmb,d)
{
 Nmb=Nmb*Math.pow(10,d); Nmb=Math.round(Nmb); Nmb=Nmb/Math.pow(10,d);
 NmbS=" "+Nmb; var pointN=NmbS.indexOf(".");
 if (pointN==-1) { NmbS=NmbS+"."; pointN=NmbS.length-1 }
 for (c=1; c<=d; c++) { NmbS=NmbS+"0" };
 NmbS=NmbS.substring(1,pointN+1+d)
 return NmbS
}

function withoutVarO(S)
{
 var N=S.indexOf('?');

 if (N>0) S=S.substring(0,N);
 N=S.indexOf('#');
 if (N>0) S=S.substring(0,N);

 return S
}

//===start source code for startRainbO(S)===

colorA = new Array('#ff00ff',
 '#ff00f0','#ff00e0','#ff00d0','#ff00c0','#ff00b0','#ff00a0',
 '#ff0090','#ff0080','#ff0070','#ff0060','#ff0050','#ff0040',
 '#ff0030','#ff0020','#ff0010',   
 '#ff0000','#ff1000','#ff2000','#ff3000','#ff4000',
 '#ff5000','#ff6000','#ff7000','#ff8000','#ff9000','#ffa000','#ffb000',
 '#ffc000','#ffd000','#ffe000','#fff000','#ffff00',
 '#f0ff00','#e0ff00','#d0ff00','#c0ff00','#b0ff00','#a0ff00','#90ff00',
 '#80ff00','#70ff00','#60ff00','#50ff00','#40ff00','#30ff00','#20ff00',
 '#10ff00','#00ff00',
 '#00ff10','#00ff20','#00ff30','#00ff40','#00ff50','#00ff60','#00ff70',
 '#00ff80','#00ff90','#00ffa0','#00ffb0','#00ffc0','#00ffd0','#00ffe0',
 '#00fff0','#00ffff',
 '#00f0ff','#00e0ff','#00d0ff','#00c0ff','#00b0ff','#00a0ff','#0090ff',
 '#0080ff','#0070ff','#0060ff','#0050ff','#0040ff','#0030ff','#0020ff',
 '#0010ff','#0000ff',
 '#1000ff','#2000ff','#3000ff','#4000ff','#5000ff','#6000ff',
 '#7000ff','#8000ff','#9000ff','#a000ff','#b000ff','#c000ff',
 '#d000ff','#e000ff','#f000ff',
 '#808080')
txtcolorN=Math.round((colorA.length-1)/2); bkgcolorN=txtcolorN;
 bodcolorN=txtcolorN;
bkgLighT=true;  // true if background light and text dark
bkgRedBlu_T=true; txtRedBlu_T=false;
rainbBkgN=0; rainbTxtN=0;  // number of rainbow backgrounds and texts
rainbowStarT=false;  // true if rainbow presentation started
rainbowT=false;  // true if change of rainbow colors continued

function getColorO(Ch)
{
 var redBlu_T=bkgRedBlu_T; var colorN=bodcolorN;

 if (Ch=='G') colorN=bkgcolorN;
 if (Ch=='T') { redBlu_T=txtRedBlu_T; colorN=txtcolorN }
 if (redBlu_T)
   { colorN=colorN+1;
     if (colorN==colorA.length) colorN=0 }
  else
   { colorN=colorN-1;
     if (colorN==-1) colorN=colorA.length-1 }

 if (Ch=='B') bodcolorN=colorN;
 if (Ch=='G') bkgcolorN=colorN;
 if (Ch=='T') txtcolorN=colorN;
}

function lighterO(S)
{
 var N=1; var C='0'; var lighterS='ff'; var darkS='80';

 if (S=='#808080') S='#e0e0e0';
  else
 {
  for (N=1; N<6; N=N+2)
  {
   C=S.charAt(N);
   if (C=='f')
    { if (S.charAt(N+1)=='f') lighterS='ff';
       else { lighterS='f8'; darkS='08' }
    }
   if (C=='e') { lighterS='f0'; darkS='10' }
   if (C=='d') { lighterS='e8'; darkS='18' }
   if (C=='c') { lighterS='e0'; darkS='20' }
   if (C=='b') { lighterS='d8'; darkS='28' }
   if (C=='a') { lighterS='d0'; darkS='30' }
   if (C=='9') { lighterS='c8'; darkS='38' }
   if (C=='8') { lighterS='c0'; darkS='40' }
   if (C=='7') { lighterS='b8'; darkS='48' }
   if (C=='6') { lighterS='b0'; darkS='50' }
   if (C=='5') { lighterS='a8'; darkS='58' }
   if (C=='4') { lighterS='a0'; darkS='60' }
   if (C=='3') { lighterS='98'; darkS='68' }
   if (C=='2') { lighterS='90'; darkS='70' }
   if (C=='1') { lighterS='88'; darkS='78' }
   if (C=='0')
    { if ((S=='#00ffff') || (S=='#ff00ff') || (S=='#ffff00')) lighterS='00';
       else
        {
         if ((S=='#0000ff') || (S=='#00ff00') || (S=='#ff0000'))
           lighterS='80';
          else  { if (N==5) lighterS=darkS; else lighterS='??' }
        }
    } 
   S=S.substring(0,N)+lighterS+S.substring(N+2);
  }
  if (S.charAt(1)=='?') S='#'+darkS+S.substring(3);
  if (S.charAt(3)=='?') S=S.substring(0,3)+darkS+S.substring(5)
 }
 return S
}

function darkerO(S)
{
 var N=1; var C='0'; var darkerS='00';

 if (S=='#ffffff') S='#202020';
  else
 {
  for (N=1; N<6; N=N+2)
  {
   C=S.charAt(N);
   if (C!=='0')
   {
    if (C=='f') { if (S.charAt(N+1)=='f') darkerS='80';
                   else darkerS='78' }
    if (C=='e') darkerS='70'; if (C=='d') darkerS='68';
    if (C=='c') darkerS='60'; if (C=='b') darkerS='58';
    if (C=='a') darkerS='50'; if (C=='9') darkerS='48';
    if (C=='8') darkerS='40'; if (C=='7') darkerS='38';
    if (C=='6') darkerS='30'; if (C=='5') darkerS='28';
    if (C=='4') darkerS='20'; if (C=='3') darkerS='18';
    if (C=='2') darkerS='10'; if (C=='1') darkerS='08';
    S=S.substring(0,N)+darkerS+S.substring(N+2);
   }
  }
 }
 return S
}

function changeColO(Ch,prevN)
{
 var docS="document.all."; var stlS=".style.";  // for IE
 var redBlu_T=bkgRedBlu_T; var colorN=bodcolorN;
 var colorS='#000000'; var prev_colorS='#000000';
 var bkgrS=colorS; var attrS='background';

 if (Nav5UpT)  // for Netscape 6 and 7
  { docS = "document.getElementById('"; stlS = "').style." }

 if (Ch=='G') colorN=bkgcolorN;
 if (Ch=='T') { redBlu_T=txtRedBlu_T; colorN=txtcolorN; attrS='color' }
 colorS=colorA[colorN];
 if (Ch=='B') colorS=lighterO(colorS);
 if ((!bkgLighT && (Ch=='G')) || (bkgLighT && (Ch=='T')))
  colorS=darkerO(colorS);

 if(Ch=='T')
  {
   for (I=1; I<rainbTxtN+1; I++)
   { eval(docS+'RainbTxt'+I+stlS+'color=colorS');
     eval(docS+'RainbTxt'+I+stlS+'background="transparent"') }
  }
  else
  {
   if (Ch=='G')
    {
     for (var I=1; I<rainbBkgN+1; I++)
     { eval(docS+'RainbBkg'+I+stlS+'background=colorS') }
    }
    else
    {
     bkgrS=colorS+' url("'+PathS+'Graf/Bkgr/Whl151Tr.gif") fixed center top';
     eval(docS+'Body'+stlS+'background=bkgrS');
     if ((bodcolorN==0) || (colorS=='#00ff00') || (bodcolorN==colorA.length-1))
       eval(docS+'Body'+stlS+'scrollbarArrowColor="#ffffff"');
      else eval(docS+'Body'+stlS+'scrollbarArrowColor="#000000"');
     eval(docS+'Body'+stlS+'scrollbarBaseColor=colorS');
    }
  }

 if (prevN==-1) prevN=colorA.length-1;
 if (prevN==colorA.length) prevN=0;
 prev_colorS=colorA[prevN];
 if (Ch=='B') prev_colorS=lighterO(prev_colorS); 
 if ((!bkgLighT && (Ch=='G')) || (bkgLighT && (Ch=='T')))
  prev_colorS=darkerO(prev_colorS);
 eval(docS+Ch+'Col'+prevN+stlS+'background=prev_colorS');
 eval(docS+Ch+'Col'+colorN+stlS+'background="black"');
 if (Ch!='B') eval(docS+Ch+'BarR'+stlS+attrS+'=colorS')
}

function createBodyBkgrO(versDateS)
  //  For CSS style sheets the base URI is that of the style sheet, not that
  //  of the source document. However, Netscape takes the body background URL
  //  relative to the directory in which the CSS sheet is being used and will
  //  not go to the right location.
{  // only for IE5Up and Nav6Up
 var docS="document.all."; var stlS=".style.";  // for IE
 var bkgrS='#e2e2e2';

 if ((versDateS=='12345') || (versDateS>'58110'))
 {
  if (Nav5UpT)  // for Netscape 6 and 7
   { docS = "document.getElementById('"; stlS = "').style." }

  if (fileC<'6')
    bkgrS='#00ff00 url("'+PathS+'Graf/Bkgr/1.gif") fixed left top';
   else bkgrS='#e2e2e2 url("'+PathS+'Graf/Bkgr/6.gif") fixed center top';
  eval(docS+'Body'+stlS+'background=bkgrS');
 }
}

function startRainbO(versDateS)
{  // only for IE5Up and Nav6Up
 var docS="document.all."; var stlS=".style.";  // for IE
 var prevN=0;

 if ((versDateS=='12345') || (versDateS>'58110')) 
  {
   if (Nav5UpT)  // for Netscape 6 and 7
    { docS = "document.getElementById('"; stlS = "').style." }

   if ((!rainbowStarT) && (rainbowT))
     { rainbowT=false;
       createBodyBkgrO(versDateS);
       eval(docS+'BBarR'+stlS+'background="#808080"') }
    else
     {
      if (rainbowT)
       {
        getColorO('B');
        if (bkgRedBlu_T) prevN=bodcolorN-1;
         else prevN=bodcolorN+1;
        changeColO('B',prevN);
        if (rainbBkgN>0)
         {        
          getColorO('G');
          if (bkgRedBlu_T) prevN=bkgcolorN-1;
           else prevN=bkgcolorN+1;
          changeColO('G',prevN);
         }
        if (rainbTxtN>0)
         {        
          getColorO('T');
          if (txtRedBlu_T) prevN=txtcolorN-1;
           else prevN=txtcolorN+1;
          changeColO('T',prevN);
         }
       }
     }
  setTimeout("startRainbO('58111')",300000/colorA.length)
                                 // 300000/colorA.length
 }
}
//===end source code for startRainbO(S)===

//===start source code for StatWind(T)===

function Greg_to_Metr(yChrEI,mGregI,dGregI)
{
 this.year=yChrEI-1945;
 if (mGregI==1) add_days=10;    if (mGregI==2) add_days=41;
 if (mGregI==3) add_days=69;    if (mGregI==4) add_days=100;
 if (mGregI==5) add_days=130;   if (mGregI==6) add_days=161;
 if (mGregI==7) add_days=191;   if (mGregI==8) add_days=222;
 if (mGregI==9) add_days=253;   if (mGregI==10) add_days=283;
 if (mGregI==11) add_days=314;
 if (mGregI==12)
  { if (dGregI<22) yr_day=344+dGregI;
     else { this.year=this.year+1; yr_day=dGregI-21 }
  }
  else  yr_day=dGregI+add_days;

 this.day=0;
 if (yChrEI%4==0)  // Gregorian leap year
  { if (yr_day>69 && mGregI>2)
     { yr_day=yr_day+1;
       if (yr_day==366) { this.week=52; this.day=8 }
     }
  }

 if (yr_day==183) { this.week=26; this.day=8 };
 if (this.day==0)
 { if (yr_day>182) yr_day=yr_day-1;
   this.day=1+((yr_day-1)%7);
   this.week=1+((yr_day-this.day)/7) }

 this.month=Math.floor((this.week+3)/4);
}
function two_digitS(number)
{
 numberS=number;
 if (number<10) numberS="0"+numberS
 return(numberS)
}
function TodayF()
{
 today=new Date();
 yChrE=today.getYear();
 if (yChrE<2000)
 { if (yChrE>99) yChrE=yChrE+1900;
    else yChrE=yChrE+2000 }
 mGreg=today.getMonth()+1; dGreg=today.getDate();
 Today= new Greg_to_Metr(yChrE,mGreg,dGreg);
 yNow=Today.year;
 mNow=Today.month; month_noS=two_digitS(mNow);
 wNow=Today.week; week_noS=two_digitS(wNow);
 dNow=Today.day;
}

function getMetrDateO(S)  // S not (yet) used
{
 TodayF();
 metrDateS=yNow+"."+week_noS+"."+dNow;
 metrDateI=(1000*yNow)+(10*week_noS)+dNow;
}

function StatWind(T)  // to be replaced by doStatWindO(S) for true
                      // and getMetrDateO(S) for false
{
 var beginS="Today's date is ";
 var endS="";

 getMetrDateO('');
 if ((week_noS=="01")&&(dNow==1)) endS="HAPPY NEW YEAR!"
 if (T)
   { if ((self.name.indexOf("TRNP_IRight")==-1)
       && (self.name.indexOf("MVVM_IRight")==-1))  // not if in an iframe
      window.defaultStatus=beginS+metrDateS+". "+endS }
  else document.write(metrDateS);
}

function doStatWindO(verS)  // replaces StatWind(T) for true
{
 var updateS="Updated "; var endS=" (today).";
 var yUpd=""; var wUpd=""; var dUpd="";
 var agoI=0;
 var titleS=document.title;
 var lenI=0;
 var spaC=' '; 

 getMetrDateO(verS);
 if (verS<"59011") TopParT=true;
 if (TopParT)  // gives docDateS after successful loading
  {
   yUpd=docDateS.substring(0,2); wUpd=docDateS.substring(2,4);
   dUpd=docDateS.substring(4);
   agoI=((yNow-yUpd)*365)+((wNow-wUpd)*7)+dNow-dUpd;
   if ((wUpd<27) && (wNow>26)) agoI+=1;
   if (agoI<1) updateS+="on ";
    else
     {
      if (agoI==1) updateS+="1 day before ";
       else
        {
         if (agoI<8) updateS+=agoI+" days before ";
          else
           {
            if (agoI>383)  // min for '1.1' instead of '1.0 years'
              { agoI=agoI/365.25; agoI=NmbToFS(agoI,1);
                updateS+=agoI+" years before " }
             else
              { agoI=agoI/7.024; agoI=NmbToFS(agoI,1);
                updateS+=agoI+" weeks before " }
           }
        }
     }
  }

 if ((self.name.indexOf("TRNP_IRight")==-1) &&
     (self.name.indexOf("TRINP_IRight")==-1) &&
     (self.name.indexOf("MVVM_IRight")==-1)) // not if in an iframe
  {
   lenI=titleS.length;
   spaC=titleS.substring(lenI-1);  // here '&nbsp;' not read as space
   window.defaultStatus="  "+updateS+metrDateS+endS;
     // first how long ago updated, then today's date,
     // as the end may be cut off, especially in the title bar 
   if (window.defaultStatus!="  "+updateS+metrDateS+endS)
      // extra info in title bar instead of status window
    {
     titleS=titleS+" ["+updateS+metrDateS+endS+"]";
     lenI=titleS.length;
    }
   for (var I=1; I<(234-lenI); I++ ) { titleS+=spaC }
     // max 95 chars for IE; 233 chars (no max) for Netsc
   document.title=titleS;
  }

}
//===end source code for StatWind(T)===

//===start source code for floating menus===

function Get_Variables()
{
// for Netscape 6Up 'eval(docS + objectR + stlS + lftS + 'pixS')' is
// identical to 'document.getElementById(objectR).style.left=pixS'

 if (readT || (location.hash!=""))
   { moveLefT=false; moveRighT=false }
      // for quiet reading and so that menus do not cover targeted text
  else { moveLefT=true; moveRighT=true };

 if (Nav4UpT)
  { topS = ".top="; lftS = ".left="; docS = "document."; stlS = "";
                    rghtS=".right=";
    xS = "window.pageXOffset"; yS = "window.pageYOffset";
    if (Nav5UpT)  // Nav5UpT, for Netscape 6 and 7
     { docS = "document.getElementById('"; stlS = "').style" }
     else { docS = "document."; stlS = "" }  // for Netscape 4
  }
  else
  { topS=".pixelTop="; lftS=".pixelLeft="; docS="document.all.";
    stlS=".style";     rghtS=".pixelRight=";
    xS = "document.documentElement.scrollLeft";
    yS = "document.documentElement.scrollTop"
  }

 x0=eval(xS); y0=eval(yS);
 objectL="HeadLeft"; objectR = "HeadRight"
}

function Locate_Boxes()
  // no S here, because of setTimeout("Locate_Boxes()", 10) at the end
{
 var verS=VersDateS;
 var pxS=0; var zero_pxS=0;
 var widN=0;

 if (verS==undefined) verS="00000";

 if ((Nav4UpT) || (eval(yS)>0)) ydiff = y0 - eval(yS);
  else
   ydiff = y0 - eval("document.body.scrollTop");
   // for browsers for which 'documentElement' is always 0 or undefined
 if (ydiff<0) ydiff = ydiff-5; else ydiff = ydiff+4;
 if ((ydiff < -1) || (ydiff >1))
  { movey = Math.round(ydiff/10); y0 = y0 - movey };

 if (Nav5UpT) { pxS='y0+"px"'; zero_pxS='"0px"' }
  else { pxS=y0; zero_pxS=0 }
 if (moveLefT) eval(docS + objectL + stlS + topS + pxS);
  else eval(docS + objectL + stlS + topS + zero_pxS);
 eval(docS + objectL + stlS + lftS + zero_pxS);
 if (moveRighT) eval(docS + objectR + stlS + topS + pxS);
  else eval(docS + objectR + stlS + topS + zero_pxS);


   if (verS<"58111")  // before rainbow objects and inline frames
// if (verS<"56454")
   { 
    if (IE4UpT) widN=document.body.clientWidth-100;
     else widN=window.innerWidth-120;
    if (widN<500) widN=500;
    if (widN>903) widN=903;
   }
  else
   {
    if (Nav4UpT)
      { widN=document.getElementById("MainCol").clientWidth-100;
        if (iFrameT)
        widN+=document.getElementById("IFramesCol").clientWidth+32;
      }
     else
      { widN=document.all.MainCol.offsetWidth-100;
        if (iFrameT) 
        widN+=document.all.IFramesCol.offsetWidth+32;
      }
    if (hypoResolutioN>widN+100) widN=hypoResolutioN-100;
   }
 if (Nav5UpT) pxS='x0+widN+"px"'; else pxS=x0+widN;
 eval(docS + objectR + stlS + lftS + pxS);

 setTimeout("Locate_Boxes()", 10);
}

function MenuF(verS) // no use is made (yet) of the (string) parameter
{
 var topS=""; var lftS=""; var docS=""; var stlS="";
 var xS=""; var yS=""; var x0=0; var y0=0; var ydiff=0; var movey=0;
 Get_Variables();

 if (verS<"59011") PostPageT=true;
 if (PostPageT) Locate_Boxes()
}

function Turn_Menu(lefT,onT) // 'false, false'='right off'
{
 var SideS="Left"; if (!lefT) SideS="Right";
 var VisS="Menu"; var HidS="Head";
 if (!onT) { VisS="Head"; HidS="Menu" }
 eval(docS + HidS+SideS + stlS + ".visibility='hidden'");
 eval(docS + VisS+SideS + stlS + ".visibility='visible'");
 if (lefT) objectL=VisS+"Left";
  else { objectR=VisS+"Right"; if (Nav4UpT)
          eval(docS + objectR + stlS + ".width=116") }
}

function turnMenuL(T) { Turn_Menu(true,T) }
  // for use in onmouseover="..." & onmouseout="...";
function turnMenuR(T) { Turn_Menu(false,T) }
  // otherwise error message when using VBScript too

function Switch_Move(SideS)
{
 if (SideS=="Left")
  { if (moveLefT) moveLefT=false; else moveLefT=true };
 if (SideS=="Right")
  { if (moveRighT) moveRighT=false; else moveRighT=true };
}

function clearTargetO(T)  // so that menus do not cover targeted text
{ 
 if (T) { moveLefT=false; moveRighT=false }
  else { moveLefT=true; moveRighT=true }
  // for an example of use see mvvm.net/Tong/DzT/Poezie/Chartres.HTM
}

//===end source code for floating menus===

//===start source code for Load_Images() and Show_Pic(S,T)===

function Load_ImgTopC()
 {
  AdTopC_On = new Image(156,78);
  AdTopC_On.src = PathS+"Graf/VLP/ArrTopC"+fileC+".gif";
  AdTopC_Off = new Image(156,78);
  AdTopC_Off.src = PathS+"Graf/VLP/NewTopC"+fileC+".gif";
 }
function Load_ImgBotL()
 {
  AdBotL_On = new Image(200,100);
  AdBotL_On.src = PathS+"Graf/VLP/ArrBotL"+fileC+".gif";
  AdBotL_Off = new Image(200,100);
  AdBotL_Off.src = PathS+"Graf/VLP/NewBotL"+fileC+".gif";
 }
function Load_ImgBotR()
 {
  AdBotR_On = new Image(200,100);
  AdBotR_On.src = PathS+"Graf/VLP/ArrBotR"+fileC+".gif";
  AdBotR_Off = new Image(200,100);
  AdBotR_Off.src = PathS+"Graf/VLP/NewBotR"+fileC+".gif";
 }
function Load_Images()
 {
  Load_ImgTopC(); Load_ImgBotL(); Load_ImgBotR();
 }

function Show_Pic(plaS,onT)
{
 var addrS="";
 if (plaS.length==5) plaS=plaS.substring(0,4); 
                     // new plaS value does not have a fileC at end anymore!
 if (plaS=="TopC") { OnS=AdTopC_On.src; OffS=AdTopC_Off.src }
 if (plaS=="BotL") { OnS=AdBotL_On.src; OffS=AdBotL_Off.src }
 if (plaS=="BotR") { OnS=AdBotR_On.src; OffS=AdBotR_Off.src }
                      // place of picture in image table depends on browser!
 for (n=0; n<document.images.length; n++)
 { addrS=document.images[n].src; lI=addrS.length;
   addrS=addrS.substring(lI-9);
   if (addrS==plaS+fileC+".gif")
    { if (onT) document.images[n].src=OnS;
       else document.images[n].src=OffS;
      break }
 }
}
function showPicTC(T) { Show_Pic('TopC',T) }  // for use in onmouseover="..." &
function showPicBL(T) { Show_Pic('BotL',T) }  // onmouseout="..."; otherwise error
function showPicBR(T) { Show_Pic('BotR',T) }  // message when using VBScript too

//===end source code for Load_Images() and Show_Pic(S,T)===

//===start source code for checkSourceO() and prevAddrO(S)===
function prevAddrO(S)
{
 var addresS=S.toLowerCase();
 var pA_S4="er"+"rer"; var pA_S1="do";
 var pA_S3="t."+"re"+"f"; var pA_S2="cu"+"m"+"en";
 var I=-2;

 eval("I="+pA_S1+pA_S2+pA_S3+pA_S4+".toLowerCase().indexOf(addresS)");
 if (I<0) return false; else return true
}

function checkSourceO()
 {
  if (prevAddrO("retecool.com"))
     location.replace("http://www.trinp.org/Info/Repl/Retecool.HTM");
   else
    { if (prevAddrO("gradjekivits.write2me.nl") ||
        prevAddrO("www.croco.zegthallo.nl") ||
        prevAddrO("zappen.blog.nl") || prevAddrO("petra.punt.nl"))
     location.replace("http://mvvm.net/Info/VincentVanMechelen.HTM#Waarsch")
    }
 }
//===end source code for checkSourceO() and prevAddrO(S)===

function determine_DimensiO()
{  // global total structure variables (also in BodyFnct.js)
 var searchS=document.location.search;
 var I=-1;
 var hypoReS="0000";
 printWidN=640;  // (IE 640-650; Ff 670-720, see below)
   // min 600, max 1003-252-1=750
   // for this width the document will be printed in the middle on an A4
   // With iframes Ff will add (invisible) stuff from the iframes column;
   // therefore page too much to the left (with extra width on the right)
   // Screen resolutions: 640x480, 800x600, 848x480, 1024x768 & larger;
   // real width 1024 will be read as 1024 by Ff,
   // as 1004 by IE6 and as 1020 by IE8
 hypoResolutioN=0;  // hypothetical resolution width (0, if not given)
 displayWidN=640;
   // display width = print width for real resolution of '1024' (1003-1007)
 windoWidthN=(2*displayWidN)+52  // ideally (display+16+display+20+16)
 readT=false;  // default value for quiet reading
 prinT=false;  // default value for printing
 iFrameT=true;  // one or more iframes by default
 puzzlT=false;  // by default not a puzzle (with always one iframe)

 if (Nav4UpT) { printWidN=670; displayWidN=670 }
   // centering only without iframes on screen
   // for XP system 720 pixels instead of 670
 if (searchS.indexOf('readT=true')>0)
  { readT=true; iFrameT=false }
 if (searchS.indexOf('prinT=true')>0)
  { prinT=true; iFrameT=false; hypoResolutioN=printWidN }

 if ((contacT) && (document.URL.toLowerCase().indexOf('.xs4all.nl')>-1))
  { PathS="http://www.trinp.org/"; iFrameT=false }

 if (searchS.indexOf('iFrameT=false')>0) iFrameT=false;
  else { if (searchS.indexOf('iFrameT=true')>0) iFrameT=true }
 I=searchS.indexOf('hypoReS=');
 if (I>0) 
   { hypoReS=searchS.substring(I+8,I+12);
     if ((hypoReS.length<3) || ((hypoReS.length==3) && (hypoReS<"600")))
      hypoReS="600";
        // needed because using ENTER key (instead of OK)
        // when entering new figures may give impossible values
     if (hypoReS.charAt(0)=="0") hypoReS=hypoReS.substring(1);
     hypoResolutioN=parseInt(hypoReS);
   }

 if (Nav4UpT) windoWidthN = eval("window.innerWidth")-20;
    // 17-20 for scrollbar at right; otherwise scrollbar at bottom
  else
   { windoWidthN = eval("document.body.clientWidth")-4;
     if (IE8UpT) windoWidthN=windoWidthN-13 }

 if (hypoResolutioN==0) hypoResolutioN=windoWidthN;
 if (hypoResolutioN<600) hypoResolutioN=600;
 if (readT && (hypoResolutioN>900)) hypoResolutioN=900;
 if (hypoResolutioN<printWidN) displayWidN=hypoResolutioN;
 if (hypoResolutioN>1050)
  {
   if (hypoResolutioN<1301)
     displayWidN=650+Math.ceil((hypoResolutioN-1050)/50)*50;
    else displayWidN=900;  // max display width: 100+50+600+150
  }
}

function InsLoad(S) // here variables not global for whole document!
{
 var verS=S;

 if (verS<"65346") hearT=false;
   // heart-of-the-matter option introduced with F7 format ("65346")
 if (verS<"59481") { readT=false; prinT=false }
   // reading and printing options introduced on 64.42.5 (under F6="59481")
 if (verS<"58111") { iFrameT=false; puzzlT=false }
   // inline frame(s) introduced on 60.40.7 (under F6="59481")
   // but backwards compatible with rainbow objects of F4="58111" 

 if (!hearT)
 {
  if (IE4UpT || Nav5UpT) startRainbO(S);  // for 'rainbow objects'
  if ((verS>"56156") && !prinT && (IE4UpT || Nav4UpT)) MenuF(S);
    // floating menu boxes introduced with M1 format ("56157")
    // verS condition must be same as for createMenusO(S) in PostPage.js! 
 }
}

function InsUnLd(S) {  }

function OutsLoad(S) // here variables may be global for whole document
{
 var verS=S;

 checkSourceO() // visitors from wrong source(s) are redirected

 sniffO();  // cp. SnifF(false); at MVVM

 if (IE4UpT || Nav5UpT) createBodyBkgrO(verS);  // centered body background
 Load_Images() // for 3 interactive top and bottom images in threefold
}

function OutsUnLd(S) {  }

BodyObjsT=true  // checks whether contents have been transferred
                // (on-line) and scripts (can be) executed

//Copyright 56-66 ASWW, M.Vincent van Mechelen, DNI Foundation
