function set_store_body(store_id, store_title){
	document.getElementById("store_body").innerHTML="<img src='/images/loading.gif' alt='' />";
	document.getElementById("main_cities").innerHTML=store_title;
	var xhReq = new XMLHttpRequest();
	var rand_num = Math.random()*9999999;
	xhReq.open("GET", "/get_store.php?store_id="+store_id+"&qs="+rand_num, true);
	xhReq.send(null);
	xhReq.onreadystatechange = function() {
		if (xhReq.readyState != 4)  { return; }
		serverResponse = xhReq.responseText;
		document.getElementById("store_body").innerHTML=serverResponse;
	};
}


var new_pos=0;
var now_pos=0;
var image_num=0;
var step=1;
var timer_ch=setTimeout("void(0)", 1);

function go_right(){
	var image_num_temp=image_num+1;
	if (document.getElementById("image_"+image_num_temp)){
		new_pos=new_pos-$("#image_"+image_num).width()-11;
		image_num++;
		timer_ch=setTimeout("go_pos();", 1);
	}else{
		new_pos=0;
		image_num=0;
		timer_ch=setTimeout("go_pos();", 1);
	}
}

function go_left(){
	if (image_num>0){
		image_num=image_num-1;
		new_pos=new_pos+$("#image_"+image_num).width()+11;
		timer_ch=setTimeout("go_pos();", 1);
	}
}

function go_pos(){
	step=0.05*(Math.abs(now_pos-new_pos));

	step=Math.ceil(step);

	if (Math.abs(now_pos-new_pos)<10)
		step=1;

	if (now_pos>new_pos){
		now_pos=now_pos-step;
		document.getElementById("all_pics").style.right=now_pos+"px";
		timer_ch=setTimeout("go_pos();", 1);
	}else if (now_pos<new_pos){
		now_pos=now_pos+step;
		document.getElementById("all_pics").style.right=now_pos+"px";
		timer_ch=setTimeout("go_pos();", 1);
	}
}
//י
