function CurrencyPopup(QueryString,w,h) {
//	if (document.all) {
		if (window.CurrencyWindow1) {
			window.CurrencyWindow1.close();
		}
//	}
	CurrencyWindow1 = window.open ('', 'CurrencyWindow1', 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,width='+w+',height='+h);
	CurrencyWindow1.focus();
	CurrencyWindow1.location.href = 'pic.php?'+QueryString;
}

function stopBubble(e)
{
	if (e.stopPropagation) e.stopPropagation();
	else e.cancelBubble = true;
}
function stopDefault(e)
{
	if (e.preventDefault) e.preventDefault();
	else e.returnValue = false;
}
/* opens window and cancels the event if successfull */
function openAWin(path,width,height,ev,namewin) 
{
	if (!ev) ev = window.event;
	if (!ev) { alert("No event in openAWin"); return false; }
	if (!openWin(path,width,height,namewin)) return null;
	stopDefault(ev); stopBubble(ev);
	return false;
}

function openWin(path,width,height,namewin)
{
	if(window.anewWin)
		window.anewWin.close();
	if(!namewin) namewin = 'nove_okno';
    if(!width || !height) anewWin = window.open(path,namewin,'menubar=yes,toolbar=yes,location=yes,directories=yes,fullscreen=no,titlebar=yes,hotkeys=yes,status=yes,scrollbars=yes,resizable=yes');
	else anewWin = window.open(path,namewin,"width="+width+",height="+height+",toolbar=0,directories=0,menubar=0,status=0,scrollbars=yes,resizable=yes");
	return anewWin;
}


/* -- bubliny -- */
function getID(id,doc)
{
  if (!doc) doc = document;
  if (document.all) return doc.all[id];
  else return doc.getElementById(id);
}

function getPosition(e) {
  e = e || window.event;
  var cursor = {x:0, y:0};
  if (e.pageX || e.pageY) {
	cursor.x = e.pageX;
	cursor.y = e.pageY;
  } 
  else {
	var de = document.documentElement;
	var b = document.body;
	cursor.x = e.clientX + 
	  (de.scrollLeft || b.scrollLeft) - (de.clientLeft || 0);
	cursor.y = e.clientY + 
	  (de.scrollTop || b.scrollTop) - (de.clientTop || 0);
  }
  return cursor;
}

function move_position(evnt) {
  var bubl = getID('bubl');
  cursor = getPosition(evnt);
  cursor.x = cursor.x+5;
  cursor.y = cursor.y-25;
  
  bubl.style.left = cursor.x +'px';
  bubl.style.top = cursor.y + 'px';
  return true;
}

function visible_div(evnt,textik,move) {
	var bubl = getID('bubl');
	var p = "";
//	bubl.style.visibility="visible";
	bubl.style.display="block";
	if(!move) move_position(evnt);
	if(textik) bubl.innerHTML = textik;
}
function hidden_div() {
	var bubl = getID("bubl");
//	bubl.style.visibility="hidden";
	bubl.style.display="none";
}

/* -- /bubliny -- */
