basis = new String(location.href);
wurzel = basis.substring(0,basis.lastIndexOf('/')) + '/';
//HomeRoot = basis.substring(0,basis.lastIndexOf('kooths')) + 'kooths/';

MiceRoot = new String('http://www.wiwi.uni-muenster.de/09/mice/');

function SetLanguageCookie(ALanguage) {
var ACookie = new String();
ACookie = 'Language='+ALanguage+'; ';

AExpireDate = new Date;
AExpireDate.setMonth(AExpireDate.getMonth()+1);
ACookie = ACookie + 'expires='+AExpireDate.toGMTString()+'; ';

ACookie = ACookie + 'path=/; domain=kooths.de;';

document.cookie = ACookie;
} //SetLanguageCookie

function GetLanguageCookie() {
if (document.cookie.indexOf('Language=German') < 0)
  {return 'English'}
else
  {return 'German'}
} //GetLanguageCookie

function ToggleLanguageCookie() {
if (GetLanguageCookie() == 'German')
  {SetLanguageCookie('English');}
else
  {SetLanguageCookie('German');}
} //ToggleLanguageCookie


function NetscapeBrowser() {
BrowserName = new String(navigator.appName);
if (BrowserName.lastIndexOf('Netscape') != -1)
  {return true}
else
  {return false}
}


function HomeRoot(){
if (basis.lastIndexOf('web/kooths') == -1)
  {return 'http://www.kooths.de/'}
else
  {return basis.substring(0,basis.lastIndexOf('kooths')) + 'kooths/'}
}


function MediaRoot(){
return HomeRoot() + 'media/';
}

function PicsRoot() {
return MediaRoot() + 'pics/';
}

function HomePage(){
if (basis.lastIndexOf('web/kooths') == -1)
  {return 'http://www.kooths.de/'}
else
  {return basis.substring(0,basis.lastIndexOf('kooths')) + 'kooths/index.htm'}
}


sepimage = new String('<img src="' + PicsRoot() + 'centerline.gif"> ');



function navigate(){
document.write(
'<a href="'+HomeRoot()+'index.htm">Home</a> '+
sepimage +
'<a href="'+HomeRoot()+'research/index.php">Research</a> '+
sepimage +
'<a href="'+HomeRoot()+'consulting/index.php">Consulting</a> '+
sepimage +
'<a href="'+HomeRoot()+'teaching/index.htm">Teaching</a> '+
sepimage +
'<a href="'+HomeRoot()+'software/index.php">Software</a> '+
sepimage +
'<a href="'+HomeRoot()+'publications/index.php">Publications</a> '+
sepimage +
'<a href="'+HomeRoot()+'presentations/index.php">Presentations</a> '+
sepimage +
'<a href="'+HomeRoot()+'media/index.php">Media</a> '+
sepimage +
'<a href="'+HomeRoot()+'cv/index.htm">CV</a> '+
sepimage +
'<a href="'+HomeRoot()+'politics/index.php">Politics</a> ' +
sepimage +
'<a href="'+HomeRoot()+'life/index.htm">Life</a>');
}


function navigate_teaching(){
document.write('<p class="navigate">'+
'<a href="' + HomeRoot() + 'index.htm">Dr. Stefan Kooths</a> '+
sepimage +
'<a href="' + HomeRoot() + 'teaching/index.htm">Lehre</a></p>');
}


function fusszeile(autor) {
document.write('<hr><span style="margin-top : 0; font-family : Verdana,Arial; font-size: 8pt">');
document.write('&copy; <a href="http://www.wiwi.uni-muenster.de/09/index.htm" target="_top">Institut für industriewirtschaftliche Forschung</a>, <a href="http://www.uni-muenster.de" target="_top">Universität Münster</a>. Last update: ' +  document.lastModified );
document.write(' <a href="http://mice.uni-muenster.de/team/kooths">[Webmaster]</a>');
document.write('</span>')
}


function basisVerzeichnis() {
  basis = new String(top.location.href);
  return basis.substring(0,basis.lastIndexOf('/')) + '/';
}

