
/*function dlgInputNumberExit(value, min_value, max_value)
{
 alert(parseInt(value));
 if (isNaN(value)) 
 {
   alert("Zadaná hodnota \"" + value + "\" není číslo");
   return false;
 }
 
 if (value < min_value || value > max_value)
 {
   alert("Zadaná hodnota \"" + value + "\" není v povoleném rozsahu " + min_value + '..' + max_value);
   return false;
 }
  
 return true; 
}
*/

function dlgModified(formName)
{ 
  formName.modified.value = 1;
}

function dlgTabClick(aLocation, aFormName)
{ 
  if (aFormName && aFormName.modified)
  {
    if (aFormName.modified.value != "1" || confirm("Ve formuláři byly provedeny změny, které nebyly uloženy. Přepnutím na jinou záložku o tyto změny přijdete. Přejete si pokračovat?"))
    {
      document.location=aLocation;
      return 1;
    }
  } else {    
    document.location=aLocation;
    return 1;
  }         
}

function dlgInputIntegerExit(value, min_value, max_value)
{ 
 if (isNaN(value)) 
 {
   alert("Zadaná hodnota \"" + value + "\" není číslo");
   return false;
 }
 
 if (parseInt(value) != value) 
 {
   alert("Zadaná hodnota \"" + value + "\" není celé číslo");
   return false;
 }

 if (min_value != 0.666 && value < min_value)
 {
   alert("Zadaná hodnota \"" + value + "\" je menší než minimální možná hodnota (" + min_value + ")");
   return false;
 }

 if (max_value != 0.666 && value > max_value)
 {
   alert("Zadaná hodnota \"" + value + "\" je větší než maximální možná hodnota (" + max_value + ")");
   return false;
 }
 
 return true; 
}


function dlgInputFloatExit(value, min_value, max_value)
{ 
 var xvalue = value.replace(",", ".");
 
 if (isNaN(xvalue)) 
 {
   alert("Zadaná hodnota \"" + value + "\" není číslo");
   return false;
 }
  
 if (min_value != 0.666 && xvalue < min_value)
 {
   alert("Zadaná hodnota \"" + value + "\" je menší než minimální možná hodnota (" + min_value + ")");
   return false;
 }

 if (max_value != 0.666 && xvalue > max_value)
 {
   alert("Zadaná hodnota \"" + value + "\" je větší než maximální možná hodnota (" + max_value + ")");
   return false;
 }
 
 return true; 
}

  function dateKeyUp(ctl)
  {
    if (ctl.value.length == 2 || ctl.value.length == 5) 
    { 
      if (ctl.value.charAt(ctl.value.length-1) != ".")
      { 
        ctl.value = ctl.value + ".";
      }
    }

    return(true);
    
  }
  
  function dateKeyPress(ctl)
  {   
/*    if (event.keyCode >= 48 && event.keyCode <= 58)
    {       
      if (ctl.value.length >= 10)
        return(false);         
      else     
        return(true);   
    }
    
    return(false);       */
    return (true);
  }

  function timeKeyUp(ctl)
  {
    if (ctl.value.length == 2) 
    { 
      if (ctl.value.charAt(ctl.value.length-1) != ":")
      { 
        ctl.value = ctl.value + ":";
      }
    }

    return(true);
    
  }
  
  function timeKeyPress(ctl)
  {   
    return (true);
  }

var centerIt = null;
var chasm = screen.availWidth;
var mount = screen.availHeight;
var w = 0;
var h = 0;

function openCenterWin(url,name,w,h) {
  centerIt = window.open(url,name,'toolbar=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=' + w + ',height=' + h + ',left=' + ((chasm - w - 10) * .5) +',top=' + ((mount - h - 30) * .5));
if (centerIt.focus) {centerIt.focus();}
}

function mouseLineOver(thisLine) {
  thisLine.style.backgroundColorOld = thisLine.style.backgroundColor;
  thisLine.style.colorOld = thisLine.style.color; 
  thisLine.style.backgroundColor='FF9999'; //F5F5F5
  thisLine.style.color='black'; 
}

function mouseLineOut(thisLine) {
  thisLine.style.backgroundColor = thisLine.style.backgroundColorOld;
  thisLine.style.color = thisLine.style.colorOld; 
}


$(document).ready(function() {
	$("#category tr")
		.mouseover(function() {
			$(this).addClass("over");
		})
		.mouseout(function() {
			$(this).removeClass("over");
		});
});