//var YSLIDERLENGTH = 118;
var YSLIDERLENGTH = 90;
var MINZOOM = 8
var MAXZOOM = 16


function YSliderControl() { 

}
YSliderControl.prototype = new GControl();

YSliderControl.prototype.setSlider = function(zoom) {
	var top = YSLIDERLENGTH - Math.round((zoom-MINZOOM)*YSLIDERLENGTH/(MAXZOOM-MINZOOM));
	this.slide.top = top;
	this.knob.style.top = top+"px";
}

YSliderControl.prototype.setZoom = function() {
	var z= MINZOOM + Math.round((YSLIDERLENGTH-this.slide.top)/(YSLIDERLENGTH/(MAXZOOM-MINZOOM)));
	this.map.setZoom(z);
}

YSliderControl.prototype.initialize = function(map) {
	var that=this;
	this.map = map;

	var agent = navigator.userAgent.toLowerCase();
	if ((agent.indexOf("msie") > -1) && (agent.indexOf("opera") < 1)) {
		this.ie = true
	} 
	else {
		this.ie = false
	}

	var container = document.createElement("div");
	container.style.width="32px";
	container.style.height="98px";

	if (this.ie) {
		var loader = "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/slider_mylorraine.png', sizingMethod='scale');";
		container.innerHTML = '<div style="height:98px; width:32px; ' +loader+ '" ></div>';
	} 
	else {
		container.innerHTML = '<img src="images/slider_mylorraine.png"  width=32 height=98 >';
	}

	if (this.ie) {
		var loader = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/poignee_zoom.png', sizingMethod='scale');";
		this.knob = document.createElement("div");
		this.knob.style.height="9px";
		this.knob.style.width="32px";
		this.knob.style.top=YSLIDERLENGTH+"px";
		this.knob.style.left="0px";
		this.knob.style.filter=loader;
	} 
	else {
		this.knob = document.createElement("img");
		this.knob.src = "images/poignee_zoom.png";
		this.knob.height = "9";
		this.knob.width = "32";
		this.knob.style.top=YSLIDERLENGTH+"px";
		this.knob.style.left="0px";
	}
	container.appendChild(this.knob);
	this.slide=new GDraggableObject(this.knob, {container:container});

	map.getContainer().appendChild(container);

	GEvent.addListener(map, "zoomend", function(a,b) {that.setSlider(b)});
	GEvent.addListener(this.slide, "dragend", function() {that.setZoom()});

	return container;
}

YSliderControl.prototype.getDefaultPosition = function() {
	return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(7, 85));
}






function TextualZoomControlIn() {

}

TextualZoomControlIn.prototype = new GControl();
TextualZoomControlIn.prototype.initialize = function(map) {

	var agent = navigator.userAgent.toLowerCase();
	if ((agent.indexOf("msie") > -1) && (agent.indexOf("opera") < 1)) {
		this.ie = true
	} 
	else {
		this.ie = false
	}

	var container = document.createElement("div");
	container.style.width="32px";
	container.style.height="20px";

	
	if (this.ie) {
		var loader = "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/bouton_zoomin.png', sizingMethod='scale');";
		container.innerHTML = '<div style="cursor:pointer; width:32px; height:20px; ' +loader+ '" onclick="map.zoomIn();"></div>';
	} 
	else {
		container.innerHTML = '<img style="cursor:pointer" src="images/bouton_zoomin.png"  width=32 height=20 onclick="map.zoomIn();">';
	}

	map.getContainer().appendChild(container);
	return container;
}

TextualZoomControlIn.prototype.getDefaultPosition = function() {
	return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(7, 70));
}





function TextualZoomControlOut() {

}
TextualZoomControlOut.prototype = new GControl();
TextualZoomControlOut.prototype.initialize = function(map) {
	
	var agent = navigator.userAgent.toLowerCase();
	if ((agent.indexOf("msie") > -1) && (agent.indexOf("opera") < 1)) {
		this.ie = true
	} 
	else {
		this.ie = false
	}

	var container = document.createElement("div");
	container.style.width="32px";
	container.style.height="20px";
	
	if (this.ie) {
		var loader = "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/bouton_zoomout.png', sizingMethod='scale');";
		container.innerHTML = '<div style="cursor:pointer; height:20px; width:32px; ' +loader+ '" onclick="map.zoomOut();"></div>';
	} 
	else {
		container.innerHTML = '<img style="cursor:pointer" src="images/bouton_zoomout.png"  width=32 height=20 onclick="map.zoomOut();">';
	}
	
	map.getContainer().appendChild(container);
	return container;

}

TextualZoomControlOut.prototype.getDefaultPosition = function() {
	return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(7, 180));
}





