var bFirst
//var bScroll = true

var cDOT = "DOT";
var cWAAIER = "WAAIER";
var c7 = "7"
var c8 = "8"
var c9 = "9"
var c10 = "10"
var c11 = "11"
var c12 = "12"
var c13 = "13"
var c14 = "14"

var c1081 = "1081"
var c1082 = "1082"
var c1091 = "1091"
var c1092 = "1092"
var c1093 = "1093"
var c1094 = "1094"
var c1095 = "1095"
var c1096 = "1096"

var cALG = "algemeen"
var cZORG = "zorgplicht"
var cINTRO = "introductie"
var cDIENSTEN = "diensten"
var cINLEIDING = "inleiding"
var cCONTACT = "contact"
var cREFERENTIES = "referenties"
var cREACTIE = "reactie"
var cBEDRIJFSFYSIO = "bedrijfsfysio"

var bMoveFromMenu = false;

function menu_CreateMenuLayout()
{
 var sHTML
  
 sHTML = "" 
 sHTML += HTMLSpan_Image("dot1", cDOT);
 sHTML += HTMLSpan_Image("dot2", cDOT);
 sHTML += HTMLSpan_Image("dot3", cDOT);
 sHTML += HTMLSpan_Image("dot4", cDOT);
 sHTML += HTMLSpan_Image("dot5", cDOT);
 sHTML += HTMLSpan_Image("dot6", cDOT);

 sHTML += HTMLSpan_Image("dot7", cDOT);
 sHTML += HTMLSpan_HyperImage1(7, cALG);

 sHTML += HTMLSpan_Image("waaier8", cWAAIER);
 sHTML += HTMLSpan_Hyperlink(8, "introductie");
 sHTML += HTMLSpan_HyperImage1(8, cINTRO);
 sHTML += HTMLSpan_Image("dot8", cDOT);
 sHTML += HTMLSpan_Hyperlink1(1081, "inleiding");
 sHTML += HTMLSpan_Hyperlink1(1082, "voor wie");

 sHTML += HTMLSpan_Image("waaier9", cWAAIER);
 sHTML += HTMLSpan_Hyperlink(9, "diensten");
 sHTML += HTMLSpan_HyperImage1(9, cDIENSTEN);
 sHTML += HTMLSpan_Image("dot9", cDOT);
 sHTML += HTMLSpan_Hyperlink1(1091, "bedrijfsfysiotherapie");
 sHTML += HTMLSpan_Hyperlink1(1092, "preventief signaleringsysteem");
 sHTML += HTMLSpan_Hyperlink1(1093, "cursussen");
 sHTML += HTMLSpan_Hyperlink1(1094, "EMG training");
 sHTML += HTMLSpan_Hyperlink1(1095, "reïntegratie");
 sHTML += HTMLSpan_Hyperlink1(1096, "wachtlijstbemiddeling");
 
 sHTML += HTMLSpan_Image("dot14", cDOT);
 sHTML += HTMLSpan_HyperImage1(14, cZORG);

 sHTML += HTMLSpan_Image("dot10", cDOT);
 sHTML += HTMLSpan_HyperImage1(10, cREFERENTIES);

 sHTML += HTMLSpan_Image("dot11", cDOT);
 sHTML += HTMLSpan_HyperImage1(11, cREACTIE);

 sHTML += HTMLSpan_HyperImage1(12, cCONTACT);
 sHTML += HTMLSpan_Image("dot12", cDOT);

 sHTML += HTMLSpan_Image("waaier13", cWAAIER);
 sHTML += HTMLSpan_Hyperlink(13, "bedrijfsfysio");
 sHTML += HTMLSpan_HyperImage1(13, cBEDRIJFSFYSIO);
 sHTML += HTMLSpan_Image("dot13", cDOT);
 sHTML += HTMLSpan_Hyperlink1(1301, "therapie");
 sHTML += HTMLSpan_Hyperlink1(1302, "therapeutisch onderzoek");

 document.write (sHTML)

 PositionItem("dot1",  false, 23, 114, 85) 
 PositionItem("dot2",  false, 23, 138, 82) 
 PositionItem("dot3",  false, 23, 157, 87) 
 PositionItem("dot4",  false, 23, 173, 97) 
 PositionItem("dot5",  false, 23, 188, 110)	 
 PositionItem("dot6",  false, 23, 203, 120)	 

 PositionItem(cALG,  false, 24, 222, 67) 
 PositionItem("dot7",  false, 23, 220, 125) 

 PositionItem(cINTRO, false, 24, 241, 59)
 PositionItem("dot8",  false, 23, 240, 125) 
 PositionItem("waaier8",  false, 23, 206, 125) 
 PositionItem("text1081", false, 24, 229, 173) 
 PositionItem("text1082", false, 24, 249, 173) 

 PositionItem(cBEDRIJFSFYSIO, false, 24, 261, 52) 
 PositionItem("dot13",  false, 23, 260, 125) 
 PositionItem("waaier13",  false, 23, 226, 125) 
 PositionItem("text1301", false, 24, 249, 173) 
 PositionItem("text1302", false, 24, 269, 173) 

 PositionItem(cDIENSTEN, false, 24, 281, 72)
 PositionItem("dot9",  false, 23, 280, 125) 
 PositionItem("waaier9",  false, 23, 246, 125) 
 PositionItem("text1091", false, 24, 229, 163) 
 PositionItem("text1092", false, 24, 249, 168) 
 PositionItem("text1093", false, 24, 269, 173) 
 PositionItem("text1094", false, 24, 289, 173) 
 PositionItem("text1095", false, 24, 309, 168) 
 PositionItem("text1096", false, 24, 329, 163) 

 PositionItem(cZORG, false, 24, 301, 65) 
 PositionItem("dot14",  false, 23, 300, 125) 

 PositionItem(cREFERENTIES, false, 24, 321, 58)
 PositionItem("dot10",  false, 23, 320, 125) 

 PositionItem(cREACTIE, false, 24, 342, 80)
 PositionItem("dot11",  false, 23, 340, 125) 

 PositionItem(cCONTACT, false, 24, 362, 77) 
 PositionItem("dot12",  false, 23, 360, 125) 

 PositionItem("menuleft",  true, 25, 200, 10) 
 PositionItem("menuright",  true, 25, 200, 230) 
 PositionItem("menutop",  true, 25, 170, 30) 
 PositionItem("menubottom",  true, 25, 380, 30) 
 
}

