var fon = "1";

function slideH(Id, interval)
{
	var obj = document.getElementById(Id);
	var L, H, step = 5;

	if (obj == null) return;

	interval = ((interval==undefined)?1:interval);

	if(fon=="1")
		obj.style.left = (L=isNaN(L=parseInt(obj.style.left))?550:L + step) + "px";
	else
		obj.style.left = (L=isNaN(L=parseInt(obj.style.left))?550:L - step) + "px";

	if(fon=="1" && L > 787) {
		document.getElementById('btnscroll').src = "/map/images/btn_sm02.gif";
		obj.style.left = "788px";
		document.getElementById('selBranT').style.left = "230px";
		fon = "0";
		return;
	}else if(fon=="0" && L < 540) {
		document.getElementById('btnscroll').src = "/map/images/btn_sm01.gif";
		obj.style.left = "539px";
		document.getElementById('selBranT').style.left = "100px";
		fon = "1";
		return;
	} else {
		setTimeout("slideH('"+Id+"' , "+interval+");", interval);
	}
}

//slideH.objects = new Array();


function slide(Id, interval, to)
{
	var obj = document.getElementById(Id);
	var H, step = 5;

	if (obj == null) return;
	if (to == undefined) { // user clicking
		if (obj._slideStart == true) return;
		if (obj._expand == true) {
			to = 0;
			obj.style.overflow = "hidden";
		} else {
			obj.style.height = "";
			obj.style.overflow = "";
			obj.style.display = "block";
			to = obj.offsetHeight;
			obj.style.overflow = "hidden";
			obj.style.height = "1px";
		}
		obj._slideStart = true;
	}

	step = ((to > 0) ? 1:-1) * step;
	interval = ((interval==undefined)?1:interval);
	obj.style.height = (H=((H=(isNaN(H=parseInt(obj.style.height))?0:H))+step<0)?0:H+step)+"px";

	if (H <= 0) {
		obj.style.display = "none";
		obj.style.overflow = "hidden";
		obj._expand = false;
		obj._slideStart = false;
	} else if (to > 0 && H >= to) {
		obj.style.display = "block";
		obj.style.overflow = "visible";
		obj.style.height = H + "px";
		obj._expand = true;
		obj._slideStart = false;
	} else {
		setTimeout("slide('"+Id+"' , "+interval+", "+to+");", interval);
	}
}


