var topval = 0;
var move_timer;
function down(item,parentid,scrollid,markerid){
itemname = document.getElementById(item);
parentname = document.getElementById(parentid);
var vertoffset = parentname.offsetHeight - (itemname.offsetHeight + 20);
if(topval < 0){
  topval += 4;
  itemname.style.top = topval + "px";
  if(markerid){
	markername = document.getElementById(markerid);
	scrollname = document.getElementById(scrollid);
	diff = 1 - (topval /vertoffset);
	markername.style.top = (scrollname.offsetHeight-20) - ((scrollname.offsetHeight-35) * diff) + "px";
		}
  }
move_timer = setTimeout("down('"+item+"','"+parentid+"','"+scrollid+"','"+markerid+"');",20); 
}

function up(item,parentid,scrollid,markerid){
itemname = document.getElementById(item);
parentname = document.getElementById(parentid);
var vertoffset = parentname.offsetHeight - (itemname.offsetHeight + 20);

if(topval > vertoffset){
  topval -= 4;
  itemname.style.top = topval + "px";
  if(markerid){
	markername = document.getElementById(markerid);
	scrollname = document.getElementById(scrollid);
	diff = (topval /vertoffset);
	markername.style.top = (scrollname.offsetHeight-30) * diff + "px";
		}
  }
move_timer = setTimeout("up('"+item+"','"+parentid+"','"+scrollid+"','"+markerid+"');",20); 
}

function clearTimer(){
clearTimeout(move_timer);
}
function moveScrollbar(event,scrollid,targetid,parentid,markerid){
 itemname = document.getElementById(scrollid);
 scrollHeight = itemname.offsetHeight;
 scrolltop = itemname.offsetTop;
 middle = (scrollHeight / 2) + scrolltop;
  if (window.event) {
    x = window.event.clientX + document.documentElement.scrollLeft
                             + document.body.scrollLeft;
    y = window.event.clientY + document.documentElement.scrollTop +
                             + document.body.scrollTop;
  }
  else {
    x = event.clientX + window.scrollX;
    y = event.clientY + window.scrollY;
  }
if(y < middle){
	down(targetid,parentid,scrollid,markerid);
}else{
	up(targetid,parentid,scrollid,markerid);
}
}

var newwindow;
function shopPop(url)
{
	newwindow=window.open(url,'name','height=610,width=610,location=no');
	if (window.focus) {newwindow.focus()}
}