
function select(arg) {
    //$('lineup').observe('mouseover',function() {
      //  expand();
    //});
   // $('lineup').observe('mouseleave',function() {
     //   setTimeout('shut()',500);
    //});
    //if (arg == 'pertness' || arg == 'emerald' || arg == 'remotelane' || arg == 'punish' || arg == 'thybleedingskies' || arg == 'nihilo' || arg == 'confector' || arg == 'mortalhatred' || arg == 'timesword')
      //arg = 'lineup';
    if (arg != 'home')
      document.getElementById(arg).style.borderBottom = '#100909 1px solid';
}
/*
function expand() {
    new Effect.Morph('lineup',{style: 'height: 230px; top: -216px;', transition: Effect.Transitions.spring}); //duration: 0.8,
    new Effect.Morph('b',{style: 'top: -216px;', transition: Effect.Transitions.spring}); // duration: 0.8,
    new Effect.Morph('c',{style: 'top: -216px;', transition: Effect.Transitions.spring}); // duration 0.8,
    
    var h = document.getElementById('lineup');
    var c = document.getElementById('c');
    var b = document.getElementById('b');
    if (!h.style.top) h.style.top = '0px';
    if (parseInt(h.style.height) == 14) {
        h.style.top = (parseInt(h.style.top) - 72) + 'px';
        c.style.top = (parseInt(c.style.top) - 72) + 'px';
        b.style.top = (parseInt(b.style.top) - 72) + 'px';
        h.style.height = (parseInt(h.style.height) + 72) + 'px';
        setTimeout('expand()',50);
    } else if (parseInt(h.style.height) == 86) {
        h.style.top = (parseInt(h.style.top) - 10) + 'px';
        c.style.top = (parseInt(c.style.top) - 10) + 'px';
        b.style.top = (parseInt(b.style.top) - 10) + 'px';
        h.style.height = (parseInt(h.style.height) + 10) + 'px';
        setTimeout('expand()',50);
    } else if (parseInt(h.style.height) == 96) {
        h.style.top = (parseInt(h.style.top) - 7) + 'px';
        c.style.top = (parseInt(c.style.top) - 7) + 'px';
        b.style.top = (parseInt(b.style.top) - 7) + 'px';
        h.style.height = (parseInt(h.style.height) + 7) + 'px';
        setTimeout('expand()',50);
    } else if (parseInt(h.style.height) == 103) {
        h.style.top = (parseInt(h.style.top) - 6) + 'px';
        c.style.top = (parseInt(c.style.top) - 6) + 'px';
        b.style.top = (parseInt(b.style.top) - 6) + 'px';
        h.style.height = (parseInt(h.style.height) + 6) + 'px';
        setTimeout('expand()',50);
    } else if (parseInt(h.style.height) == 109) {
        h.style.top = (parseInt(h.style.top) - 5) + 'px';
        c.style.top = (parseInt(c.style.top) - 5) + 'px';
        b.style.top = (parseInt(b.style.top) - 5) + 'px';
        h.style.height = (parseInt(h.style.height) + 5) + 'px';
        setTimeout('expand()',50);
    } else if (parseInt(h.style.height) == 114) {
        h.style.top = (parseInt(h.style.top) - 4) + 'px';
        c.style.top = (parseInt(c.style.top) - 4) + 'px';
        b.style.top = (parseInt(b.style.top) - 4) + 'px';
        h.style.height = (parseInt(h.style.height) + 4) + 'px';
        setTimeout('expand()',50);
    } else if (parseInt(h.style.height) == 118) {
        h.style.top = (parseInt(h.style.top) - 3) + 'px';
        c.style.top = (parseInt(c.style.top) - 3) + 'px';
        b.style.top = (parseInt(b.style.top) - 3) + 'px';
        h.style.height = (parseInt(h.style.height) + 3) + 'px';
        setTimeout('expand()',50);
    } else if (parseInt(h.style.height) == 121) {
        h.style.top = (parseInt(h.style.top) - 2) + 'px';
        c.style.top = (parseInt(c.style.top) - 2) + 'px';
        b.style.top = (parseInt(b.style.top) - 2) + 'px';
        h.style.height = (parseInt(h.style.height) + 2) + 'px';
        setTimeout('expand()',50);
    } else if (parseInt(h.style.height) == 123) {
        h.style.top = (parseInt(h.style.top) - 1) + 'px';
        c.style.top = (parseInt(c.style.top) - 1) + 'px';
        b.style.top = (parseInt(b.style.top) - 1) + 'px';
        h.style.height = (parseInt(h.style.height) + 1) + 'px';
    }
}

function shut(e) {
    new Effect.Morph('lineup',{style: 'height: 14px; top: 0px;', transition: Effect.Transitions.spring}); // duration 0.8,
    new Effect.Morph('b',{style: 'top: 0px;', transition: Effect.Transitions.spring}); // duration 0.8,
    new Effect.Morph('c',{style: 'top: 0px;', transition: Effect.Transitions.spring}); // duration 0.8,
    var h = document.getElementById('lineup');
    var c = document.getElementById('c');    
    var b = document.getElementById('b');
    if (parseInt(h.style.height) == 124) {
        h.style.top = (parseInt(h.style.top) + 72) + 'px';
        c.style.top = (parseInt(c.style.top) + 72) + 'px';  
        b.style.top = (parseInt(b.style.top) + 72) + 'px';       
        h.style.height = (parseInt(h.style.height) - 72) + 'px';
        setTimeout('shut()',60);
    } else if (parseInt(h.style.height) == 52) {
        h.style.top = (parseInt(h.style.top) + 10) + 'px';
        c.style.top = (parseInt(c.style.top) + 10) + 'px';
        b.style.top = (parseInt(b.style.top) + 10) + 'px'; 
        h.style.height = (parseInt(h.style.height) - 10) + 'px';
        setTimeout('shut()',60);
    } else if (parseInt(h.style.height) == 42) {
        h.style.top = (parseInt(h.style.top) + 7) + 'px';
        c.style.top = (parseInt(c.style.top) + 7) + 'px';
        b.style.top = (parseInt(b.style.top) + 7) + 'px'; 
        h.style.height = (parseInt(h.style.height) - 7) + 'px';
        setTimeout('shut()',60);
    } else if (parseInt(h.style.height) == 35) {
        h.style.top = (parseInt(h.style.top) + 6) + 'px';
        c.style.top = (parseInt(c.style.top) + 6) + 'px';
        b.style.top = (parseInt(b.style.top) + 6) + 'px';
        h.style.height = (parseInt(h.style.height) - 6) + 'px';
        setTimeout('shut()',60);
    } else if (parseInt(h.style.height) == 29) {
        h.style.top = (parseInt(h.style.top) + 5) + 'px';
        c.style.top = (parseInt(c.style.top) + 5) + 'px';
        b.style.top = (parseInt(b.style.top) + 5) + 'px';
        h.style.height = (parseInt(h.style.height) - 5) + 'px';
        setTimeout('shut()',60);
    } else if (parseInt(h.style.height) == 24) {
        h.style.top = (parseInt(h.style.top) + 4) + 'px';
        c.style.top = (parseInt(c.style.top) + 4) + 'px';
        b.style.top = (parseInt(b.style.top) + 4) + 'px';
        h.style.height = (parseInt(h.style.height) - 4) + 'px';
        setTimeout('shut()',60);
    } else if (parseInt(h.style.height) == 20) {
        h.style.top = (parseInt(h.style.top) + 3) + 'px';
        c.style.top = (parseInt(c.style.top) + 3) + 'px';
        b.style.top = (parseInt(b.style.top) + 3) + 'px';
        h.style.height = (parseInt(h.style.height) - 3) + 'px';
        setTimeout('shut()',60);
    } else if (parseInt(h.style.height) == 17) {
        h.style.top = (parseInt(h.style.top) + 2) + 'px';
        c.style.top = (parseInt(c.style.top) + 2) + 'px';
        b.style.top = (parseInt(b.style.top) + 2) + 'px';
        h.style.height = (parseInt(h.style.height) - 2) + 'px';
        setTimeout('shut()',60);
    } else if (parseInt(h.style.height) == 15) {
        h.style.top = (parseInt(h.style.top) + 1) + 'px';
        c.style.top = (parseInt(c.style.top) + 1) + 'px';
        b.style.top = (parseInt(b.style.top) + 1) + 'px';
        h.style.height = (parseInt(h.style.height) - 1) + 'px';
    }
}

*/

