function setZoom(img, dir, width, height, margin, zIndex, delay,lines) {
  setTimeout(function() {
    if (img.dir==dir) {
      img.style.width=width;
      img.style.height=height;
      img.style.margin=margin;
      img.style.zIndex=zIndex;
      img.style.fontSize= (12+zIndex) +"px";
      img.parentNode.parentNode.style.zIndex=zIndex;
      //alert(img.childNodes[1].style.height);
      //alert(lines);
      img.childNodes[0].style.marginTop="-"+((12+2+zIndex)*lines)/2+"px";
      //img.childNodes[1].style.height= (12+zIndex+2) +"px";
    }
  }, delay);
}

function larger(img, width, height,lines) {
  img.dir='rtl';
  now=parseInt(img.style.zIndex);
  for (i=now+1; i<=5; i++) {
    w=(width*(10+i))/20+'px';
    h=(height*(10+i))/20+'px';
    m=(-i)+'px 0 0 '+(-width*i/40)+'px';
    setZoom(img, 'rtl', w, h, m, i, 20*(i-now),lines);
  }
}

function largerWithMargin(img, width, height, margin,lines) {
  img.dir='rtl';
  now=parseInt(img.style.zIndex);
  for (i=now+1; i<=5; i++) {
    w=(width*(10+i))/20+'px';
    h=(height*(10+i))/20+'px';
    m=(-i)+'px 0 0 '+margin+'px';
    setZoom(img, 'rtl', w, h, m, i, 20*(i-now),lines);
  }
}

function smaller(img, width, height,lines) {
  img.dir='ltr';
  now=parseInt(img.style.zIndex);
  for (i=now-1; i>=0; i--) {
    w=(width*(10+i))/20+'px';
    h=(height*(10+i))/20+'px';
    m=(-i)+'px 0 0 '+(-width*i/40)+'px';
    setZoom(img, 'ltr', w, h, m, i, 20*(now-i),lines);
  }
}

var sliderIntHeight = "20"; 
var sliderHeight = sliderIntHeight+"px"
 
function openSlider() {
	var open_height = $(".slider").attr("box_h") + "px";    
	$(".slider").animate({"height": open_height}, 300 ,"linear", function(){$(".slider").css({background:"url(/static/images/ScrollMenuItemblue.gif) repeat-x scroll 0% 10px"})}  );    
	$(".slider_menu").html('more <small>&#9650;</small>');    
} 
function closeSlider() {
    $(".slider").animate({"height": sliderHeight}, {duration: "slow" }).css({background:""});
	$(".slider_menu").html('more <small>&#9660;</small>');    
}
