function toplink(week, intro, link, href)
{ this.week=week;
  this.intro=intro;
  this.link=link;
  this.href=href;
}

function get4DigitYear(theDate)
{ if (theDate.getFullYear) return theDate.getFullYear();
  var y = theDate.getYear();
  return y + ((y < 1900) ? 1900 : 0);
}

if (document.all || document.layers || document.getElementById)
{ toplinks=new Array();
  i=0;
  toplinks[i++]=new toplink(12, "Wie sagt man's ganz krass oder wie heißt es am Richtsberg?","Krassomator","http://www.levelwo.de/krassomator");
  toplinks[i++]=new toplink(13, "Skripte, Kurse, Repetitorien, Unterlagen, Tipps für Klausuren und Hausarbeiten","www.studeo.de","http://www.studeo.de/");
  toplinks[i++]=new toplink(14, "Musik, Infos und Videos","www.getmusic.com","http://www.getmusic.com");
  toplinks[i++]=new toplink(15, "Partyplaner, alte Klausuren, Studentenjobs, Mitfahrzentrale","www.studenten-marburg.de","http://www.studenten-marburg.de");
  toplinks[i++]=new toplink(16, "Mailen, Faxen, SMS schicken... umsonst","www.web.de","http://www.web.de");
  toplinks[i++]=new toplink(17, "Hast Du schon den Frosch im Mixer gesehen?","www.joecartoon.com","http://www.joecartoon.com");
  toplinks[i++]=new toplink(18, "Neue Telefontarife? Immer günstig telefonieren!","www.billiger-telefonieren.de","http://www.billiger-telefonieren.de");
  toplinks[i++]=new toplink(19, "Express Online: Dein Marburger Magazin","www.marbuch-verlag.de","http://www.marbuch-verlag.de/");
  toplinks[i++]=new toplink(20, "Webshots: einfach schöne Bilder","www.webshots.com","http://www.webshots.com/");
  toplinks[i++]=new toplink(21, "Beste Suchmaschinen auf einen Mausclick","Beste Suchmaschinen","http://stud-www.uni-marburg.de/~Studdorf/index.html?content=links/suchen.html");
  toplinks[i++]=new toplink(22, "Einkaufen im Internet","www.shop.de","http://www.shop.de/");
  toplinks[i++]=new toplink(23, "Hit Radio FFH Online","www.ffh.de","http://www.ffh.de/");
  toplinks[i++]=new toplink(24, "Audimax Online (mit SMS-Dienst)","www.audimax.de","http://www.audimax.de/");
  toplinks[i++]=new toplink(25, "Die witzigste Seite im Internet","www.witz.de","http://www.witz.de/");
  toplinks[i++]=new toplink(26, "Alle Spieledemos und Patches","www.spielehit.de","http://www.spielehit.de/");
  toplinks[i++]=new toplink(27, "Jede aktuelle Software und mehr","www.download.com","http://www.download.com/");
  toplinks[i++]=new toplink(28, "Klingeltöne, Graphiken, Logos auf deinem Handy","www.smart-sms.com","http://www.smart-sms.com/");
  toplinks[i++]=new toplink(29, "Studentenwerk: Mensa, Wohnen, BaföG etc.","www.uni-marburg.de/stw","http://www.uni-marburg.de/stw");
  toplinks[i++]=new toplink(30, "Der Chat der guten Laune","www.happychat.de","http://www.happychat.de/");
  toplinks[i++]=new toplink(31, "Absahnen im Internet","www.geldschatz.de","http://www.geldschatz.de/");
  toplinks[i++]=new toplink(32, "Digitale und analoge Programme frei empfangen?","www.sathack.de","http://www.sathack.de/");
  toplinks[i++]=new toplink(33, "Movie Reviews in a whole new light","www.checkthegrid.com","http://www.checkthegrid.com/");
  toplinks[i++]=new toplink(34, "Moorhuhn2,Cheats & Patches,Kostenlose Spiele","www.moorhuhn2.net","http://www.moorhuhn2.net/");
  toplinks[i++]=new toplink(35, "Auto-Reiseplaner","www.michelin-travel.com","http://www.michelin-travel.com/");
  toplinks[i++]=new toplink(36, "World of your links","www.oneview.de","http://www.oneview.de/");
  toplinks[i++]=new toplink(37, "Verbrauchermeinungen","www.ciao.de","http://www.ciao.de/");
  toplinks[i++]=new toplink(38, "Ebay Auktionshaus","www.ebay.de","http://www.ebay.de/");
  toplinks[i++]=new toplink(39, "Ihr Einkaufs-Page im Internet","www.vivendo.de","http://www.vivendo.de/");
  toplinks[i++]=new toplink(40, "Online Börsenmakler","www.schnigge.de","http://www.schnigge.de/");
  toplinks[i++]=new toplink(41, "Der ultimative Preisvergleich","www.preisauskunft.de","http://www.preisauskunft.de/");
  toplinks[i++]=new toplink(42, "Witze, kostenlos Spiele, SMS Sprüche, Handy Logos, Bilder, Psychotests...","www.witzig.at","http://www.witzig.at/");
  toplinks[i++]=new toplink(43, "Fragen und Antworten über alles","www.internet-foren.de","http://www.internet-foren.de/");
  toplinks[i++]=new toplink(44, "Könnt Ihr noch lachen? Wirtze über alles!","www.jokecompany.com","http://www.jokecompany.com/");
  toplinks[i++]=new toplink(45, "Wie heiß bist Du wirklich? Mach Dich zum Star!","www.amihotornot.de","http://www.amihotornot.de");
  toplinks[i++]=new toplink(46, "Animierte Gifs (Diddl), JavaScripte, Midi`s, OnlineGames...","www.pewenet.de","http://www.pewenet.de/");
  toplinks[i++]=new toplink(47, "Hier finden Sie genau 6182 Witze mit Niveau, alle sortiert und bewertet","www.lachdichtot.de","http://www.lachdichtot.de/");
  toplinks[i++]=new toplink(48, "Single-Stadt: Kontaktanzeigen, Chat etc.","www.single-city.de","http://www.single-city.de/");
  toplinks[i++]=new toplink(49, "Hardware vom Feinsten","www.avitos.de","http://www.avitos.de/");
}

