pic1 = new Image(32, 32); 
pic1.src = "http://www.hlasovani.net/graph/thumbdownon.gif"; 
pic2 = new Image(32, 32); 
pic2.src = "http://www.hlasovani.net/graph/thumbupon.gif"; 


function textCounter(field,maxlimit)
{

	if (field.value.length > maxlimit)
		field.value = field.value.substring(0, maxlimit);
	else
		document.getElementById('remLen').innerHTML = maxlimit - field.value.length;
}


function thumbUpOn(obj)
{
    obj.src="http://www.hlasovani.net/graph/thumbupon.gif";
}

function thumbUpOff(obj)
{
	obj.src="http://www.hlasovani.net/graph/thumbup.gif";
}


function thumbDownOn(obj)
{
    obj.src="http://www.hlasovani.net/graph/thumbdownon.gif";
}

function thumbDownOff(obj)
{
    obj.src="http://www.hlasovani.net/graph/thumbdown.gif";
}

function getObj(id)
{
    return document.getElementById(id);
}


function bar(url)
{
    wasOpen  = false;
    win = window.open(url);    
    return (typeof(win)=='object')?true:false;
}

var anmobj = new Array();
var anmobj_count = 0;

var animstep = 0;
var op = 0.0;
var vec = 1;


function addImageBlending(obj, st1, st2, blstep)
{
	anmobj[anmobj_count] = new Object();
	anmobj[anmobj_count].htmlobj = obj;
	anmobj[anmobj_count].staytime1 = st1;
	anmobj[anmobj_count].staytime2 = st2;
	anmobj[anmobj_count].blendstep = blstep;
	anmobj[anmobj_count].counter = 0;
	anmobj[anmobj_count].opacity = 0;

	//docobj = document.getElementById(obj);
	//var op = docobj.opacity;
	//docobj.style.opacity = op;
	//docobj.style.filter="alpha(opacity="+(op*100)+")";

	anmobj_count++;
}


function animate()
{
	for (var i=0; i<anmobj_count; i++)
	{
		obj = document.getElementById(anmobj[i].htmlobj);
		var op = anmobj[i].opacity;
		obj.style.opacity = op;
		obj.style.filter="alpha(opacity="+(op*100)+")";

		anmobj[i].counter++;
		if (anmobj[i].counter >= anmobj[i].staytime1 && anmobj[i].counter < anmobj[i].staytime1+(1.0/anmobj[i].blendstep))
		{
			anmobj[i].opacity+=anmobj[i].blendstep;
			if (anmobj[i].opacity > 1.0)
				anmobj[i].opacity = 1.0;
		}

		if (anmobj[i].counter >= anmobj[i].staytime1+anmobj[i].staytime2+(1.0/anmobj[i].blendstep))
		{
			anmobj[i].opacity-=anmobj[i].blendstep;
			if (anmobj[i].opacity < 0.0)
				anmobj[i].opacity = 0.0;
		}

		if (anmobj[i].counter >= (anmobj[i].staytime1+(1.0/anmobj[i].blendstep)+anmobj[i].staytime2) && anmobj[i].opacity==0.0)
		{
			anmobj[i].counter = 0;
		}
	}

	setTimeout("animate()", 50);
}
