
 //*************To select Dealer************
function SelectSearchDealer(CheckBoxControl) 
{
if (CheckBoxControl.checked == true) 
{
//document.getElementById("ctl00_MainContent_chkAllItems").checked=true 
//alert (document.getElementById("ctl00_MainContent_chkAllItems").id)
var i;
for (i=0; i < document.forms[0].elements.length; i++) 
{
if ((document.forms[0].elements[i].type == 'checkbox') && 
(document.forms[0].elements[i].name.indexOf('dgSearchDealer') > -1)) 
{
document.forms[0].elements[i].checked = true;
}
}
} 
else 
{
var i;
for (i=0; i < document.forms[0].elements.length; i++) 
{
if ((document.forms[0].elements[i].type == 'checkbox') && 
(document.forms[0].elements[i].name.indexOf('dgSearchDealer') > -1)) 
{
document.forms[0].elements[i].checked = false;
}
}
}
  
}

//*************To select Books************
function selectSearchBook(CheckBoxControl) 
{
if (CheckBoxControl.checked == true) 
{
//document.getElementById("ctl00_MainContent_chkAllItems").checked=true 
//alert (document.getElementById("ctl00_MainContent_chkAllItems").id)
var i;
for (i=0; i < document.forms[0].elements.length; i++) 
{
if ((document.forms[0].elements[i].type == 'checkbox') && 
(document.forms[0].elements[i].name.indexOf('dgSearchBooks') > -1)) 
{
document.forms[0].elements[i].checked = true;
}
}
} 
else 
{
var i;
for (i=0; i < document.forms[0].elements.length; i++) 
{
if ((document.forms[0].elements[i].type == 'checkbox') && 
(document.forms[0].elements[i].name.indexOf('dgSearchBooks') > -1)) 
{
document.forms[0].elements[i].checked = false;
}
}
}
}

  //*************To select Unmapped Books************
function selectSearchUnmappedBook(CheckBoxControl) 
{
if (CheckBoxControl.checked == true) 
{
//document.getElementById("ctl00_MainContent_chkAllItems").checked=true 
//alert (document.getElementById("ctl00_MainContent_chkAllItems").id)
var i;
for (i=0; i < document.forms[0].elements.length; i++) 
{
if ((document.forms[0].elements[i].type == 'checkbox') && 
(document.forms[0].elements[i].name.indexOf('dgUnmappedBooks') > -1)) 
{
document.forms[0].elements[i].checked = true;
}
}
} 
else 
{
var i;
for (i=0; i < document.forms[0].elements.length; i++) 
{
if ((document.forms[0].elements[i].type == 'checkbox') && 
(document.forms[0].elements[i].name.indexOf('dgUnmappedBooks') > -1)) 
{
document.forms[0].elements[i].checked = false;
}
}
}
}


//*************To select Unmapped Dealer(s)************
function selectSearchUnmappedDealer(CheckBoxControl) 
{
if (CheckBoxControl.checked == true) 
{
//document.getElementById("ctl00_MainContent_chkAllItems").checked=true 
//alert (document.getElementById("ctl00_MainContent_chkAllItems").id)
var i;
for (i=0; i < document.forms[0].elements.length; i++) 
{
if ((document.forms[0].elements[i].type == 'checkbox') && 
(document.forms[0].elements[i].name.indexOf('dgUnMappedDealer') > -1)) 
{
document.forms[0].elements[i].checked = true;
}
}
} 
else 
{
var i;
for (i=0; i < document.forms[0].elements.length; i++) 
{
if ((document.forms[0].elements[i].type == 'checkbox') && 
(document.forms[0].elements[i].name.indexOf('dgUnMappedDealer') > -1)) 
{
document.forms[0].elements[i].checked = false;
}
}
}
}


//*************messagebox to confirm map unmapped Book to selected Dealer

 function ConfirmMapBook()
{
if (confirm("Are you sure, you want to map selected Book to Dealer ? "))
 {
return true
}
else
{
return false
}
}
 
 

//*************messagebox to confirm Unmap mapped Book from selected Dealer

 function ConfirmUnMapBook()
{
if (confirm("Are you sure, you want to unmap selected Book from Dealer ? "))
{
return true
}
else
{
return false
}
}


//*************messagebox to confirm map unmapped Dealer(s) to selected Book

 function ConfirmMapDealer()
{
if (confirm("Are you sure, you want to map selected Dealer(s) to Book ? "))
{
return true
}
else
{
return false
}
}

//*************messagebox to confirm Unmap mapped Dealer(s) from selected Book

 function ConfirmUnMapDealer()
{
if (confirm("Are you sure, you want to unmap selected Dealer(s) from Book ? "))
{
return true
}
else
{
return false
}
}