var patH;
function path(put){
patH=put;
return patH;
}



// Get the left and the top of the element.
function ds_getleft(el) {
	var tmp = el.offsetLeft;
	el = el.offsetParent
	while(el) {
		tmp += el.offsetLeft;
		el = el.offsetParent;
	}
	return tmp;
}
function ds_gettop(el) {
	var tmp = el.offsetTop;
	el = el.offsetParent
	while(el) {
		tmp += el.offsetTop;
		el = el.offsetParent;
	}
	return tmp;
}

var element;
function ds(t,stolica) {

if(stolica=="mix")
document.getElementById("resultt").style.display="none";
else
{
document.getElementById("resultt").style.display="block";
document.getElementById("resultt").innerHTML=stolica;

		the_left = ds_getleft(t);
	the_top = ds_gettop(t) + t.offsetHeight;


	element=document.getElementById("resultt")
	element.style.top=the_top-130 + 'px';
	element.style.left=the_left+100 + 'px';
	return false;
	}
	}
function lol(path,width,height,id)
{
var path;
var xPos;
var yPos;

xPos = (window.screen.width/2) - (width/2 + 10);
yPos = (window.screen.height/2) - (height/2 + 50);
var win2 = window.open(path+"/barve.php?id="+id+"","Window2","status=no,height="+height+",width="+width+",resizable=yes,left=" + xPos + ",top=" + yPos + ",screenX=" + xPos + ",screenY=" + yPos + ",toolbar=no,menubar=no,scrollbars=yes,location=no,directories=no");
win2.focus();
}




////////korpa/////////
var nek;
function displaySubs(a,b,c,d,path){
nek=d;

    var url=path+"/korpa_add.php?a="+a+"&b="+b+"&c="+c+"&d="+d;
   
    if (window.XMLHttpRequest) {
        xmlHttp = new XMLHttpRequest();// Mozilla/Safari
    }else if (window.ActiveXObject) {
        xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");// IE
    }

    xmlHttp.onreadystatechange=AJAXresponse;
    xmlHttp.open("GET",url,true);
    xmlHttp.send(null)
}

function AJAXresponse(){
 
    if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){
   document.getElementById("result").innerHTML=xmlHttp.responseText;
 

}
    else{
        document.getElementById("result").innerHTML = 'Nalagam...';
    }
}

///////end korpa//////

function tt(a,b,c,d,f)
{
alert(d)
}
////////////////