/*
function nshut(aktuell) {
  var h = document.getElementById('lineup');
  var c = document.getElementById('c');    
  var b = document.getElementById('b');
  var ziel = 14;
  if (!aktuell)
    aktuell = parseInt(h.style.height);
  var diff = aktuell - ziel;
  if (diff != 0) {
    h.style.top = (parseInt(h.style.top) + Math.ceil(diff/3)) + 'px';
    c.style.top = (parseInt(c.style.top) + Math.ceil(diff/3)) + 'px';
    b.style.top = (parseInt(b.style.top) + Math.ceil(diff/3)) + 'px';
    h.style.height = (parseInt(h.style.height) - Math.ceil(diff/3)) + 'px';
    setTimeout('nshut(' + parseInt(h.style.height) + ')',60);
  }
}

function nexpand(aktuell) {
  var h = document.getElementById('lineup');
  var c = document.getElementById('c');    
  var b = document.getElementById('b');
  var ziel = 200;
  if (!aktuell)
    aktuell = parseInt(h.style.height);
  var diff = ziel - aktuell;
  if (diff != 0) {
    h.style.top = (parseInt(h.style.top) - Math.ceil(diff/3)) + 'px';
    c.style.top = (parseInt(c.style.top) - Math.ceil(diff/3)) + 'px';
    b.style.top = (parseInt(b.style.top) - Math.ceil(diff/3)) + 'px';
    h.style.height = (parseInt(h.style.height) + Math.ceil(diff/3)) + 'px';
    setTimeout('nexpand(' + parseInt(h.style.height) + ')',60);
  }
}

function load(id) {
    var h = $(id);
    if (parseInt(h.style.top) < 14) {
        h.style.top = (parseInt(h.style.top) + 5) + 'px';
        setTimeout('shut()',1);
    }
    
}*/

function countdown(time) {
    var isphere = 1311955200;
    var diff = (isphere - time) - 60*60*24;
    var mins = diff / 60;
    var days = (diff / (60*60*24));
    if (days > 1) {
      var rounded = Math.round(days * 100000) / 100000;
      var txt = ' Mal schlafen';
    } else {
      var rounded = Math.round(mins * 100) / 100;;
      var txt = ' Minuten';
    } 
    document.getElementById('days_rounded').innerHTML = rounded + txt;
    setTimeout('countdown(' + (time + 1) + ')',1000);
}

function login(ref) {
    window.location = 'http://immortalsphere.ch/index.php?content=' + ref + '|login';
}

function logout(ref) {
    window.location = 'http://immortalsphere.ch/index.php?content=' + ref + '|logout';
}
