$(document).ready(function()
{	
	
	/* scroll bar */
	
	var barpt = 0;
	var tarpx;
	var tarBox1 = $("div#list_table");
	var tarBox2 = $("div#list_tablein");
	var tarTable =$("div#list_tablein table");
	var tar_height = tarTable.height();
	
	tarBox2.css({ "height": tar_height });
	$(window).resize(function(){
		tarpx = 0+(tar_height-tarBox1.height())*barpt/100+"px";
		tarBox2.css({"top": tarpx});
	});
	
	if(tar_height > tarBox1.height()){
	
		$('#list_scroll').slider(
		{
			min: -100,
			max: 0,
			startValue: 0,
			orientation: "vertical",
			slide: function(event,ui)
			{
				
				barpt = ui.value
				tarpx = (tar_height-tarBox1.height())*barpt/100+"px";
				tarTable.css({"top": tarpx})
				
			}
		});
	
	}else{
		$("div#list_tablein").css({ "height":  "auto" });
		$("div#list_table").css({ "height": "auto", "border-bottom":"none" });
		$("div#list_scroll").css({"display":"none"})
		
	}

	
}
);

