//======================================================================================================//
//  Filename     : oncGlobal.js										//
//  Release      : 2003 01-01										//
//													//
//  The oncGlobal.js is used for some global events.							//
//													//
//  1. Error handling.											//
//  2. Fixes the position for the smal sub navigation.							//
//  3. Loads the iframe document from the parent and sets the image for the smal subnavigation.		//
//  4. Hides the menu when the parent document recieves a mouseclick.					//
//======================================================================================================//
//  This script was created by Dave Bleeker.								//
//  Copyright 2003 SO-Creatief.										//
//======================================================================================================//


var op   = /opera 5|opera\/5/i.test(navigator.userAgent);
var ie   = !op && /msie/i.test(navigator.userAgent);			
var ie50 = /MSIE ((5\.[01234])|([2345]))/.test( navigator.userAgent );	
var ie55 = ie  && /MSIE ((5\.[56789])|([6789]))/.test( navigator.userAgent );
var mz   = !op && /mozilla\/5/i.test(navigator.userAgent);	

//======================================================================================================//
// Declare events.											//
//======================================================================================================//
window.onerror   = goto_index_before_somebody_will_find_out;
window.onload 	 = fixSize;
document.onclick = hideAll;

//======================================================================================================//
// Error Handling. well...we just don't show the error :)						//
//======================================================================================================//
function goto_index_before_somebody_will_find_out()
{
  return true;
}

//======================================================================================================//
// Fix size for the subnavigation.									//
//======================================================================================================//
function fixSize()
{
  var smallNav = document.getElementById("smallNav");
  smallNav.style.left = 780 - smallNav.offsetWidth;
  ParseData();
}

//======================================================================================================//
// Loads a document in the iframe and set the image of that document in the subnavigation.		//
//======================================================================================================//
function getIframe()
{
  // This function will load the correct file into the iframe.
  var str = document.location.href;
  var index = str.split("#");

  if (index[1] == "" || index[1] == null)
  {
    // Just do nothing...
  }
  else
  {
    parent.content.location.href = "iframe/" +index[1];
  }
  if (ie50)
  {
    parent.content.location = "iframe/" +parent.location.search.substr(1);
    var topnavSmall = parent.location.search.substr(1).split(".");
    swap("nav_smallText","navtop/klein_txt_" +topnavSmall[0]+ ".png");
  }
  newStr = index[1].split(".");
  swap("nav_smallText","navtop/klein_txt_" +newStr[0]+ ".png");
}

//======================================================================================================//
// Function is fired when the parent document recieves a mouseclick.					//
//======================================================================================================//
function hideAll()
{
  oncRoot1.hide();
}

