  function testScroll() {
    // Initialize scrollbar cache if necessary
    if (window._pageXOffset==null) {
      window._pageXOffset = window.pageXOffset
      window._pageYOffset = window.pageYOffset
    }
    // Expose Internet Explorer compatible object model
    document.body.scrollTop = window.pageYOffset
    document.body.scrollLeft = window.pageXOffset
    window.document.body.scrollHeight = document.height
    window.document.body.scrollWidth = document.width    

    // If cache!=current values, call the onscroll event
    if (((window.pageXOffset!=window._pageXOffset) || 
      (window.pageYOffset!=window._pageYOffset)) && (window.onscroll)) 
        window.onscroll()
    // Cache new values
    window._pageXOffset = window.pageXOffset
    window._pageYOffset = window.pageYOffset
  }

  // Create compatibility layer for Netscape
  if (document.layers) {
    document.body = new Object
    setInterval("testScroll()",50)
  }

  // End of Compatibility layer 
  // Just write your onscroll event

  function doScroll() {
    // do something, document.body.scrollTop document.body.scrollHeight;
//document.getElementById("pasek").style.top=document.body.scrollTop;
document.getElementById("main").style.top=document.body.scrollTop;

  }
  var i=250;

  var r=0;
  function test1()
  {
  var x;
  var off;
  var off2;
   if (self.innerWidth)
        {

	    x=self.innerWidth;

		off=-10;
		off2=30;
	}
	else if (document.documentElement && document.documentElement.clientWidth)
	{
	
	  document.write();
	  
	    x=document.documentElement.clientWidth;
		off=20;
		off2=30;		
		
	}
	else if (document.body)
	{
	
	    x=document.body.clientWidth;
		off=-25;
		off2=30;
	}


	z=document.getElementById("in").offsetWidth;

	y=document.getElementById("in").offsetLeft;
	
	if (y+z>x-document.getElementById("top_bar_right").offsetWidth-off)
	{
	
	 r=1;
	 }
	 if (i<=document.getElementById("top_bar_left").offsetWidth-off2)
	 r=0;
    document.getElementById("in").style.left=i;
    if (r==1)
  	  i-=2;
    else
  	  i+=2;
  }
//  setInterval("test1()",50);
  window.onscroll = doScroll;
  //fade colors on top_bar promotions
  hex=255;
  hex2=255;
  d=0;
  function fadetext()
  {
	if (d==0)
	{
	  if (hex<250)
	  {
		hex+=20;//
		hex2-=10;
		  document.getElementById("left_link").style.color="rgb(255,"+(Math.floor(hex/2)+140)+","+(hex)+")";
//		document.getElementById("right_link").style.color="rgb("+hex2+","+Math.floor(hex2/2)+",0)";		
		document.getElementById("right_link").style.color="rgb("+hex+","+(Math.floor(hex/2)+126)+",255)";		
	  }
	  else
		d=1;
	}
	else
	{
	  if (hex>0)
	  {
		hex-=20;//
		hex2+=10;
		document.getElementById("left_link").style.color="rgb(255,"+(Math.floor(hex/2)+140)+","+hex+")";
//		document.getElementById("right_link").style.color="rgb("+Math.floor(hex2/8)+","+Math.floor(hex2/3)+","+Math.floor(hex2/2)+")";		
//		document.getElementById("right_link").style.color="rgb(0,"+Math.floor(hex2/4)+","+Math.floor(hex2)+")";		
		document.getElementById("right_link").style.color="rgb("+hex+","+(Math.floor(hex/2)+126)+",255)";		
	  }
	  else
		d=0;
	}
	setTimeout("fadetext()", 20);
  }