function getID(id,doc)
{
	if (!doc) doc = document;
	if (document.all) return doc.all[id];
	else return doc.getElementById(id);
}
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;
}

/* opens full window and cancels the event if successfull*/
function openAWinF(path,width,height,ev,namewin) 
{
	if (!ev) ev = window.event;
	if (!ev) { alert("No event in openAWin"); return false; }
	if (!openWinF(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';
	anewWin = window.open(path,namewin,"width="+width+",height="+height+",toolbar=0,directories=0,menubar=0,status=0,scrollbars=yes,resizable=yes");
	return anewWin;
}

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

function openPage(url,w,h)
{
//    window.open(url, '','status=no,,width='+w+',height='+h+',resizable=yes,menubar=no,scrollbars=yes,toolbar=no');
	open (url, '', 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width='+w+',height='+h);
	return true;
}
