﻿// JScript File

 <script language='JavaScript'>
      checked = false;
      function CheckAll() 
      {
        if (checked == false)
        {checked = true}else{checked = false}
	      for (var i = 0; i < document.getElementById('form1').elements.length; i++) 
	      {
	       document.getElementById('form1').elements[i].checked = checked;
	      }
      }
  </script>   
    
<script language = 'javascript'>
function confirmDelete (frm1) 
 { 
   valid = false;
// loop through all elements
  for (i=0; i<frm1.length; i++) 
  {
   // Look for our checkboxes only
   if (frm1.elements[i].name.indexOf('ChkBxRepeat') !=-1) 
    {
     // If any are checked then confirm alert, otherwise nothing happens
      if(frm1.elements[i].checked) 
      {
        valid = true;
        
      }//end if
    }// end if
   }//end of for
    if(valid == true)
      {
        return confirm ('Are you sure you want to delete your selection(s)?')
      }
      else
      {
        alert('Please Check atleast one Checkbox before you delete')
        return false
      } //end else
 } //END OF FUNCTION
</script>    

<script language='javascript'>
 //This is for UpdatePromoExpireDateButton.
 function confirmUpdatePromoExpireDate (frm) 
 { 
  valid1 = false;
  // loop through all elements
  for (i=0; i<frm.length; i++) 
  {
   // Look for our checkboxes only
   if (frm.elements[i].name.indexOf('ChkBxRepeat') !=-1) 
    {
     // If any are checked then confirm alert, otherwise nothing happens
      if(frm.elements[i].checked) 
      {
        valid1 = true;
      }//end if
    }// end if
   }//end of for
    if(valid1 == true)
    {
      return confirm ('Please confirm extending the expiration by 90 days for the selection(s)?')
    }
    else
    {
      alert('Please Check atleast one Checkbox before you Update the Promotion Expire Date')
      return false
    } //end else
 } //END OF FUNCTION
</script>