function menu_CreateMenuFramework()
{
  var sHTML;
  sHTML = "";
  sHTML += "<SPAN ID='menuleft'   STYLE='position:absolute; visibility:hidden;'><A href='#' onMouseOver='ShowContent(true, \"menuleft\");'>  <img src='img/align.gif' height=200 width=40 border=0></A></SPAN>\n";
  sHTML += "<SPAN ID='menuright'  STYLE='position:absolute; visibility:hidden;'><A href='#' onMouseOver='ShowContent(true, \"menuright\");'> <img src='img/align.gif' height=200 width=40 border=0></A></SPAN>\n";
  sHTML += "<SPAN ID='menutop'    STYLE='position:absolute; visibility:hidden;'><A href='#' onMouseOver='ShowContent(true, \"menutop\");'>   <img src='img/align.gif' height=40 width=200 border=0></A></SPAN>\n";
  sHTML += "<SPAN ID='menubottom' STYLE='position:absolute; visibility:hidden;'><A href='#' onMouseOver='ShowContent(true, \"menubottom\");'><img src='img/align.gif' height=40 width=200 border=0></A></SPAN>\n";
  document.write(sHTML);
}
 
function PositionItem(sName, bVisibility, iIndex, iTop, iLeft)
{ 
// if (oObject) {
  oObject = eval(spDoc + sName + spStyle);
  if (bVisibility == true) {
    oObject.visibility='visible';
  }  
  else  {
  	oObject.visibility='hidden';
  }	
  oObject.zIndex=iIndex;
  oObject.top=iTop;
  oObject.left=iLeft;
// } 
}

// Create the SPAN html, like:
// <SPAN ID='sName' STYLE='position:absolute;'><img src='dot.jpg'></SPAN>\n
// Input: sName, identifying the ID of the span object
// Output: html string containing the span
function HTMLSpan_Image(sName, sType)
{
  var sHTML;

  sHTML = "<SPAN ID='" + sName + "' STYLE='position:absolute; visibility:hidden;'><img src='";
  
  if (sType == cDOT)
    sHTML += "img/dot.jpg";
  else if (sType == cWAAIER)
    sHTML += "img/waaier.gif";
  else if (sType == cALG)
    sHTML += "img/algemeen.jpg";
  
  sHTML += "'></SPAN>\n";
  
  return sHTML;
}

//<SPAN ID="text10" STYLE="position:absolute;">
//  <A href="#"
//     onMouseOver="ShowContent(false, '10');"
//     onMouseOut="ShowContent(true, '10');"
//     >referenties</A>
//</SPAN>
function HTMLSpan_Hyperlink(iType, sText)
{
  var sHTML
  
  sHTML = ""
  sHTML += "<SPAN ID='text" + iType + "' STYLE='position:absolute; visibility:hidden;'>\n"
  if (iType == 7)
    sHTML += "<A href='algemeen.htm'\n";
  else
    sHTML += "<A href='#'\n";
  sHTML += "   onMouseOver='ShowContent(false, c" + iType + ");'\n "
  sHTML += "   onMouseOut= 'ShowContent(true, c"  + iType + ");'\n"
  sHTML += "   >" + sText + "</A>\n"
  sHTML += "</SPAN>\n"
  
  return sHTML;
}

