function aniadeCero(valor){
	if(valor<10){
		valor = '0'+valor;
	}
	return valor;
}
function extraeFecha(integ,page2){
	var segundos = integ;
	var segRestan = aniadeCero(segundos%60);
	var minutos = (segundos-segRestan)/60;
	var minRestan = aniadeCero(minutos%60);
	var horas = (minutos-minRestan)/60;
	var horasRestan = aniadeCero(horas%24);
	var dias = (horas-horasRestan)/24;

	var fecha = document.getElementById('fecha');
    if ((dias == 0) && (horasRestan >= 1)){
	document.getElementById("online"+page2).innerHTML = '<strong class="tiempo">'+horasRestan+'h '+minRestan+'m '+segRestan+'s</strong>';
	} else {
	if ((dias == 0) && (horasRestan == 0) && (minRestan >= 1)){
		document.getElementById("online"+page2).innerHTML = '<strong class="tiempo">'+minRestan+'m '+segRestan+'s</strong>';	
	} else {
	if ((dias == 0) && (horasRestan == 0) && (minRestan == 0) && (segRestan)){
		document.getElementById("online"+page2).innerHTML = '<strong class="tiempo">'+segRestan+'s</strong>';	
	} else {
	document.getElementById("online"+page2).innerHTML = '<strong class="tiempo">'+dias+'d '+horasRestan+'h '+minRestan+'m '+segRestan+'s</strong>';
	}
	}
}
	segundos-=1;
	retardo(segundos,page2);
}
function retardo(integ,page2){
	setTimeout('extraeFecha("'+integ+'","'+page2+'")', 1000);
	//setTimeout(funcion, milisegundos)
}
function normal(obj)
{
obj.style.background='url(button.jpg)';
obj.style.cursor='arrow';
}
function cambio(obj)
{
obj.style.backgroundImage='url(button2.jpg)';
obj.style.cursor='pointer';
obj.style.cursor='hand';
}
function normal2(obj)
{
obj.style.background='url(button3.jpg)';
obj.style.cursor='arrow';
}
function cambio2(obj)
{
obj.style.backgroundImage='url(button4.jpg)';
obj.style.cursor='pointer';
obj.style.cursor='hand';
}
function normal5(obj)
{
obj.style.background='url(button5.jpg)';
obj.style.cursor='arrow';
}
function cambio5(obj)
{
obj.style.backgroundImage='url(button6.jpg)';
obj.style.cursor='pointer';
obj.style.cursor='hand';
}
function normal10(obj)
{
obj.style.background='url(button10.png)';
obj.style.cursor='arrow';
}
function cambio10(obj)
{
obj.style.backgroundImage='url(button11.png)';
obj.style.cursor='pointer';
obj.style.cursor='hand';
}
function normal11(obj)
{
obj.style.background='url(button12.png)';
obj.style.cursor='arrow';
}
function cambio11(obj)
{
obj.style.backgroundImage='url(button13.png)';
obj.style.cursor='pointer';
obj.style.cursor='hand';
}
function normal22(obj)
{
obj.style.background='url(button000.png)';
obj.style.cursor='arrow';
}
function cambio22(obj)
{
obj.style.backgroundImage='url(button001.png)';
obj.style.cursor='pointer';
obj.style.cursor='hand';
}
function preload() {
if (!document.images) return;
var ar = new Array();
var arguments = preload.arguments;
for (var i = 0; i < arguments.length; i++) {
ar[i] = new Image();
ar[i].src = arguments[i];
}
}
