var slider;

function initSlider()
{
	slider = document.getElementById('sliderImg');

	slider.onmousedown = startDraggingSlider;
	slider.onclick = null;
}

function startDraggingSlider(e)
{
   	if (isIE) {
        	slider.style.cursor = "hand";
     	} else {
        	slider.style.cursor = "pointer";
       	}
	getXY(e);
	y1 = theY;

	document.onmousemove = updateSliderDragging;
	document.onmouseup = stopSliderDragging;	

	return false;	
}

function updateSliderDragging(e)
{
	getXY(e);

	y2 = theY;
	
	var dy = y2 - y1

	y1 = y2;
	
	var t = sliderTop();

	if (t < 177 && t > 60) {
		slider.style.top = parseInt(t + dy) + 'px';	
	}	

	return false;	
}

function stopSliderDragging(e)
{
	calcScale();

	document.onmousemove = null;
	document.onmouseup = null;
	getMap("");
	return false;
}

function sliderTop() 
{
	var cur_top = slider.style.top;
        var t = parseInt(cur_top.substring(0, cur_top.length));
	return t;
}

function calcScale()
{
	var t = sliderTop();
	
	fixedzoom = "true";
	if (t < 80) {
		scale = 9;
	} else if (t > 170) {
		scale = 2;
	} else { 
		scale = parseInt(parseInt(176 - t) / 10);
	}

}
