check this recursive code c# webbrowser control. need help ASAP : i need to execute a method based on the visibility of the following html element.

    <div id="loading" style="height: 201px; width: 793px; visibility: hidden;">

the method i used to check the visibility property works fine.

     public bool isloading()
                      {
                          string v;

                         v= webBrowser1.Document.GetElementById("loading").Style;
                         if (v.Contains("visible")) { return true; }
                         if (v.Contains("hidden")) { return false; }
                         else
                             return false;
                              
                      }



i m using it like this. the app freezes upon coming to this code. need help

     public void battleloop()
                      {
                          if (!isloading())
                          {
                              universalclcikbutton();
                          }
                          else 
                          {
                              battleloop();
                          }
                       }


i know it is calling a method within a method. anyone please give me alternatives ASAP!!!!!!!!!!!