function put_alllinks()
{ 
  if (!document.all && !document.layers && !document.getElementById) return;

  for (i=0; i<toplinks.length;i++)
  { document.write('<p><!--Woche '+toplinks[i].week+': -->');
    document.write('<a href="'+toplinks[i].href+'" target=_blank>');
    document.write(toplinks[i].intro+' bei '+toplinks[i].link+'</a></p>');
  }
}

function put_toplink()
{  

  if (!document.all && !document.layers && !document.getElementById) return;

  var date=new Date(); 
  var year=get4DigitYear(date);

  var firstofyear = new Date(year,0,1);
  var firstday=firstofyear.getDay();
  if (firstday!=0) firstofyear = new Date(year-1,11,32-firstday);

  var week=Math.floor((date.getTime()-firstofyear.getTime())/(1000*60*60*24*7));

  for (i=0;i<toplinks.length;i++) 
    if (week==toplinks[i].week) break;

  //alert(week);

  // if (i==toplinks.length) i=Math.round(Math.random() * toplinks.length);

  i=Math.round(Math.random() * toplinks.length);

  if (i>=toplinks.length) i=0;

  document.writeln('<font size="2">Unser Linktipp heute:');
  document.writeln(toplinks[i].intro);
  document.write('<br><a href="'+toplinks[i].href+'" target="_top">');
  document.write(toplinks[i].link+'</a>');
  document.write("</font>");

  if (document.all)
  { document.write("<br><font size=1><a href='bookmark.html' "+
    "onclick='window.external.AddFavorite(\""+toplinks[i].href+
    "\", \""+toplinks[i].link+"\");return false;'>"+
    "Bookmark!</a></font>");
  }

//  else document.write("<a href='bookmark.html' class='link'>Bookmark!</a>");

}
