/*\Theme Switcher, Cookies Handler and Event Handler combo (IE 5+Mac, IE5.5+Win, Moz)
 * by: <mailto:liorean@user.bip.net>
 * url: <http://liorean.web-graphics.com/scripts/themeswitch-t.html>
 *
 *  Event Handler is based on an original by Tim Morgan <http://www.timmorgan.info/>
\*/

// Event Handler
var event={
  Add:function(f){event.col[event.col.length]=f;if(typeof window.addEventListener!='undefined')window.addEventListener('load',f,false);else if(!event.ieSet)if(typeof document.onreadystatechange!='undefined')document.onreadystatechange=event.onload;event.ieSet=true;return(typeof window.addEventListener!='undefined')},
  onload:function(){var m=/mac/i.test(navigator.platform);if(typeof document.readyState!='undefined')if(m?document.readyState!='interactive':document.readyState!='complete')return;for(var i=0,f;(f=(i<event.col.length)?event.col[i]:null);i++)f();return},
  ieSet:false,
  col:[]
};

// Cookies Handler
var cookie={
  Get:function(n){var re=new RegExp(n+'=([^;]*);?','gi');var r=re.exec(document.cookie)||[];return unescape(r.length>1?r[1]:null)},
  Set:function(n,v,e,p,d,s){var t=new Date;if(e)t.setTime(t.getTime()+(e*8.64e7));document.cookie=n+'='+escape(v)+'; '+(!e?'':'; expires='+t.toUTCString())+(!p?'':'; path='+p)+(!d?'':'; domain='+d)+(!s?'':'; secure')},
  Del:function(n,p,d){var t=cookie.Get(n);document.cookie=n+'='+(!p?'':'; path='+p)+(!d?'':'; domain='+d)+'; expires=Thu, 01-Jan-70 00:00:01 GMT';return t},
  Sup:function(){cookie.Set('c',true);return cookie.Del('c')}
};

// Themeswitch Handler
var acrobugstyle={
   Set:function(t){
      for(var i in this.col)
         for(var j=0,f;(f=(j<this.col[i].length)?this.col[i][j]:null);j++)
            f.disabled=i!=t?true:false;
      if(cookie.Sup()){
         var s=acrobugstyle.Get();
         cookie.Set('Acronym_skin',s,356,'/')
      }
   },
   Get:function(){
      for(var i in this.col)
         if(!this.col[i][0].disabled)
            return i;
      return this.Pref()
   },
   Pref:function(){
      for(var i in this.col)
         if(!this.col[i][0].disabled)
            return i;
      return null
   },
   sum:function(){
      var s=document.styleSheets,i=0;
      for(var f;(f=(i<s.length)?s[i]:null);i++)
         switch(f.title){
            case '':
               break;
            default:
               switch(typeof this.col[f.title]){
                  case 'object':
                     this.col[f.title][this.col[f.title].length]=f;
                     break;
                  default:
                     this.col[f.title]=[f]
               }
         }
   },
   onload:function(){
      acrobugstyle.sum();
   },
   col:{}
};

event.Add(acrobugstyle.onload);