﻿var c=0.7
var alpha=70
var t

function startCount(ferda)
{
stopCount();
c=0.7;
alpha=70;
document.getElementById(ferda).style.background = '#000';;
document.getElementById(ferda).style.display = 'block';
timedCount(ferda);
}

function mouseDown(ferda)
{
    dd = document.getElementById(ferda); 
    dd.style.display = 'block';
    document.getElementById(ferda).style.filter="alpha(opacity=" + 0 + ");"; 
    document.getElementById(ferda).style.opacity = 0;
    document.getElementById(ferda).style.background = '#000';;
    c=0.7;
    alpha=70;
}

function timedCount(ferda)
{

document.getElementById(ferda).style.filter="alpha(opacity=" + alpha + ");"; 
document.getElementById(ferda).style.opacity = c;

metoda = "timedCount('" + ferda + "')";
c=c-0.02;
alpha=alpha-2;
if(c > 0)
{
    t=setTimeout(metoda,2);
}
else
{
    c=0.7;
    alpha=70;
    /*document.getElementById(ferda).style.filter="alpha(opacity=" + 5 + ");"; 
    document.getElementById(ferda).style.opacity = 0.05;*/
    document.getElementById(ferda).style.display = 'block';
    document.getElementById(ferda).style.background = '#000';
    document.getElementById(ferda).style.border = '1px solid black';
}
}

function stopCount()
{
clearTimeout(t);
}
