﻿// JScript File

//Multiple Select in Gridview.
 function SelectAllCheckboxes(spanChk){

   // Added as ASPX uses SPAN for checkbox
   var oItem = spanChk.children;
   var theBox= (spanChk.type=="checkbox") ? 
        spanChk : spanChk.children.item[0];
   xState=theBox.checked;
   elm=theBox.form.elements;

   for(i=0;i<elm.length;i++)
     if(elm[i].type=="checkbox" && 
              elm[i].id!=theBox.id)
     {
       //elm[i].click();
       if(elm[i].checked!=xState)
         elm[i].click();
       //elm[i].checked=xState;
     }
 }
 
  function SelectCheckboxes2Up(spanChk){

   // Added as ASPX uses SPAN for checkbox
   var oItem = spanChk.children;
   var theBox= (spanChk.type=="checkbox") ? 
        spanChk : spanChk.children.item[0];
   xState=theBox.checked;
   elm=theBox.form.elements;
   var j=0;
   for(i=0;i<elm.length;i++)
   {
    
     if(elm[i].type=="checkbox")
     {
        if (j!=0)
        if(elm[i].id!=theBox.id)
            
                if(elm[i].checked!=xState)
                    elm[i].click();
        j=1;
     }
     
   }
  
 }
 
 function ConfirmAddNewAnother(sConfirmMessage, sReturnPage)
{
	if(confirm(sConfirmMessage))
	{
		window.location = sReturnPage;
	}
}

