function OpenWin(url,name,width,height,screenx,screeny,p1,p2,p3,p4,p5,p6,p7)
{
  var wf = "";	
 	wf = wf + "width=" + width;
	wf = wf + ",height=" + height;
 	wf = wf + ",screenx=" + screenx;
 	wf = wf + ",screeny=" + screeny;
 	wf = wf + ",resizable=" + (p1 ? "yes" : "no");
 	wf = wf + ",scrollbars=" + (p2 ? "yes" : "no");
 	wf = wf + ",menubar=" + (p3 ? "yes" : "no");
 	wf = wf + ",toolbar=" + (p4 ? "yes" : "no");
 	wf = wf + ",directories=" + (p5 ? "yes" : "no");
 	wf = wf + ",location=" + (p6 ? "yes" : "no");
 	wf = wf + ",status=" + (p7 ? "yes" : "no");		
  return window.open(url,name,wf);

}
// -----------------------------------------------------------------------------------
function OpenCenterWin(url,name,width,height,p1,p2,p3,p4,p5,p6,p7)
{
  var mwin;

  var centerx = (screen.width/2)-(width/2);
  var centery = (screen.height/2)-(height/2);

  if (width > screen.width-10) { width = screen.width-10; p2 = 1; centerx = 0; }
  if (height > screen.height-50) { height = screen.height-50; p2 = 1; centery = 0; }

  mwin = OpenWin(url,name,width,height,centerx,centery,p1,p2,p3,p4,p5,p6,p7);
  mwin.moveTo(centerx,centery);
  
  return mwin;
}
// -----------------------------------------------------------------------------------
function OpenCenterWinNoRet(url,name,width,height,p1,p2,p3,p4,p5,p6,p7)
{
  OpenCenterWin(url,name,width,height,p1,p2,p3,p4,p5,p6,p7);
}

function confirmDel() {
	return confirm('Opravdu smazat záznam?')
}

function confirmDelNode() {
	return confirm('POZOR! Položka bude smazána i se všemi podkategoriemi. Opravdu chcete položku smazat?')
}


function flipRulesButton() {
	var status;
	status = frm_rules.submit.disabled;
	frm_rules.submit.disabled = !status;
}

