﻿// JScript File
function SwitchImageButton(ctrl, src){
  ctrl.src = src;
}

//Gridview Methods
function ChangeCheckBoxState(id, checkState)
{
 var cb = document.getElementById(id);
 if(cb != null)
 {
   cb.checked = checkState;
 }
}  


 function ChangeAllCheckBoxStates(checkState)
 {
  if(CheckBoxIDs != null)
  {
   for(var i = 0; i < CheckBoxIDs.length; i++)
   {
    ChangeCheckBoxState(CheckBoxIDs[i], checkState);
   }
  }
 }
 
 
 function ChangeHeaderAsNeeded()
 {
   if(CheckBoxIDs != null)
   {
     for(var i = 1; i < CheckBoxIDs.length; i++)
     {
       var cb = document.getElementById(CheckBoxIDs[i]);
       if(!cb.checked)
       {
         ChangeCheckBoxState(CheckBoxIDs[0], false);
         return;
       }
     }
     
     ChangeCheckBoxState(CheckBoxIDs[0], true);
   }
 } 
 
// Gallery script.
// With image cross fade effect for those browsers that support it.
// Script copyright (C) 2004 www.cryer.co.uk.
// Script is free to use provided this copyright header is included.
function LoadGallery(pictureName,imageFile,titleCaption,captionText)
{
  
  var picture = document.getElementById(pictureName);
  if (picture.filters)
  {
    picture.style.filter="blendTrans(duration=0.3)";
    picture.filters.blendTrans.Apply();
  }
  picture.src = imageFile;
  if (picture.filters)
  {
    picture.filters.blendTrans.Play();
  }
  document.getElementById(titleCaption).innerHTML=captionText;
}

