var image_path = "/ntujudge/problemdata/";

function image(filename) {
    document.write("<img src='" + image_path + filename + "'>");
}


function displayAnn(ann) {
	var now = new Date();
	for(var i=0; i<ann.length; i++) {
		var r = ann[i];
		var start = new Date(r[0]), end = new Date(r[1]);
		if(now < start || now > end) document.getElementById(r[2]).style.display = "none";
	}
}

//set time counter: special thanks to DarkKnight

function timer(){
		if(--s<0)s+=60,m--;
		if(m<0)m+=60,h--;
		if(h<0)location.reload();
        if(timer0!=undefined){
		if(h==0)
		{
			font0 = document.getElementById('font0');
			font0.color = "red";
		}
        timer0.innerHTML=''+h+':'+(m<10?'0':'')+m+':'+(s<10?'0':'')+s;
	}
	setTimeout('timer();',1000);
}
