
// This is for validation of Input
function validatingInput()
{
   var NoOfRows=document.getElementById("DGridManual").rows.length;
   var Valid=false;
   var Row;
   
   // Looping over table : Row-Wise 
   for(var Index=1;Index<NoOfRows;Index++)
   {
      Row=document.getElementById('DGridManual').rows[Index];
      // checking for the selected column
      if(Row.cells[0].getElementsByTagName('input')[0].checked)
      {
         var TxtValue=Row.cells[1].getElementsByTagName('input')[0].value;
         if(TxtValue>=1 && TxtValue<= 25)
         {
            Valid=true;
         }
         else
         {
            if(TxtValue=='')
            {
               alert('Enter the Quantity');
            }
            else
            {
               alert('Quantity Should be in between 1 to 25 ');
            }               
            return false;                  
         }
      }
   }
   if(Valid==false)
   {
      alert('No Item Selected');
   }      
   return Valid;
}

// This function will show the description of training course 
function showDescription(Obj)
{
   document.getElementById(Obj).style.display="block";
}

// This function will close the description of training course
function closeDescription(Obj)
{
   document.getElementById(Obj).style.display="none";
}

// Use to trim the string 
  function trim(StrVal)
  {
      while (StrVal.substring(0,1) == ' ') 
      {
         StrVal = StrVal.substring(1,StrVal.length);
      }
      while (StrVal.substring(StrVal.length-1,StrVal.length) == ' ') 
      {
         StrVal = StrVal.substring(0,StrVal.length-1);
      }
      return StrVal;
  }
  
 // Checking for the null string
   function IsNullString()
   {
      if(trim(document.getElementById("TxtCourseSearch").value)=='')
      {
         alert('Please enter the text');
         return false;
      }
         return true;
   }
