<!--
   // Copyright (C) 2006, 2007 - SYNTAXXX - Alex. HANNEL
   // info@syntaxxx.at

	// syn_func_events.js

   function syn_event_add(method, func)
   {
      if(typeof(method) == "undefined" || !method)
      {
         return false;
      }

      if(typeof(func) == "undefined" || !func)
      {
         return false;
      }

      var tmp;
      var handle;
      var oldmethod;
      
      var ver = parseInt(navigator.appVersion, 10);

      if ((navigator.appName == "Microsoft Internet Explorer") && (ver >= 4))
      {
         handle = "window";
      }
         else
      {
         handle = "window";
         // handle = "document";
      }
      
	// alert("method: " + method + " | func: " + func);

      eval("oldmethod = " + handle + "." + method);

     /*
      if ((navigator.appName != "Microsoft Internet Explorer"))
      {
     */
         if(typeof(oldmethod) == "function")
         {
            tmp = function()
                  {
                     eval(func + "()");
                     oldmethod();
                  }
         }
            else
         {
            tmp = function()
                  {
                     eval(func + "()");
                  }
         }

/*
      }
         else
      {
         if(typeof(oldmethod) == "function")
         {
            // alert('function(){ ' + func + '(); oldmethod(); }');
            
            tmp = eval('function(){ ' + func + '(); oldmethod(); }');
         }
            else
         {
            tmp = eval('function(){ ' + func + '(); }');
         }
      }
 */
     
	// alert ("");alert("tmp: " + tmp);

      eval(handle + "." + method + " = " + tmp);

      // alert(handle + "." + method + " = " + tmp);
      
      return true;
   }

//-->
