

//function CheckCheckBox(thisRowItem,thisFormView,thisFormItem)
//{
//   
//   var str=thisFormView+'_'+thisFormItem;
//   var ChkBoxID =thisRowItem.id
//   ChkBoxID = ChkBoxID.replace(str,"chkb");
//   alert(ChkBoxID);
//   ChkBox= document.getElementById(ChkBoxID);  

//   if(ChkBox.checked != true)
//    ChkBox.click();
//              
//}
function CheckCheckBox(thisRowItem,thisFormView,thisFormItem)
{
   
   var str=thisFormView;
   var ChkBoxID =thisRowItem.id
   ChkBoxID = ChkBoxID.replace(str,thisFormItem);
   ChkBox= document.getElementById(ChkBoxID);  

   if(ChkBox.checked != true)
    ChkBox.click();
              
}
function EnableValidation(thisItem,Location,Items,thisFormItem)
{
     var str;
     var ValidationITem;
     for (i in Items)
     {
        //str=thisItem.id;
        //ValidationITem=str.replace(thisFormItem,Location+Items[i]);
        //ValidationITem+=".enabled=\"True\"";
        str=thisItem.id;
        ValidationITem=str.replace(thisFormItem,Location+Items[i]);
        ValidationITem+=".validationGroup = \"Validate\"";

        eval(ValidationITem);
    }    
}
function DisableValidation(thisItem,Location,Items,thisFormItem)
{
     var str;
     var ValidationITem;
     for (i in Items)
     {
 /*       str=thisItem.id;
        ValidationITem=str.replace(thisFormItem,Location+Items[i]);
        ValidationITem+=".enabled=\"\"";
        alert(ValidationITem);
        eval(ValidationITem);*/
        str=thisItem.id;
        ValidationITem=str.replace(thisFormItem,Location+Items[i]);
        ValidationITem+=".validationGroup = \"\"";
        eval(ValidationITem);eval(ValidationITem);eval(ValidationITem);
    }    
}

function createCalander(thisButton,thebox,thisItem,showsTime){
  
  var inputField=thisButton.id; 
  inputField=inputField.replace(thisItem,thebox);
  Time="";
  if(showsTime){
  Time=" %I:%M %p";
  showsTime="true";
  }else
  showsTime="false";
  
  var src="Calendar.setup({";
  src+="inputField:'"+inputField+"',";
  src+="ifFormat:'%d/%m/%Y"+Time+"',";
  src+="showsTime:'"+showsTime+"',";
  src+="button:'"+thisButton.id+"',";
  src+="singleClick:false,step:1";
  src+="});";
  eval(src);
  }
  

function showHide(AbC)
{

       Bb = document.getElementById(AbC);
       if (Bb.style.display == "")
       {
               Bb.style.display = "none";
       }
       else
       {
               Bb.style.display = "";
       }
}

function showHide2(ThisItem,TheItem,TheHide)
{

   var ABC =ThisItem.id;
   ABC = ABC.replace(TheItem,TheHide);

       Bb = document.getElementById(ABC);
       if (Bb.style.display == "")
       {
               Bb.style.display = "none";
       }
       else
       {
               Bb.style.display = "";
       }
}

