  function DoRemoveRecord(ASymbol){
   if (confirm("Are you sure you want to delete the security '" + ASymbol + "' from Captools/net database?")==0)
     return;
    document.SymbolDownLoadMainPage.CurrSymbol.value=ASymbol;
    __doPostBack('DeleteSymbolBtn', 'CLICK');
  }

  function DoApproveRecord(ASymbol, AStatus){
     if (AStatus=="1"){
       if (confirm("Are you sure you want to Activate the security '" + ASymbol + "'?")==0)
         return;
     }
     if (AStatus=="0"){
       if (confirm("Are you sure you want to De-Activate the security '" + ASymbol + "'?")==0)
         return;
     }
    document.SymbolDownLoadMainPage.CurrSymbol.value=ASymbol;
    document.SymbolDownLoadMainPage.ApprovalStatus.value=AStatus;
    __doPostBack('ApprovalToggleBtn', 'CLICK');
  }

  function DoDLChangeRecord(ASymbol, AStatus){
     if (AStatus=="2"){
       if (confirm('Are you sure you want to disable downloads for the security "' + ASymbol + '"?')==0)
         return;
     }
     else{
       if (confirm('Please specify whether the Symbol or the Cusip will be used for Downloading for the security "' + ASymbol + '".' +
                   '\nPress Ok to use the Symbol field.\nPress Cancel to use the Cusip field.')==1)
         AStatus=0;
       else
         AStatus=1;
     }
    document.SymbolDownLoadMainPage.CurrSymbol.value=ASymbol;
    document.SymbolDownLoadMainPage.DLStatus.value=AStatus;
    __doPostBack('DLStatusToggleBtn', 'CLICK');
  }

  function RefreshURL(){
    var SelText=document.SymbolDownLoadMainPage.cmbScriptName.value;
    var CommaPos = SelText.indexOf(",");
    var URLText=SelText.substring((CommaPos + 1) ,(SelText.length));
    <!--alert(URLText);
    var DestUrl;
    DestUrl=document.SymbolDownLoadMainPage.DestURLDisplay;
    DestUrl.title=URLText;
    DestUrl.href=URLText;
  }

   function SetCheckAllDLSymbols(val) {
    var len=document.SymbolDownLoadMainPage.elements.length;
    var elename;
    var i=0;
    for( i=0 ; i<len ; i++){
      elename=document.SymbolDownLoadMainPage.elements[i].name;
          var elename=elename.substring(3, 6);
          if (elename=="row"){
        document.SymbolDownLoadMainPage.elements[i].checked=document.SymbolDownLoadMainPage.checkuncheckall.checked;}
    }
   }

  function DoEditFilter(FilterNo){
    document.SymbolDownLoadMainPage.CurrFilterNo.value=FilterNo;
    __doPostBack('ChangeFilterBtn', 'CLICK');
  }

  function DoDeleteFilter(FilterNo){
    document.SymbolDownLoadMainPage.CurrFilterNo.value=FilterNo;
    __doPostBack('DeleteFilterBtn', 'CLICK');
  }

  function SetTimeControls() {
    document.SymbolDownLoadMainPage.StartDateCal.disabled=!(document.SymbolDownLoadMainPage.UseDateRangeCBox.checked);
  }

 function ValidateDLType() {
  DLChecked=0;
  if(document.SymbolDownLoadMainPage.cbxCurrPrices.checked)
    DLChecked=1;
  if(document.SymbolDownLoadMainPage.cbxFinancials.checked)
    DLChecked=1;
  if(document.SymbolDownLoadMainPage.cbxDistribs.checked)
    DLChecked=1;
  if(document.SymbolDownLoadMainPage.cbxHistPrices.checked)
    DLChecked=1;
  if(document.SymbolDownLoadMainPage.cbxMutualFunds.checked)
    DLChecked=1;
  if (DLChecked == 0){
   alert("Please select atleast one download type.");
   return 0;}
  else
   return 1;
} 
 
 function ValidateDate() {
  <!--alert(document.SymbolDownLoadMainPage.EndDateCalEditor.value);
  <!--alert(document.SymbolDownLoadMainPage.StartDateCalEditor.value);
  dateStart = new Date(document.SymbolDownLoadMainPage.StartDateCalEditor.value);
  dateEnd = new Date(document.SymbolDownLoadMainPage.EndDateCalEditor.value);
  dateToday = new Date();
  var dateDifference = dateToday - dateStart;
  <!--alert(dateDifference + ' ' + dateToday + ' ' + dateStart + ' ' + dateEnd);
  if (dateDifference < 0){
   alert(dateDifference + " Start Date should be less than Today's Date.");
   return 0;}
  dateDifference = dateToday - dateEnd;
  <!--alert(dateDifference + ' ' + dateToday + ' ' + dateStart + ' ' + dateEnd);
  if (dateDifference < 0){
   alert(dateDifference + " End Date should be less than Today's Date.");
   return 0;}
  dateDifference = dateEnd - dateStart;
  <!--alert(dateDifference + ' ' + dateToday + ' ' + dateStart + ' ' + dateEnd);
  if (dateDifference < 0){
   alert(dateDifference + " Start Date should be less than the End Date.");
   return 0;}
  <!--alert(dateDifference + ' ' + dateToday + ' ' + dateStart + ' ' + dateEnd);   
  return 1;
}

 function ValidateSymbolSel(){
  len=document.SymbolDownLoadMainPage.elements.length;
  var elename;
  var SymbolSelected=false;
  for(var i=0 ; i<len ; i++){
    elename=document.SymbolDownLoadMainPage.elements[i].name;
	elename=elename.substring(0, 3);
	if (elename=="row"){  
      if (document.SymbolDownLoadMainPage.elements[i].checked){
	    SymbolSelected=true;
		break;
	  }
	}  
  }
  if (SymbolSelected)
    return 1
  else{
    alert("Please select atleast one symbol before downloading data.");
    return 0;
  }
 }
 
 function ValidateData() {
  if ((ValidateDate()==1) && (ValidateDLType()==1) && (ValidateSymbolSel()==1))
    return 1
  else
    return 0;
 }

