var cLOGO = "LOGO";
var cSCROLL = "SCROLL";
var cKOW = "KOW";
var cCIRKEL = "CIRKEL";
var bScroll;
var bUseScript = true;


oBrowser = new Browser()
page_DetermineObjectLayout();

// Determine how the object should be named, depending on the browser
function page_DetermineObjectLayout()
{
  if (oBrowser.ns4)
  {
    spDoc = "document.";
    spStyle = "";
  }
  else if (oBrowser.ie5)
  {
    spDoc = "document.getElementById('";
    spStyle = "').style";
  }
  else if (oBrowser.ns6)
  {
    spDoc = "document.getElementById('";
    spStyle = "').style";
  }
  else
  {
    spDoc = "document.all.";
    spStyle = ".style";
  }
}

function page_DetermineWindowLayout()
{
  if (oBrowser.ns4)
  {
    iWindowHeight=innerHeight;
    iWindowWidth=innerWidth;
  }
  else if (oBrowser.ns6)
  {
    iWindowHeight=innerHeight;
    iWindowWidth=innerWidth;
  }
  else
  {
    iWindowWidth=window.document.body.clientWidth;
    iWindowHeight=window.document.body.clientHeight;
  }
}



function Browser()
{
// browser - major - minor - agent
// ie5     - 4     - 4     - mozilla/4.0 (compatible; msie5.0; windows98; digext)
// ns4     - 4     - 4.04  - mozilla/4.04 [en]c-ne (win95; i)
// ns6     - 5 	   - 5     - mozilla/5.0 (windows; 4; win95; en-us; m18) gecko/20010131 netscape6/6.01 	



    var sb_Agent = navigator.userAgent.toLowerCase();
    
    this.major = parseInt(navigator.appVersion);
    this.minor = parseFloat(navigator.appVersion);
    this.ns  = ((sb_Agent.indexOf('mozilla')!=-1) && 
			   ((sb_Agent.indexOf('spoofer')==-1) && 
			   (sb_Agent.indexOf('compatible') == -1)));
    this.ns4b = (this.ns && 
				(this.major == 4) && 
				(this.minor <= 4.03));
    this.ns4 = (this.ns && 
				(this.major == 4));
    this.ns6 = (this.ns && 
				(this.major == 5));
    this.ie   = (sb_Agent.indexOf("msie") != -1);
    this.ie4  = (this.ie && (this.major == 4) && 
				(sb_Agent.indexOf('msie 5.0')==-1));
    this.ie5  = (this.ie && (this.major == 4)&& 
				(sb_Agent.indexOf('msie 5.0')!=-1));
}

function page_Resize()
{
  
  
  if (oBrowser.ns4)
  {
    if (iWindowWidth != innerWidth && iWindowHeight != innerHeight)
    {
     location.reload()
     window.captureEvents(Event.RESIZE)
      window.onresize = page_Resize()
    }  
  }
  else if (oBrowser.ns6)
  {
    iWidth=window.document.body.clientWidth;
    if (iWidth > 300)
      location.reload()
  }
  else if (oBrowser.ie5)
  {
    iWidth=window.document.body.clientWidth;
    if (iWidth > 300)
      location.reload()
  }
  else
  {
    iWidth=window.document.body.clientWidth;
    if (iWidth > 300)
      location.reload()
  }
} 


function page_SetCSS()
{
  if (oBrowser.ns) 
  {
    document.write("<LINK REL='STYLESHEET' HREF='css/layoutNS.css' type='text/css'>")
  }
  else
  {
    document.write("<LINK REL='STYLESHEET' HREF='css/layout.css' type='text/css'>")
  }

}

function page_CreatePageLayout()
{
  var sHTML
  var iValue
  
  sHTML = "" 
  sHTML += page_HTMLSpan_Image("logo", cLOGO);
//  sHTML += page_HTMLSpan_Scroll("scrolltop", 122);
//  sHTML += page_HTMLSpan_Scroll("scrollbottom", 2000);
  sHTML += page_HTMLSpan_Image(cKOW, cKOW);
  sHTML += page_HTMLSpan_Image("CIRKEL", "CIRKEL");
//  sHTML += page_HTMLSpan_Scroll("background", 2000);
  document.write (sHTML)

  page_PositionItem("logo",  false, 13, 0, 75) 
//  page_PositionItem("scrolltop",  true, 12, -10, 0) 
//  page_PositionItem("background",  true, 1, -10, 0) 
  
  iValue = iWindowHeight-40;
  if (iValue < 350)
    iValue = 350;
//  page_PositionItem("scrollbottom",  true, 12, iValue, 0) 

  iValue = iWindowWidth-246;
  if (iValue < 220)
    iValue = 220;
  else if (iValue > 550)
    iValue = 550;
  page_PositionItem(cKOW,  false, 13, 75, iWindowWidth-300) 
  
  page_PositionItem("CIRKEL",  false, 10, 30, 200) 
}


