<%@  page pageEncoding="utf-8" contentType="text/html;charset=utf-8" isELIgnored="false" %>
<%@taglib prefix="iman"  uri="/WEB-INF/iman.tld" %>

<HTML>
<HEAD><TITLE>OVRefresh</TITLE>
<iman:eMFrameScripts/>
<script language="JavaScript">
   //------------- find OVTop ----------------
   var OVTop=top.Mainscreen.ObjectView;
   
   //------------------- onLoad frame coordination ---------------------
   var t = null;
   function onRefreshLoad(cnt)
   {
      //wait up to 10 seconds for the Results frame to load
      iman.debugOV("in OVRefresh.jsp::onRefrshLoad("+cnt+")");
      if(OVTop.m_mode=="tree")
      {
      	return;
      }
      if (cnt<100)
      {
         if (OVTop.m_mode!="tree" && OVTop.queryLoaded==false)
         {
            cnt++;
            t = setTimeout("onRefreshLoad("+cnt+")",100)  
         }
         else
         {
            iman.debugOV("in OVRefresh.onRefreshLoad-- OVTop.m_mode==tree or OVTop.queryLoaded == true");
            if (t!=null)
            {
               iman.debugOV("calling ClearTimeout("+t+")"); 
               clearTimeout(t);
            }
            
            //if refreshing, clear results and selected objects list
            if ("${refreshOV}"=="true")
            {
               //clear results
               iman.debugOV("in OVRefresh.onRefreshLoad with refreshOV= true.  Calling OVTop.processDisplayCountChange()"); 
               OVTop.processDisplayCountChange();
               iman.debugOV("in OVRefresh.onRefreshLoad with refreshOV= true.  Calling OVTop.doSearch()"); 
               OVTop.doSearch();
               
               //clear any selected objects
               if ((OVTop.m_multiSelect=="true") && (OVTop.ovTitleLoaded))
               {
                  OVTop.SelectedObjectsTitle.clearAllSelections();
               }
            }  
         }
      }
   }
</script>
</HEAD>
<BODY onLoad="javascript:onRefreshLoad(0)">
</BODY>
<HTML>