//<SPAN ID="text10" STYLE="position:absolute;">
//  <A href="#"
//     >referenties</A>
//</SPAN>
function HTMLSpan_Hyperlink1(iType, sText)
{
  var sHTML
  
  sHTML = ""
  sHTML += "<SPAN ID='text" + iType + "' STYLE='position:absolute; visibility:hidden;'>\n"
  if (iType == 1081)
    sHTML += "<A class=submenu href='inleiding.htm'\n"
  else if (iType == 12)
    sHTML += "<A class=submenu  href='contact.htm'\n"
  else if (iType == 1302)
    sHTML += "<A class=submenu  href='bfonderzoek.htm'\n"
  else if (iType == 1091)
    sHTML += "<A class=submenu  href='therapie.htm'\n"
  else if (iType == 1092)
    sHTML += "<A class=submenu  href='dienst_signal.htm'\n"
  else if (iType == 1093)
    sHTML += "<A class=submenu  href='dienst_cursus.htm'\n"
  else if (iType == 1094)
    sHTML += "<A class=submenu  href='dienst_EMG.htm'\n"
  else if (iType == 1095)
    sHTML += "<A class=submenu  href='dienst_reintegratie.htm'\n"
  else if (iType == 1096)
    sHTML += "<A class=submenu  href='dienst_wachtlijst.htm'\n"
  else
    sHTML += "<A class=submenu href='" + sText.toLowerCase() + ".htm'\n"
  sHTML += "   ><FONT color=#558CA9>" + sText + "</FONT></A>\n"
  sHTML += "</SPAN>\n"
  
  return sHTML;
}


function HTMLSpan_HyperImage1(iType, sName)
{
  var sHTML
  
  sHTML = ""
  sHTML += "<SPAN ID='" + sName + "' STYLE='position:absolute; visibility:hidden;'>";
  sHTML += "<A href='";
  if (sName == cALG)
  {
    sHTML += "default"
//    sHTML += "algemeen"
  }
  else if (sName == cINTRO)
  {
    sHTML += "inleiding"
  }
  else if (sName == cDIENSTEN)
  {
    sHTML += "therapie"
  }
  else if (sName == cBEDRIJFSFYSIO)
  {
    sHTML += "therapie"
  }
  else
  {
    sHTML +=  sName 
  }
  sHTML +=".htm'"
  sHTML += "   onMouseOver='ShowContent(false, c" + iType + ");'\n "
  sHTML += "   onMouseOut= 'ShowContent(true, c"  + iType + ");'\n"
  sHTML += ">";
  sHTML += "<img src='img/" + sName + ".jpg' border=0>";
  sHTML += "</A>"
  sHTML += "</SPAN>\n"
  return sHTML;
}




