var iv;

function scroll_left() {
 obj = document.getElementById("scrolling2");
  margin = obj.style.marginLeft.substr(0,obj.style.marginLeft.length-2);
  if(margin<0) {
    obj.style.marginLeft = (margin*1+3);
  }
}

function scroll_right() {
  obj = document.getElementById("scrolling2");
  margin = obj.style.marginLeft.substr(0,obj.style.marginLeft.length-2);
  if(margin-643>=-1*wdth) {
    obj.style.marginLeft = (margin-3);
  }
}

function scroll_block_left() {
 obj = document.getElementById("scrolling2");
  margin = (obj.style.marginLeft.substr(0,obj.style.marginLeft.length-2))*1+357;
  if(margin<0) {
    obj.style.marginLeft = (margin*1);
    document.getElementById("right_cur").src="images/arrow_red1.gif";
    document.getElementById("right_cur").style.cursor="pointer";
  } else {
    obj.style.marginLeft = 0;
    document.getElementById("left_cur").src="images/arrow_gray0.gif";
    document.getElementById("right_cur").src="images/arrow_red1.gif";
    document.getElementById("left_cur").style.cursor="";
  }
}

function scroll_block_right() {
  obj = document.getElementById("scrolling2");
  if(wdth>639) {
  margin = (obj.style.marginLeft.substr(0,obj.style.marginLeft.length-2))*1-357;
  if(margin-282>=-1*wdth) {
    obj.style.marginLeft = margin;
    document.getElementById("left_cur").src="images/arrow_red0.gif";
    document.getElementById("left_cur").style.cursor="pointer";
    if(margin-282*2<-1*wdth){
      document.getElementById("right_cur").src="images/arrow_gray1.gif";
      document.getElementById("right_cur").style.cursor="";
    }
  } else {
    //obj.style.marginLeft = -1*wdth+416;
  }
  }
}

function view_img(w, h, img, img_name, evtObj){
  /*x=window.event.clientX;
  y=window.event.clientY+5;*/
  x=evtObj.clientX;
  y=evtObj.clientY+5;
  x -= w/2;
  y -= h/2;
  window.open("php_inc/show_img.php?img="+img+'&img_name='+img_name, null, "width="+w+", height="+h+", top="+y+", left="+x+", resizable=0");
}
