$(document).ready(function(){
	
	$(".delPromt").click(function()
	{    
		$.prompt('<b>Skutečně chcete smazat akci?</b> nevratná operace',{ buttons: { 'ANO': $(this).attr("rel"), 'NE': false }, callback: mycallbackfunc });
	});
	
	  
})

 function mycallbackfunc(v,m,f)
 {
	if(v != false)
	{
		var url = window.location.href;
	    url = url.split("?");
		window.location.replace(url[0]+"?action=delete&actionID="+v); 
	}	
		
		  
 }

//
// swapDisplay()
// objektĹŻm pĹ™edanĂ˝m parametry pĹ™ehodĂ­ display
//
function swapDisplay() {
 values = ['none','table-row-group']
 for ( var i = 0; i < arguments.length; i++ ) {
  el = getObject(arguments[i]);
  if ( el ) {
   elStyle = getStyle(el,'display');
   if ( elStyle) {
    if ( elStyle == values[0] ) {
     el.style.display = values[1];
    }
    else if (elStyle == values[1]) {
     el.style.display = values[0];
    }
   }
  }
 }
}
//
// getObject(param)
//
function getObject(param) {
 var rtrn = false;
 if ( typeof(param) == 'object' ) {
  rtrn = param;
 }
 else if ( typeof(param) == 'string' ) {
  if ( document.getElementById(param) ) {
   rtrn = document.getElementById(param);
  }
  else if ( document.getElementsByTagName(param)[0] ) {
   rtrn = document.getElementsByTagName(param)[0];
  }
 }
 return rtrn
}
//
// getStyle(oElm, strCssRule)
// by Robert Nyman
// http://www.robertnyman.com/2006/04/24/get-the-rendered-style-of-an-element/
//
function getStyle(oElm, strCssRule){
 var strValue = "";
 if(document.defaultView && document.defaultView.getComputedStyle){
  strValue = document.defaultView.getComputedStyle(oElm, "").getPropertyValue(strCssRule);
 }
 else if(oElm.currentStyle){
  strCssRule = strCssRule.replace(/-(w)/g, function (strMatch, p1){
   return p1.toUpperCase();
  });
  strValue = oElm.currentStyle[strCssRule];
 }
 return strValue;
}