function TextualZoomControlCenter1() {}
TextualZoomControlCenter1.prototype = new GControl();
TextualZoomControlCenter1.prototype.initialize = function(map) {
	var agent = navigator.userAgent.toLowerCase();
	if ((agent.indexOf("msie") > -1) && (agent.indexOf("opera") < 1)) this.ie = true
	else this.ie = false

	var container = document.createElement("div");
	container.style.width="10px";
	container.style.height="10px";
	
	if (this.ie) {
		var loader = "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/bouton_map_centre1.png', sizingMethod='scale');";
		container.innerHTML = '<div style="cursor:pointer" style="width:10px; height:10px; ' +loader+ '" onclick=""></div>';
	} 
	else {
		container.innerHTML = '<img style="cursor:pointer" src="images/bouton_map_centre1.png"  width=10 height=10 onclick="">';
	}
	
	map.getContainer().appendChild(container);
	return container;
}

TextualZoomControlCenter1.prototype.getDefaultPosition = function() {
	return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(5, 5));
}


function TextualZoomControlCenter2() {}
TextualZoomControlCenter2.prototype = new GControl();
TextualZoomControlCenter2.prototype.initialize = function(map) {
	var agent = navigator.userAgent.toLowerCase();
	if ((agent.indexOf("msie") > -1) && (agent.indexOf("opera") < 1)) this.ie = true
	else this.ie = false

	var container = document.createElement("div");
	container.style.width="11px";
	container.style.height="10px";
	
	if (this.ie) {
		var loader = "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/bouton_map_centre2.png', sizingMethod='scale');";
		container.innerHTML = '<div style="cursor:pointer" style="width:11px; height:10px; ' +loader+ '" onclick="bouge_position_map(\'top\')"></div>';
	} 
	else {
		container.innerHTML = '<img style="cursor:pointer" src="images/bouton_map_centre2.png"  width=11 height=10 onclick="bouge_position_map(\'top\')">';
	}
	
	map.getContainer().appendChild(container);
	return container;
}

TextualZoomControlCenter2.prototype.getDefaultPosition = function() {
	return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(15, 5));
}

function TextualZoomControlCenter3() {}
TextualZoomControlCenter3.prototype = new GControl();
TextualZoomControlCenter3.prototype.initialize = function(map) {
	var agent = navigator.userAgent.toLowerCase();
	if ((agent.indexOf("msie") > -1) && (agent.indexOf("opera") < 1)) this.ie = true
	else this.ie = false

	var container = document.createElement("div");
	container.style.width="11px";
	container.style.height="10px";
	
	if (this.ie) {
		var loader = "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/bouton_map_centre3.png', sizingMethod='scale');";
		container.innerHTML = '<div style="cursor:pointer" style="width:11px; height:10px; ' +loader+ '" onclick=""></div>';
	} 
	else {
		container.innerHTML = '<img style="cursor:pointer" src="images/bouton_map_centre3.png"  width=11 height=10 onclick="">';
	}
	
	map.getContainer().appendChild(container);
	return container;
}

TextualZoomControlCenter3.prototype.getDefaultPosition = function() {
	return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(26, 5));
}





function TextualZoomControlCenter4() {}
TextualZoomControlCenter4.prototype = new GControl();
TextualZoomControlCenter4.prototype.initialize = function(map) {
	var agent = navigator.userAgent.toLowerCase();
	if ((agent.indexOf("msie") > -1) && (agent.indexOf("opera") < 1)) this.ie = true
	else this.ie = false

	var container = document.createElement("div");
	container.style.width="10px";
	container.style.height="11px";
	
	if (this.ie) {
		var loader = "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/bouton_map_centre4.png', sizingMethod='scale');";
		container.innerHTML = '<div style="cursor:pointer" style="width:10px; height:11px; ' +loader+ '" onclick="bouge_position_map(\'left\')"></div>';
	} 
	else {
		container.innerHTML = '<img style="cursor:pointer" src="images/bouton_map_centre4.png"  width=10 height=11 onclick="bouge_position_map(\'left\')">';
	}
	
	map.getContainer().appendChild(container);
	return container;
}

TextualZoomControlCenter4.prototype.getDefaultPosition = function() {
	return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(5, 15));
}


function TextualZoomControlCenter5() {}
TextualZoomControlCenter5.prototype = new GControl();
TextualZoomControlCenter5.prototype.initialize = function(map) {
	var agent = navigator.userAgent.toLowerCase();
	if ((agent.indexOf("msie") > -1) && (agent.indexOf("opera") < 1)) this.ie = true
	else this.ie = false

	var container = document.createElement("div");
	container.style.width="11px";
	container.style.height="11px";
	
	if (this.ie) {
		var loader = "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/bouton_map_centre5.png', sizingMethod='scale');";
		container.innerHTML = '<div style="cursor:pointer" style="width:11px; height:11px; ' +loader+ '" onclick=""></div>';
	} 
	else {
		container.innerHTML = '<img style="cursor:pointer" src="images/bouton_map_centre5.png"  width=11 height=11 onclick="">';
	}
	
	map.getContainer().appendChild(container);
	return container;
}

TextualZoomControlCenter5.prototype.getDefaultPosition = function() {
	return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(15, 15));
}

