function checkUncheckAll(theElement,ElementName) 
{
  var theform = theElement.form, z = 0;
  for(z=0; z<theform.length; z++)
  {
      if(theform[z].type == 'checkbox' && theform[z].name != 'checkall' && theform[z].name.match(ElementName))
	  {
   		theform[z].checked = theElement.checked;
	  }
  }
}

function deleteConfirm(text)
{
   return confirm(text);
} 
	
function patvirtinti(text, linkas, linkas1)
{
   var result = confirm(text);
   if (result == true)
   {
     document.location = linkas;
   }

   else
   {
     document.location = linkas1;
   }
} 	

/**
 * Sets/unsets the pointer in browse mode
 *
 * @param   object   the table row
 * @param   object   the color to use for this row
 *
 * @return  boolean  whether pointer is set or not
 */
function setPointer(theRow, thePointerColor)
{
    if (typeof(theRow.style) == 'undefined' || typeof(theRow.cells) == 'undefined') {
        return false;
    }

    var row_cells_cnt = theRow.cells.length;
    for (var c = 0; c < row_cells_cnt; c++) {
        theRow.cells[c].bgColor = thePointerColor;
    }

    return true;
} // end of the 'setPointer()' function 

function amountplus(qt)
{
	if (!isNaN(qt.value)) 
		qt.value++;	
	else qt.value=1; 
	qt.select()
}

function amountminus(qt)
{
	if (!isNaN(qt.value) && qt.value>1) qt.value--;
	else qt.value=''; 
	qt.select();
	return false;
}

function isNumber()
{
	event.returnValue = ((event.keyCode < 48) || (event.keyCode > 57))? false : true;
}