function povprasevanje(){
	var winl = (screen.width - 550) / 2;
	var wint = (screen.height - 600) / 2;
	winprops='toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=550,height=600,top='+wint+'left='+winl;
	var win = window.open('../inc/povprasevanje.php', 'povprasevanje', winprops);
	win.focus();		
}

function prijavnica(id){
	var winl = (screen.width - 450) / 2;
	var wint = (screen.height - 600) / 2;
	winprops='toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=450,height=600,top='+wint+'left='+winl;
	var win = window.open('../inc/prijavnica.php?id='+id, 'prijavnica', winprops);
	win.focus();		
}

function posTop(o) {
	var nTop = o.offsetTop;
	if(o.tagName != "BODY") nTop += posTop(o.offsetParent);
    return nTop;
}

function posLeft(o){
    var nLeft = o.offsetLeft;
    if (o.tagName != "BODY")
        nLeft += posLeft(o.offsetParent);
    return nLeft;
}

var active = null;
var to_id=-1;
var timeout=50;
var odprt=0;

function nro(oTd){
  odprt=1;
  oTd.style.color="#003366";
  oTd.style.backgroundColor="#ffffff";
}

function nrout(oTd){
  odprt=0;
  oTd.style.color="#ffffff";
  oTd.style.backgroundColor="#003366";
}

function getPos(){
  if (document.all)return document.body.scrollTop;
  else return window.pageYOffset;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function hide(){
  if(odprt){
   if(to_id != -1) window.clearTimeout(to_id);
   to_id = window.setTimeout("hide()",timeout);
   return;
  }

  if(active && active.style){
	active.style.visibility="hidden";     	
  } 	
}

function hidemenu(elmnt){
  odprt=0;
  var obj=MM_findObj(elmnt);
  if(obj)active=obj; 
  if(to_id != -1) window.clearTimeout(to_id);
  to_id = window.setTimeout("hide()",timeout);
}

function hidemenu_now(obj){
 odprt=0;
 if(obj && obj.style) obj.style.visibility='hidden';
}

function showmenu(elmnt,_parent_obj){
	if(active){
	 hidemenu_now(active);
	}
	
	var obj=MM_findObj(elmnt);
	var parent_obj=_parent_obj;//MM_findObj(_parent_obj);
	if(obj){
		active=obj;
		cX=posLeft(parent_obj);	
		cY=posTop(parent_obj); 
		obj.style.top=(cY+31)+'px';
		obj.style.left=cX+'px';	
		if(obj && obj.style) obj.style.visibility='visible';
		odprt=1;
	}
}





