
var auctionclosed="N"
/***********************************************
* Dynamic Countdown script- © Dynamic Drive (http://www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/
function currtime(container, currentTime)
{
	this.container=document.getElementById(container)
	this.currentTime=new Date(currentTime)
	this.currentDate=currentTime
	//this.targetdate=new Date(targetdate)
	this.timesup=false
	this.updateTime()
	this.highBid=0
}

currtime.prototype.updateTime=function()
{
	var thisobj=this
	this.currentTime.setSeconds(this.currentTime.getSeconds()+1)
	setTimeout(function(){thisobj.updateTime()}, 1000) //update time every second
}

currtime.prototype.displaycountdown=function(functionref)
{
	this.formatresults1=functionref
	this.showresults()
}

currtime.prototype.showresults=function()
{
	var thisobj=this
	this.container.innerHTML=this.formatresults1(this.currentTime)

	setTimeout(function(){thisobj.showresults()}, 1000) //update results every second
}

/////CUSTOM FORMAT OUTPUT FUNCTIONS BELOW//////////////////////////////

//Create your own custom format function to pass into cdtime.displaycountdown()
//Use arguments[0] to access "Days" left
//Use arguments[1] to access "Hours" left
//Use arguments[2] to access "Minutes" left
//Use arguments[3] to access "Seconds" left

//The values of these arguments may change depending on the "baseunit" parameter of cdtime.displaycountdown()
//For example, if "baseunit" is set to "hours", arguments[0] becomes meaningless and contains "n/a"
//For example, if "baseunit" is set to "minutes", arguments[0] and arguments[1] become meaningless etc

function formatresults()
{
}

function formatresults1()
{
	var m_names = new Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");
	var mins=arguments[0].getMinutes() + "";
	var hrs=arguments[0].getHours()+"";
	var secs=arguments[0].getSeconds()+"";

	if(hrs.length==1)
		var hrs="0"+hrs;

	if(mins.length==1)
		var mins="0"+mins;

	if(secs.length==1)	
		var secs="0"+secs;

	var displaystring=m_names[arguments[0].getMonth()] + " " + arguments[0].getDate() + ", " + arguments[0].getFullYear() + " " + hrs + ":" + mins + ":" + secs + " HKT"	
	return displaystring
}

