<!-- Begin

function viewProperties() 
  vPage = "Properties"
  if len(document.Query.ID.value)=0 then
    vAction = "New"
  else
    vAction = "Update"
  end if
  vID = document.all.ID.value
  vName = document.all.Name.value
  vScope = document.all.Scope.value
  vSQL = document.all.SQL.value
  vEntity = document.all.Entity.value
  'msgbox "Page=" & vPage & "&Action=" & vAction & "&Name=" & vName & "&Scope=" & vScope & "&ID=" & vID & "&SQL=" & vSQL & "&Entity=" & vEntity
  openDlgProperties "Page=" & vPage & "&Action=" & vAction & "&Name=" & vName & "&Scope=" & vScope & "&ID=" & vID & "&SQL=" & vSQL & "&Entity=" & vEntity
end function

sub Over(pObj) 
  pObj.bgcolor="#f1f1f1"
  pObj.style.cursor="hand"
end sub

sub Out(pObj) 
  pObj.bgcolor="White"
end sub

sub SelectRow(i) 
  window.navigate "/query/RecordDetail.asp?LinkCriteria=" & document.all("LinkCriteria" & i).value & "&QueryEntity=" & document.all.Entity.value
end sub

function Delete()
  if msgBox("Are you sure?", 36, "Delete item...") = 6 then
    strXML=strXML & "<Data>" & vbcrlf
    strXML=strXML & "  <Action>Delete</Action>" & vbcrlf
    strXML=strXML & "  <EntityName>" & EntityName.value & "</EntityName>" & vbcrlf
    'strXML=strXML & "  <Criteria>" & EntityKey.value & " in (" & vDeleteList & ")</Criteria>" & vbcrlf
    strXML=strXML & "  <Criteria>" & EntityKey.value & "=" & ID.value & "</Criteria>" & vbcrlf
    strXML=strXML & "</Data>" & vbcrlf
    vResponse =  SendXML(strXML, "/Mini-apps/EntityDelete.asp")
    if getResponseValue(vResponse, "Status") = "Success" Then
      window.location.href = window.location.href
    else
      msgbox getResponseValue(vResponse, "Msg"),48,"Error"
    end if
  end if
end function

function DeleteList()
  for each obj in document.all
    if left(obj.id, 7) = "chkDel." then
      if obj.checked then
        if len(vDeleteList) > 0 then vDeleteList = vDeleteList & ","
        vDeleteList = vDeleteList & obj.value
      end if  
    end if  
  next
  if len(vDeleteList) = 0 then
    msgbox "Select at least one entry to delete", 48, "Delete error..."
  else  
    if msgBox("Are you sure?", 36, "Delete selected items...") = 6 then
      strXML=strXML & "<Data>" & vbcrlf
      strXML=strXML & "  <Action>Delete</Action>" & vbcrlf
      strXML=strXML & "  <EntityName>" & EntityName.value & "</EntityName>" & vbcrlf
      strXML=strXML & "  <Criteria>" & EntityKey.value & " in (" & vDeleteList & ")</Criteria>" & vbcrlf
      strXML=strXML & "</Data>" & vbcrlf
      vResponse =  SendXML(strXML, "/Mini-apps/EntityDelete.asp")
      if getResponseValue(vResponse, "Status") = "Success" Then
        window.location.href = window.location.href
      else
        msgbox getResponseValue(vResponse, "Msg"),48,"Error"
      end if
    end if
  end if
end function
  


//  End -->