function newWindow(url, width, height) {
    var Win = window.open(url,"displayWindow",'width=' + width + ',height=' + height + ',resizable=1,scrollbars=yes,menubar=yes,left=20,top=150' );
}

var 
dir = 0;
targetPos = 0;

function setDirUp()
{

    dir=1;
}

function setDirDn()
{

    dir=2;
}

function SetDirStop()
{
   
     dir=0;
}


function setDirLeft()
{

    dir=3;
}

function setDirRight()
{

    dir=4;
}

function move()
{
      curentPos = document.getElementById('scroll_clipper').scrollLeft;
      if (curentPos >= (summaryLenght )){
        document.getElementById('scroll_clipper').scrollLeft = 0;  
      } else {
        document.getElementById('scroll_clipper').scrollLeft = curentPos + 1;
      }
      
      //document.getElementById('monitor').value = curentPos;
   
}

  function move_up() {
    document.getElementById('scroll_clipper').scrollTop = document.getElementById('scroll_clipper').scrollTop - 10;
  }
  
  function move_down() {
    document.getElementById('scroll_clipper').scrollTop = document.getElementById('scroll_clipper').scrollTop + 10 ;
  }

  function move_left() {
    document.getElementById('scroll_clipper').scrollLeft = document.getElementById('scroll_clipper').scrollLeft - 10;
  }
  
  function move_right() {
    document.getElementById('scroll_clipper').scrollLeft = document.getElementById('scroll_clipper').scrollLeft + 10 ;
  }  

  function setPostionTo(postion) {
      targetPos = postion * 133;
    //document.getElementById('scroll_clipper').scrollLeft = polozenie;
  }  
  
  function setPostionInstant(postion){
      targetPos = postion * 133;
      document.getElementById('scroll_clipper').scrollLeft = targetPos;      
  }
  
  
		function prewPicture()
		{
		    prevPict = current_picture-1;
		    if (prevPict>=0){
		      LoadMidPicture(prevPict);
		    }  
		}		
		
		function nextPicture()
		{
		    nextPic = current_picture+1;
		    if (nextPic<=maxIndex){
		      LoadMidPicture(nextPic);
		    }
		}




