function f_lupa_hide(lupa_div) {
	//alert('a');
	//ready=true;
	obrdiv=document.getElementById(lupa_div);
	obrdiv.style.display='none';
}


function f_lupa(id_from, to_show) {
		obj=document.getElementById(id_from);
		obr=document.getElementById('lupa_img');
		obrdiv=document.getElementById(to_show);
		posx=najdiX(obj);
		posy=najdiY(obj);

		obrdiv.style.left=(posx+50)+'px';
		obrdiv.style.left='600px';
		obrdiv.style.top=(posy-50)+'px';
		obrdiv.style.display='block';
}

function najdiX(obj)
{
	var curleft = 0;
	if(obj.offsetParent)
	while(1) 
	{
		curleft += obj.offsetLeft;
		if(!obj.offsetParent)
		break;
		obj = obj.offsetParent;
	}
	else if(obj.x)
	curleft += obj.x;
	return curleft;
}

function najdiY(obj)
{
	var curtop = 0;
	if(obj.offsetParent)
	while(1)
	{
		curtop += obj.offsetTop;
		if(!obj.offsetParent)
		break;
		obj = obj.offsetParent;
	}
	else if(obj.y)
	curtop += obj.y;
	return curtop;
}
