
var NN2 = (navigator.appName == "Netscape") && (navigator.userAgent.indexOf("Mozilla/2") != -1);

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function InsertTableHeader(Width, Info, MyLink) {

  // replaces the blank spaces with &nbsp;
  if (Info != "") {
    regex = / /gi;
    Info = Info.replace(regex, "&nbsp;");
  }

  if (MyLink)
    document.write("<table summary='' cellspacing=0 cellpadding=0 width='" + Width + "%' border='0'>" +
                   "<tr>" +
                   "<td width=23><img class='showOnlyInNormalView' alt='' height=15 src='/eng/_img/i_bolleke.gif' width=23></td>" +
                   "<td class=balkje width='100%' bgcolor='#999999'>" + 
                   "&nbsp;&nbsp;" + Info + 
                   "</td>" +
                   "<td width=15><a href='" + MyLink + "' " + 
                                   "onmouseout  = \"MM_swapImgRestore()\" " +
                                   "onmouseover = \"MM_swapImage('" + Info + "','','/eng/_img/b_pijltje2.gif',1);\"> " +
                                   "<img class='showOnlyInNormalView' alt='' height='15' src='/eng/_img/b_pijltje.gif' " +
                                   "width='20' border='0' name='" + Info + "'></a></td></tr>" +
                   "<tr><td colspan='3' width='1' height='5'><img alt='' height='5' src='/eng/_img/pt_transp.gif'></td></tr></table>");
  else
    document.write("<table summary='' cellspacing=0 cellpadding=0 width='" + Width + "%' border='0'>" +
                   "<tr>" +
                   "<td width='23'><img class='showOnlyInNormalView' alt='' height='15' src='/eng/_img/i_bolleke.gif' width='23'></td>" +
                   "<td class=balkje width='100%' bgColor='#999999'>" + 
                   "&nbsp;&nbsp;" + Info + 
                   "</td>" +
                   "<td width='15'><img class='showOnlyInNormalView' alt='' height='15' src='/eng/_img/i_pijltjeleeg.gif' width='20' border='0'></td></tr>" +
                   "<tr><td colspan='3' width='1' height='5'><img alt='' height='5' src='/eng/_img/pt_transp.gif'></td></tr></table>");    
}

// This function puts the focus on the calling document
function FocusWindow() {
  if (!NN2)
    self.focus();    
}

// This function outputs the You are Here string : ex : Faculty > Tew > Home
function OutputURHere() {
  if (typeof(URHere) == "undefined")
    URHere  = "";
  document.write(URHere);
}      

// This function outputs the name of the person who is responsable for the content
function OutputAuthor()
{
	if (typeof(fnaam_author) == "undefined")
		fnaam_author = "Tolleneer";

	if (typeof(vnaam_author) == "undefined")
		vnaam_author = "Marie";
		
  if (typeof(fnaam_author) == 'string')
  {
	  document.write("<a href= \"http://cwisdb.cc.kuleuven.ac.be/persdb-bin/persdb?lang=N&amp;oproep=persoon&amp;fnaam=" + fnaam_author + "&amp;vnaam=" + vnaam_author + "\">");
	  document.write(vnaam_author);
	  document.write("&nbsp;");
	  document.write(fnaam_author);
	  document.write("</a>");
	}
	else
	{
	  for(i=0; i < fnaam_author.length; i++)
	  {
	  	document.write("<a href= \"http://cwisdb.cc.kuleuven.ac.be/persdb-bin/persdb?lang=N&amp;oproep=persoon&amp;fnaam=" + fnaam_author[i] + "&amp;vnaam=" + vnaam_author[i] + "\">");
	    document.write(vnaam_author[i]);
	    document.write("&nbsp;");
	    document.write(fnaam_author[i]);
	    document.write("</a>");
	    if (i != (fnaam_author.length-1))
        document.write(",&nbsp;");
	  }
	}
}


// This function outputs the name of the person who is responsible for creating the page
function OutputCreator()
{
	if (typeof(fnaam_creator) == "undefined")
		fnaam_creator = "Bauters";

	if (typeof(vnaam_creator) == "undefined")
		vnaam_creator = "Nic";
	
	document.write("<a href= \"http://cwisdb.cc.kuleuven.ac.be/persdb-bin/persdb?lang=N&amp;oproep=persoon&amp;fnaam=" + fnaam_creator + "&amp;vnaam=" + vnaam_creator + "\">");
	document.write(vnaam_creator);
	document.write("&nbsp;");
	document.write(fnaam_creator);
	document.write("</a>");
}


// This function outputs the last modification date of the file (date in dutch format)
// As input we take the servers document property (formatted in mm/dd/yyyy) fileModifiedDate
function ConvertDate()
{
  // Default initialisation just to make sure there is a date
  var aMonth = new Array("januari", "februari" , "maart" , "april" , "mei" , "juni" , "juli" , "augustus" , "september" , "oktober", "november", "december");

  // Split the server date into day, month and year
  modDate  = new Date(document.lastModified);
  modDay   = modDate.getDate();
  modMonth = modDate.getMonth();
  modYear  = modDate.getYear();
  if (modYear<1000) modYear +=1900;
  if(modDay<10) modDay = "0" + modDay;

  // Output the date in dutch format : day-month-year
  document.write(modDay + " " + aMonth[modMonth] + " " + modYear);
}


function change_path(new_pathname)
{
  rExp = new RegExp(window.location.pathname);
  window.location.href = window.location.href.replace(rExp,new_pathname);
}


// This function switched from the english page to the dutch one
function SwitchPage()
{
  if (typeof(d_page) == "undefined")
  {
    myloc = window.location.pathname;
    pos = myloc.indexOf('/eng');
    if (pos == 0)
      //window.location.pathname = myloc.substring(4, myloc.length);
      change_path(myloc.substring(4, myloc.length));
    else
      //window.location.pathname = '/default.htm';
      change_path("/default.htm");
      
  }
  else if (d_page == "")
    //window.location.pathname = "/not_available.htm";
    change_path("/not_available.htm");
  else
    //window.location.pathname = d_page;
    change_path(d_page);
}


// This function sets the status
function SetStatusTxt(txt)
{
  window.status = txt;
  setTimeout("erase()", 5000);
}

// This function clears the status
function erase()
{
  window.status="";
}

