var finalDate = new Date("June 10, 2011 07:00:00 PM"); //Summertime corrected

//var finalDate = new Date("May 15, 2011 2:40:00 PM");

var timerTimer = setInterval("getTimeUntillConcert()", 1000);

function getTimeUntillConcert(){
    var currentDate = new Date();
    
    utc = currentDate.getTime() + (currentDate.getTimezoneOffset() * 60000);
    
    currentDate = new Date(utc + (3600000 * -4));
    
    var diffDate = finalDate.getTime() - currentDate.getTime();
    
    if(diffDate > 0){
        var newDate = new Date(diffDate);
    
        $("days").innerHTML = Math.round(newDate.getTime() / (1000 * 60 * 60 * 24));
        $("hours").innerHTML = newDate.getHours();
        $("minutes").innerHTML = newDate.getMinutes();
        $("seconds").innerHTML = newDate.getSeconds();
    }
    else if(diffDate > -(1000 * 60 * 60 * 5)){
        //Het concert is bezig!
        $("subtime").innerHTML = "View the concert <a href='http://www.ustream.tv/user/girlswhorock' target='_blank' title='View the concert Live on U-Stream!'>Live</a> on <a href='http://www.ustream.tv/user/girlswhorock' target='_blank' title='View the concert Live on U-Stream!'>U-Stream</a>!";
        
        $("textOverlay").style.display = "none";
        $("raster").style.display = "none";
        $("left").style.display = "none";
        $("right").style.display = "none";        
        $("ustream").style.display = "inline-block";
        
        $("time").style.marginTop = "-405px";
        $("causevox").style.marginTop = "-405px";        
        $("eventbrite").style.marginTop = "-350px";
        
        $("logo").style.marginLeft = "-70px";
        $("time").style.display = "none";
        
    }
    else{
        //Het concert is voorbij!
        $("subtime").innerHTML = "Thank you for making GWR2011 a succes!";
        clearInterval(timerTimer);
    }
    
    
}

function $(elementId){
    return document.getElementById(elementId);
}

