var current_page = document.location.href;
var oneClick=false;
function checkClick()
{
	if(oneClick)
	{
		return false;
	}
	else
	{
		oneClick=true;
		return true;
	}
}

function advancedDate(timestamp, short) {
    if (short === undefined) {
    	short = false;
    }
    
    var date = new Date();

    // Get date 
    var todayDateTs = Date.parse(date.toDateString());
    var yesterdayDateTs = todayDateTs - 24 * 60 * 60 * 1000;

    // Given time in seconds
    date.setTime(timestamp * 1000);
    
    // Given date in Local, Timestamp
    var givenDateTs = Date.parse(date.toDateString());
    
    if (givenDateTs == todayDateTs) {
	// Today, show date only
    } else if (givenDateTs == yesterdayDateTs) {
    	document.write("Hier, ");
    } else {
    	var givenDate = new Date();
    	givenDate.setTime(givenDateTs);
    	
    	var day = givenDate.getDate();
    	var month = givenDate.getMonth() + 1;
    	
    	if (day < 10) {
    		day = "0" + day;
    	}
    	if (month < 10) {
    		month = "0" + month;
    	}
    	document.write(day + "/" + month + " ");

		if (short) {
		    return;
		}
    }

    document.write(date.toTimeString().substring(0, 5));
}