function ShowContent(bShow, sWho)
{
 
  oContent = eval(spDoc + "content" + spStyle);

//  if (bScroll == true)
//  {
//    oUp = eval(spDoc + "UP" + spStyle);
//    oDown = eval(spDoc + "DOWN" + spStyle);
//  }  
  
  
  o8d= eval(spDoc + "dot8" + spStyle);
  o8w= eval(spDoc + "waaier8" + spStyle);
  o8v1 = eval(spDoc + "text1081" + spStyle);
  o8v2 = eval(spDoc + "text1082" + spStyle);

  o13d= eval(spDoc + "dot13" + spStyle);
  o13w= eval(spDoc + "waaier13" + spStyle);
  o13v1 = eval(spDoc + "text1301" + spStyle);
  o13v2 = eval(spDoc + "text1302" + spStyle);

  o9d= eval(spDoc + "dot9" + spStyle);
  o9w= eval(spDoc + "waaier9" + spStyle);
  o9v1 = eval(spDoc + "text1091" + spStyle);
  o9v2 = eval(spDoc + "text1092" + spStyle);
  o9v3 = eval(spDoc + "text1093" + spStyle);
  o9v4 = eval(spDoc + "text1094" + spStyle);
  o9v5 = eval(spDoc + "text1095" + spStyle);
  o9v6 = eval(spDoc + "text1096" + spStyle);

  mt= eval(spDoc + "menutop" + spStyle);
  ml= eval(spDoc + "menuleft" + spStyle);
  mr= eval(spDoc + "menuright" + spStyle);
  mb= eval(spDoc + "menubottom" + spStyle);

  oCirkel= eval(spDoc + "CIRKEL" + spStyle);

  // Check if this the 1st time to prevent the menu expanding and not displaying the content
  
  // Not the 1st time
  if (bFirst == false)
  {

 //   oCirkel.visibility='visible';
 
 // Do not show the content and scrollbars
    if (bShow == false)
    {
      showContentScrollMF(false, sWho);
      
      //Be sure the waaiers are not visible
      showWaaier8(false)   //Introductie
      showWaaier9(false)   //Diensten
      showWaaier13(false)  //Bedrijfsfysio

      //Determine if a waaier must be shown
      if (sWho == "8")
        showWaaier8(true); //Introductie
      else if (sWho == "9")
        showWaaier9(true); //Diensten
      else if (sWho == "13")
        showWaaier13(true); //Bedrijfsfysio
    }
    
    // Show content and probably the scrollbar if out of the total menu
    else
    {
      // Display the menu
      if (sWho == "8")
      {
        oContent.visibility='hidden';
        o8d.visibility='hidden';
      }
      else if (sWho == "13")  //Bedrijfsfysio
      {
        oContent.visibility='hidden';
        o13d.visibility='hidden';
      }
      else if (sWho == "9")
      {
        oContent.visibility='hidden';
        o9d.visibility='hidden';
      }
      // Display the page 
      else
      {
        showWaaier8(false)  //Introductie
        showWaaier9(false)  //Diensten
        showWaaier13(false)  //Bedrijfsfysio
 
        if (sWho == "7")
        {
          bMoveFromMenu =  true;
          showContentScrollMF(false, sWho);
          mr.left=140;
        }  
        else if (sWho == "10")  // Referenties
        {
          bMoveFromMenu =  true;
          showContentScrollMF(false, sWho);
          mr.left=140;
        }
        else if (sWho == "11")  // Reactie
        {
          bMoveFromMenu =  true;
          showContentScrollMF(false, sWho);
          mr.left=140;
        }
        else if (sWho == "12")  //Contact
        {
          bMoveFromMenu =  true;
          showContentScrollMF(false, sWho);
          mr.left=140;
        }
        else if (sWho == "14")	//Zorg
        {
          bMoveFromMenu =  true;
          showContentScrollMF(false, sWho);
          mr.left=140;
        }
        else
        {
          showContentScrollMF(true, sWho);
        }  
      }
    }  
  }  
  
  //The 1st time
  else
  {
    showContentScrollMF(true, sWho);
    bFirst = false;
  }
}


function showContentScrollMF(bShow, sWho)  //Content & Scrollbar
{
  if (bShow == false)
  {
     if (bMoveFromMenu == false) {
     	oContent.visibility='hidden';
     	showMenuFrame(true);
     }	
     else {
  	bMoveFromMenu = false;
     }
  }
  else 
  {
     oContent.visibility='visible';
     showMenuFrame(false);
     if (sWho == "12") {   // Contact, display circles
       oCirkel.visibility = 'visible';
     }  
  }
  
//  if (bScroll == true) {
//	showScrollbar(true);
//  }
  mr.left=230;

}


function showMenuFrame(bShow)
{
  var sValue = "visible";
  
  if (bShow == false)
    sValue = "hidden";
    
  mt.visibility = sValue;
  ml.visibility = sValue;
  mr.visibility = sValue;
  mb.visibility = sValue;
  
  //If the menu must be displayed also the circles
 oCirkel.visibility= sValue;

}

function showScrollbar(bShow)
{
  var sValue = "visible";
  
  if (bShow == false) {
    sValue = "hidden";
  }  
    
  oUp.visibility = sValue;
  oDown.visibility = sValue;
}

function showWaaier8(bShow)  //Introductie
{
  var sValue = "visible";
  
  if (bShow == false)
    sValue = "hidden";
    
  o8w.visibility = sValue;
  o8v1.visibility = sValue;
  o8v2.visibility = sValue;

  if (bShow == false)
    o8d.visibility='visible';
  else
    o8d.visibility='hidden';
}

function showWaaier9(bShow)  //Diensten
{
  var sValue = "visible";
  
  if (bShow == false)
    sValue = "hidden";
    
  o9w.visibility = sValue;
  o9v1.visibility = sValue;
  o9v2.visibility = sValue;
  o9v3.visibility = sValue;
  o9v4.visibility = sValue;
  o9v5.visibility = sValue;
  o9v6.visibility = sValue;

  if (bShow == false)
    o9d.visibility='visible';
  else
    o9d.visibility='hidden';
}



function showWaaier13(bShow)  //Introductie
{
  var sValue = "visible";
  
  if (bShow == false)
    sValue = "hidden";
    
  o13w.visibility = sValue;
  o13v1.visibility = sValue;
  o13v2.visibility = sValue;

  if (bShow == false)
    o13d.visibility='visible';
  else
    o13d.visibility='hidden';
}

