
// Here’s where the Javascript starts
countdown = 1755168;

// Converting date difference from seconds to actual time
function convert_to_time(secs)
{
	secs = parseInt(secs)
	hh = secs / 3600;	
	hh = parseInt(hh);	
	mmt = secs - (hh * 3600);	
	mm = mmt / 60;	
	mm = parseInt(mm);	
	ss = mmt - (mm * 60);	
	ms = secs * 1000;
	
	hour = " hours";
		
	if (hh > 23)	
	{	
	   dd = hh / 24;	
	   dd = parseInt(dd);	
	   hh = hh - (dd * 24);	
	} else { dd = 0; }	
		
	if (ss < 10) { ss = "0"+ss; }	
	if (mm < 10) { mm = "0"+mm; }	
	if (hh < 10) { hh = ""+hh; }
	if (hh == 1) { hour = " hour"; }
	if (dd == 0) 
	{ 
		if (hh == 0)
		return ("<a href='theater.php' style='text-decoration:none;font-size:10px;color:#000;outline:none;'>"+mm+":"+ss+" min"+"</a>");
		else
		return ("<a href='theater.php' style='text-decoration:none;font-size:10px;color:#000;outline:none;'>"+hh+hour+", "+mm+":"+ss+" min"+"</a>");
	}	
	else 
	{	
		if (dd > 1) { return ("<a href='theater.php' style='text-decoration:none;font-size:10px;color:#000;outline:none;'>"+dd+" days, "+hh+hour+", "+mm+":"+ss+" min"+"</a>"); }
		else { return ("<a href='theater.php' style='text-decoration:none;font-size:10px;color:#000;outline:none;'>"+dd+" day, "+hh+hour+", "+mm+":"+ss+" min"+"</a>"); }
	}	
}

// Our function that will do the actual countdown
function do_cd()
{
	if (countdown < 0)	
	{ 	
		
				// change text
		document.getElementById('cd').innerHTML = "WAWASAN 2020";
		
	}	
	else	
	{	
		document.getElementById('cd').innerHTML = convert_to_time(countdown);
		setTimeout('do_cd()', 1000);
	}	
	countdown = countdown - 1;	
}
document.write("<div id='cd' ></div>\n");
do_cd();