function page_HTMLSpan_Image(sName, sType)
{
  var sHTML;
  
  sHTML = "<SPAN ID='" + sName + "' STYLE='position:absolute; visibility:hidden;'><img src='";
  
  if (sType == cLOGO)
    sHTML += "img/ergo.jpg";
  else if (sType == cSCROLL)
    sHTML += "img/man11.jpg";
  else if (sType == cKOW)
    sHTML += "img/werk2.jpg";
  else if (sType == cCIRKEL)
    sHTML += "img/cirkel.gif";
  
  sHTML += "'></SPAN>\n";
  
  return sHTML;
}

function page_CreatePage()
{
  var sHTML 
//  gecopieerd naar html omdat netscape er niet tegen kan

  if (bUseScript == true ) {	
  	menu_CreateMenuFramework();
  }	
  
  bFirst = true
  page_DetermineWindowLayout()
  menu_CreateMenuLayout()
  page_CreatePageLayout()
//  scroll_CreatePageLayout(bUseScript);
  page_createHTMLSpanStart_Content();
  document.write("<BR><img src='img/transp.gif' height='65'>")
}

function page_EndPage(iLength)
{
//  scroll_SetContentEnd(iLength);
  page_show()
}

function page_PositionItem(sName, bVisibility, iIndex, iTop, iLeft)
{ 
  oObject = eval(spDoc + sName + spStyle);
  
  if (bVisibility == true)
    oObject.visibility='visible';
  else  
  oObject.visibility='hidden';
  oObject.zIndex=iIndex;
  oObject.top=iTop;
  oObject.left=iLeft;
}


function page_HTMLSpan_Scroll(sName, iHeight)
{
  var sHTML;
  
  sHTML = "<SPAN ID='" + sName + "' STYLE='position:absolute; visibility:hidden;'>\n";
  sHTML += "<table bgcolor='white' cellpadding=0 cellspacinng=0 width=" + iWindowWidth + "><tr><td><img src='img/align.gif' width=" + iWindowWidth + " height=" + iHeight + "></td></tr></table>\n";
  sHTML += "</SPAN>\n";
  
  return sHTML;
}

//<SPAN ID="content" STYLE="position:absolute; width:400; height:200;">
function page_createHTMLSpanStart_Content()
{
  var sHTML;
  var iWidth;
  var iLeft;
  var iRight;
  var iTop;
  
  iLeft = 200;
  iRight = 100;
  iTop = 114;
  
  iWidth = iWindowWidth - iLeft - iRight;
  if (oBrowser.ns)
    iWidth -= 60; 
  if (iWidth < 250)
    iWidth = 250;
  
  sHTML =  "<SPAN ID='content' "
  sHTML += "STYLE='position:absolute; top:" + iTop + "; left:" + iLeft + "; width:" + iWidth + "; z-index:11'>\n";
 
  document.write(sHTML);
}

function page_createHTMLSpanEnd_Content()
{
  var sHTML;		
  
  sHTML = ""
  sHTML += "<SPAN ID='contentend' STYLE='position:relative; visibility:hidden; z-index:11'><P>&nbsp;</P></SPAN>\n";
  sHTML +=  "</SPAN>\n";
  
  return sHTML;
}

function page_show()
{
  page_showItem("logo") 
  page_showItem(cKOW) 
 //page_showItem(cCIRKEL) 

  page_showItem("dot1") 
  page_showItem("dot2") 
  page_showItem("dot3") 
  page_showItem("dot4") 
  page_showItem("dot5")	 
  page_showItem("dot6")	 

  page_showItem(cALG  ) 
  page_showItem("dot7") 

  page_showItem(cINTRO)
  page_showItem("dot8") 

  page_showItem(cDIENSTEN)
  page_showItem("dot9") 

  page_showItem(cREFERENTIES)
  page_showItem("dot10") 

  page_showItem(cREACTIE)
  page_showItem("dot11") 

  page_showItem(cCONTACT) 
  page_showItem("dot12") 

  page_showItem(cBEDRIJFSFYSIO) 
  page_showItem("dot13") 
  
  page_showItem(cZORG)
  page_showItem("dot14") 

}

function page_showItem(sName)
{ 
  oObject = eval(spDoc + sName + spStyle);
  oObject.visibility='visible';
}

function fotodetail (venster, breedte, hoogte)
{
  var w= open (venster, "1001688661", "top=45,left=45,width=" + breedte + ",height=" + hoogte);
  return;
}
