var timerID = null;

var timerRunning = false;

function showtime () 
{
       
		var now = new Date();
        var hours = now.getHours();
        var minutes = now.getMinutes();
        var seconds = now.getSeconds();
        var dia = now.getDate();
        var mes = now.getMonth()+1;
        var anyo = now.getYear();

		if (anyo < 1000)
			anyo+=1900;
		if (dia<10)
			dia="0"+dia;
		if (mes == 1)
			mes = "Enero"
		else if (mes == 2)
			mes = "Febrero"
		else if (mes == 3)
			mes = "Marzo"
		else if (mes == 4)
			mes = "Abril"
		else if (mes == 5)
			mes = "Mayo"
		else if (mes == 6)
			mes = "Junio"
		else if (mes == 7)
			mes = "Julio"
		else if (mes == 8)
			mes = "Agosto"
		else if (mes == 9)
			mes = "Septiembre"
		else if (mes == 10)
			mes = "Octubre"
		else if (mes == 11)
			mes = "Noviembre"
		else if (mes == 12)
			mes = "Diciembre"


        var timeValue = "" + ((hours >12) ? hours -0 :hours)
        timeValue += ((minutes < 10) ? ":0" : ":") + minutes
        timeValue += ((seconds < 10) ? ":0" : ":") + seconds

        timeValue += (hours >= 12) ? " pm" : " am"
		
		face.value = "Alicante, " + dia + " de " + mes + " de " + anyo + " " + timeValue;
        // you could replace the above with this
        // and have a clock on the status bar:
        // window.status = timeValue;

        timerID = setTimeout("showtime()",1000);
        timerRunning = true;
}

function stopclock ()
{
        
		if(timerRunning)
                clearTimeout(timerID);
		timerRunning = false;
}

function startclock () 
{
        // Make sure the clock is stopped
//        alert("holq");
		stopclock();
        showtime();
}