function showUnderConstruction() {
document.write('<table ALIGN="CENTER" WIDTH="90%"><tr><td ALIGN="CENTER"><img src="construction.gif"></td><td  ALIGN="CENTER">Website under construction.<br>Contents follow as soon as possible.</td><td ALIGN="CENTER"><img src="construction.gif"></td></tr></table>')
}

function setTitel(TitelString) {
if (NetscapeBrowser() == true)
  //Netscape-Müll
  {
  document.open();
  document.write('<p class="rubrikentitel">' + TitelString + '</p>');
  document.close();
  }//Netscape-Müll
else
  //Microsoft-Qualität
  {
document.write('<TABLE CELLSPACING=0 CELLPADDING=0 WIDTH="100%" STYLE="font-family:Arial;font-size:16pt;color:white;background:gray">');
document.write('<TR><TD><span style="font-family:Arial;font-size:16pt;color:white;background:gray">' + TitelString + '</span></TD></TR>');
document.write('</TABLE>');
  };//Microsoft-Qualität
} //function setTitel


function RootFolder() {
  basis = new String(top.location.href);
  if (basis.indexOf('?') != -1){
  basis = basis.substring(0,basis.indexOf('?'))};
  return basis.substring(0,basis.lastIndexOf('/')) + '/';
}

function WebCenterURL(){
  basis = new String(location.href);
  basis = basis.substring(0,basis.indexOf('mice/'));
  return basis + 'mice/index.htm';
}



function SetTitle(){
top.document.title=document.title;
var BrowserName;
BrowserName=navigator.appName;
if (BrowserName!="Netscape"){
top.document.title=document.title;}
}

function BrowserVersion() {
return parseFloat(navigator.appVersion);
}



function PagePosition(PageName){
if (PageName == "about") {return 1};
if (PageName == "team") {return 2};
if (PageName == "research") {return 3};
if (PageName == "software") {return 4};
if (PageName == "publications") {return 5};
if (PageName == "presentations") {return 6};
if (PageName == "resources") {return 7};
if (PageName == "contact") {return 8};
}


function MarkSelection(PageName){
if ((top != self) && (top.frames[0].name == "mice-control") && (typeof PagePosition(PageName) != "undefined")){
bild = MiceRoot + 'pics/control-arrow-red.gif';
top.frames[0].document.images[PagePosition(PageName)].src = bild;}
}

function MarkSelection3(PageName){
if ((top != self) && (top.frames[0].name == "mice-control")){
bild = MiceRoot + 'pics/control-arrow-red.gif';
top.frames[0].document.images[PagePosition(PageName)].src = bild;}
}


function DemarkSelection(PageName){
if ((top != self) && (top.frames[0].name == "mice-control")){
bild = MiceRoot + 'pics/control-arrow.gif';
top.frames[0].document.images[PagePosition(PageName)].src = bild;}
}


function WritePageFooter(){
document.write('<p class="PageFooter">&copy; KOOTHS, <a href="'+HomePage()+'" target="_top">www.kooths.de</a>, last modified: ' + document.lastModified + ' | <a href="'+HomePage()+'">Webmaster</a></p>');
}


function WritePageFooterMICE(){
document.write('<p class="PageFooter">&copy; Muenster Institute for Computational Economics (<a href="http://mice.uni-muenster.de" target="_top">MICE</a>), last modified: ' + document.lastModified + ' | <a href="http://mice.uni-muenster.de/team/kooths">Webmaster</a></p>');
}



function WriteLinkedPageHeader(HeaderPic,HeaderLink,HeaderTarget,PageTitle){
document.write(
'<TABLE class="PageHeader" ALIGN="CENTER" BGCOLOR="#FFFFFF" BORDERCOLORDARK="#FFFFFF" CELLSPACING="0">'+
'<tr>'+
'<td class="PageControl">'+
'<a href="' + HeaderLink + '" target="' + HeaderTarget + '"><img src="' + HeaderPic +'" border="0" align="left"></a>');
navigate();
document.write(
'</td>'+
'</tr>'+
'<tr>'+
'<td class="PageTitle">'+PageTitle+'</td>'+
'</tr>'+
'</TABLE>');
}


function WritePageHeader(HeaderPic,PageTitle){
WriteLinkedPageHeader(PicsRoot()+HeaderPic,HomeRoot()+'index.htm','',PageTitle);
}