function TextualZoomControlCenter6() {}
TextualZoomControlCenter6.prototype = new GControl();
TextualZoomControlCenter6.prototype.initialize = function(map) {
	var agent = navigator.userAgent.toLowerCase();
	if ((agent.indexOf("msie") > -1) && (agent.indexOf("opera") < 1)) this.ie = true
	else this.ie = false

	var container = document.createElement("div");
	container.style.width="11px";
	container.style.height="11px";
	
	if (this.ie) {
		var loader = "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/bouton_map_centre6.png', sizingMethod='scale');";
		container.innerHTML = '<div style="cursor:pointer" style="width:11px; height:11px; ' +loader+ '" onclick="bouge_position_map(\'right\')"></div>';
	} 
	else {
		container.innerHTML = '<img style="cursor:pointer" src="images/bouton_map_centre6.png"  width=11 height=11 onclick="bouge_position_map(\'right\')">';
	}
	
	map.getContainer().appendChild(container);
	return container;
}

TextualZoomControlCenter6.prototype.getDefaultPosition = function() {
	return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(26, 15));
}






function TextualZoomControlCenter7() {}
TextualZoomControlCenter7.prototype = new GControl();
TextualZoomControlCenter7.prototype.initialize = function(map) {
	var agent = navigator.userAgent.toLowerCase();
	if ((agent.indexOf("msie") > -1) && (agent.indexOf("opera") < 1)) this.ie = true
	else this.ie = false

	var container = document.createElement("div");
	container.style.width="10px";
	container.style.height="9px";
	
	if (this.ie) {
		var loader = "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/bouton_map_centre7.png', sizingMethod='scale');";
		container.innerHTML = '<div style="cursor:pointer" style="width:10px; height:9px; ' +loader+ '" onclick=""></div>';
	} 
	else {
		container.innerHTML = '<img style="cursor:pointer" src="images/bouton_map_centre7.png"  width=10 height=9 onclick="">';
	}
	
	map.getContainer().appendChild(container);
	return container;
}

TextualZoomControlCenter7.prototype.getDefaultPosition = function() {
	return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(5, 26));
}


function TextualZoomControlCenter8() {}
TextualZoomControlCenter8.prototype = new GControl();
TextualZoomControlCenter8.prototype.initialize = function(map) {
	var agent = navigator.userAgent.toLowerCase();
	if ((agent.indexOf("msie") > -1) && (agent.indexOf("opera") < 1)) this.ie = true
	else this.ie = false

	var container = document.createElement("div");
	container.style.width="11px";
	container.style.height="9px";
	
	if (this.ie) {
		var loader = "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/bouton_map_centre8.png', sizingMethod='scale');";
		container.innerHTML = '<div style="cursor:pointer" style="width:11px; height:9px; ' +loader+ '" onclick="bouge_position_map(\'down\')"></div>';
	} 
	else {
		container.innerHTML = '<img style="cursor:pointer" src="images/bouton_map_centre8.png"  width=11 height=9 onclick="bouge_position_map(\'down\')">';
	}
	
	map.getContainer().appendChild(container);
	return container;
}

TextualZoomControlCenter8.prototype.getDefaultPosition = function() {
	return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(15, 26));
}

function TextualZoomControlCenter9() {}
TextualZoomControlCenter9.prototype = new GControl();
TextualZoomControlCenter9.prototype.initialize = function(map) {
	var agent = navigator.userAgent.toLowerCase();
	if ((agent.indexOf("msie") > -1) && (agent.indexOf("opera") < 1)) this.ie = true
	else this.ie = false

	var container = document.createElement("div");
	container.style.width="11px";
	container.style.height="9px";
	
	if (this.ie) {
		var loader = "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/bouton_map_centre9.png', sizingMethod='scale');";
		container.innerHTML = '<div style="cursor:pointer" style="width:11px; height:9px; ' +loader+ '" onclick=""></div>';
	} 
	else {
		container.innerHTML = '<img style="cursor:pointer" src="images/bouton_map_centre9.png"  width=11 height=9 onclick="">';
	}
	
	map.getContainer().appendChild(container);
	return container;
}

TextualZoomControlCenter9.prototype.getDefaultPosition = function() {
	return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(26, 26));
}

/*
function TextualZoomControlCenter() {

}
TextualZoomControlCenter.prototype = new GControl();
TextualZoomControlCenter.prototype.initialize = function(map) {
	var agent = navigator.userAgent.toLowerCase();
	if ((agent.indexOf("msie") > -1) && (agent.indexOf("opera") < 1)) {
		this.ie = true
	} 
	else {
		this.ie = false
	}

	var container = document.createElement("div");
	container.style.width="43px";
	container.style.height="40px";
	
	if (this.ie) {
		var loader = "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/bouton_map_centre.png', sizingMethod='scale');";
		container.innerHTML = '<div style="cursor:pointer" style="height:40px; width:43px; ' +loader+ '" onclick="map.returnToSavedPosition();"></div>';
	} 
	else {
		container.innerHTML = '<img style="cursor:pointer" src="images/bouton_map_centre.png"  width=43 height=40 onclick="map.returnToSavedPosition();">';
	}
	
	map.getContainer().appendChild(container);
	return container;
}

TextualZoomControlCenter.prototype.getDefaultPosition = function() {
	return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(16, 38));
}
*/