
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='/_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 + "','','/_img/b_pijltje2.gif',1);\"> " +
                                   "<img class='showOnlyInNormalView' alt='' height='15' src='/_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='/_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='/_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='/_img/i_pijltjeleeg.gif' width='20' border='0'></td></tr>" +
                   "<tr><td colspan='3' width='1' height='5'><img alt='' height='5' src='/_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";

	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>");
}


// 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)
{
  if (window.location.pathname == '/')
    window.location.href += "eng/";
  else
  {
    rExp = new RegExp(window.location.pathname);
    window.location.href = window.location.href.replace(rExp,new_pathname);
  }
}


// This function switched from the dutch page to the english one
function SwitchPage()
{
  if (typeof(e_page) == "undefined")
	{ 
  
    myloc = window.location.pathname;
    //window.location.pathname = "/eng" + myloc;
    change_path("/eng" + myloc);
  }
	else if (e_page == "")
	  // window.location.pathname = "/eng/not_available.htm";
    change_path("/eng/not_available.htm");
	else  
    // window.location.pathname = e_page;
    change_path(e_page);
}


// This function sets the status
function SetStatusTxt(txt)
{
  window.status = txt;
  setTimeout("erase()", 5000);
}

// This function clears the status
function erase()
{
  window.status="";
}

