(top.location == self.location) || (top.location = self.location)

function nwin(page, x, y)
{
 sx = screen.availWidth;
 sy = screen.availHeight;
 px = (sx/2)-(x/2);
 py = (sy/2)-(y/2);
 window.open(page,'','top='+py+',left='+px+',width='+x+',height='+y+'resizable=no,scrollbars=no,status=yes');
 return;
}

function xwin(page, x, y, scr)
{
 sx = screen.availWidth;
 sy = screen.availHeight;
 px = (sx/2)-(x/2);
 py = (sy/2)-(y/2);
 window.open(page,'','top='+py+',left='+px+',width='+x+',height='+y+'resizable=no,scrollbars='+scr+',status=yes');
 return;
}

function addfav()
{
  var msg_netscape = "Wiadomość Netscape";
  var msg_opera    = "Ta funkcja nie działa z tą wersją Opery. Dodaj nas do ulubionych ręcznie.";
  var msg_other    = "Twoja przeglądarka nie wspiera automatycznego dodawania do ulubionych. Dodaj nas do ulubionych ręcznie.";
  var agt          = navigator.userAgent.toLowerCase();
  var title        = "Military Zone";
  var url          = "http://www.military-zone.pl/";

  if (agt.indexOf("opera") != -1) 
  {
    if (window.opera && window.print)
    {
      return true;
    } else 
    {
      alert(msg_other);
    }
  }    
  else if (agt.indexOf("firefox") != -1) window.sidebar.addPanel(title,url,"");
  else if ((agt.indexOf("msie") != -1) && (parseInt(navigator.appVersion) >=4)) window.external.AddFavorite(url,title); 
  else if (agt.indexOf("netscape") != -1) window.sidebar.addPanel(title,url,"")         
  else if (window.sidebar && window.sidebar.addPanel) window.sidebar.addPanel(title,url,""); 
  else alert(msg_other);

 return;  
}

function Txt2Graph(mID, plik)
{
 var myTag = document.getElementById(mID);
 if (!myTag) return;
 
 myTag.style.backgroundImage = 'url(img/' +plik+ ')';
 myTag.style.backgroundPosition = 'top left';
 myTag.style.backgroundRepeat = 'no-repeat';
 myTag.style.textIndent = '-2999px';
 
 return true;
}

function setup()
{
 return;
}

function addEvent(obj, event, handler)
{
    if (obj.addEventListener) {
        obj.addEventListener(event, handler, true);
    } else if (obj.attachEvent) {
        obj.attachEvent("on"+event, handler);
    }
}

addEvent(window, 'load', setup);
