// JavaScript Document
   var arrTemp=self.location.href.split("?");
   var picUrl = (arrTemp.length>0)?arrTemp[1]:"";
   var NS = (navigator.appName=="Netscape")?true:false;

   function ScrollWidth(
   {
      var a, t = document.forms.f.elements.t;
      t.wrap = 'off'; a = t.offsetHeight;
      t.wrap = 'soft'; a -= t.offsetHeight;
      t.value = a ?
       'Your scrollbars are ' + a + ' pixels wide.' :
       'Sorry, this browser doesn\'t cooperate.';
   };

      function GetWidth()
      {
              var x = 0;
              if (self.innerHeight)
              {
                      x = self.innerWidth;
              }
              else if (document.documentElement && document.documentElement.clientHeight)
              {
                      x = document.documentElement.clientWidth;
              }
              else if (document.body)
              {
                      x = document.body.clientWidth;
              }
              return x;
      }

      function GetHeight()
      {
              var y = 0;
              if (self.innerHeight)
              {
                      y = self.innerHeight;
              }
              else if (document.documentElement && document.documentElement.clientHeight)
              {
                      y = document.documentElement.clientHeight;
              }
              else if (document.body)
              {
                      y = document.body.clientHeight;
              }
              return y;
      }

 	function FitPic() {
 	
		//iWidth = (NS)?window.innerWidth:document.body.clientWidth;
		//iHeight = (NS)?window.innerHeight:document.body.clientHeight;
		//iWidth = document.images[0].width - iWidth;
		//iHeight = document.images[0].height - iHeight;
		iWidth = GetWidth() - ScrollWidth();
		iHeight = GetHeight() - ScrollWidth();
		window.resizeBy(iWidth, iHeight);
		self.focus();
	};


  // otevira okno na 100% width a heigh

   function PopupPic(sPicURL) {
     window.open( "popup.htm?"+sPicURL, "",  
     "resizable=1, scrollbars=yes, HEIGHT='GetWidth();', WIDTH='GetHeight();'");
   }

	function changeBackground(color) {
		b = document.getElementById("body");
		b.style.background = color;
	}

	function closeWindow() {
		// alert("aaaa");
		window.close();
	}
