function directionsControl() {
}

directionsControl.prototype = new GControl();

/*directionsControl.prototype.initialize = function(map) {
  var container = document.createElement("div");

  //var directionsDiv = document.createElement("div");
 // directionsDiv.innerHTML = '<div class="directionsControl"><img src="typo3conf/ext/ahchristmas/images/directions.gif" height="47" width="49" border="0" alt="" usemap="#dirMap"></div>';
  //container.appendChild(directionsDiv);
  
  /*
  GEvent.addDomListener(karteDiv, "click", function() {
    map.setMapType(G_NORMAL_MAP);
  });	
  */	
  
	
  /*map.getContainer().appendChild(container);
  return container;
}*/

// By default, the control will appear in the top right corner
/*directionsControl.prototype.getDefaultPosition = function() {
  return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(0,0));
}*/





function overlay() {
}

overlay.prototype = new GControl();

overlay.prototype.initialize = function(map) {
  var container = document.createElement("div");

  var overlayDiv = document.createElement("div");
  overlayDiv.innerHTML = '<div class="overlay"><img src="clear.gif" height="47" width="50" border="0" alt=""></div>';
  container.appendChild(overlayDiv);
    
	
  map.getContainer().appendChild(container);
  return container;
}

// By default, the control will appear in the top right corner
overlay.prototype.getDefaultPosition = function() {
  return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(0,257));
}





function maptypeActive(id){
	document.getElementById('typekarte').src="/typo3conf/ext/ahgooglemap_ge/images/typekarte.gif";
	document.getElementById('typesatellit').src="/typo3conf/ext/ahgooglemap_ge/images/typesatellit.gif";
	document.getElementById('typehybrid').src="/typo3conf/ext/ahgooglemap_ge/images/typehybrid.gif";

	document.getElementById(id).src="/typo3conf/ext/ahgooglemap_ge/images/" + id + "_active.gif";
}	












function AhLargeMapControl() {
}

AhLargeMapControl.prototype = new GControl();

AhLargeMapControl.prototype.initialize = function(map) {

	var slider = Builder.node('div', {id:'mapZoomLevel', className:'zoomSlider'});
	slider.appendChild(Builder.node('div', {id:'handleZoomLevel', className:'zoomSliderPointer'}));

	var zoomInDiv = Builder.node('div', {className:'zoomIn', title: _mZoomIn});
	var zoomOutDiv = Builder.node('div', {className:'zoomOut', title: _mZoomOut});

	/*var moveNorth = Builder.node('div', {className:'moveNorth', title: _mPanNorth});
	var moveWest = Builder.node('div', {className:'moveWest', title: _mPanWest});
	var moveEast = Builder.node('div', {className:'moveEast', title: _mPanEast});
	var moveSouth = Builder.node('div', {className:'moveSouth', title: _mPanSouth});*/
	var moveLastPosition = Builder.node('div', {className:'moveLastPosition', title: _mLastResult});

	var controlOuterDiv = Builder.node('div', {className:'controlOuterDiv'});

	var table = Builder.node('table', {cellpadding:'0', cellspacing:'0', border:'0', className:'controlTable'});
	var tbody = Builder.node('tbody');

	/*
	var tr1 = Builder.node('tr');
	var td1 = Builder.node('td');
	td1.appendChild(moveNorth);
	tr1.appendChild(Builder.node('td'));
	tr1.appendChild(td1);
	tr1.appendChild(Builder.node('td'));

	var tr2 = Builder.node('tr');
	var td21 = Builder.node('td');
	td21.appendChild(moveWest);
	var td22 = Builder.node('td',{width:'25px'});
	td22.appendChild(moveLastPosition);
	var td23 = Builder.node('td');
	td23.appendChild(moveEast);
	tr2.appendChild(td21);
	tr2.appendChild(td22);
	tr2.appendChild(td23);

	var tr3 = Builder.node('tr');
	var td3 = Builder.node('td');
	td3.appendChild(moveSouth);
	tr3.appendChild(Builder.node('td'));
	tr3.appendChild(td3);
	tr3.appendChild(Builder.node('td'));
	*/

	var tr4 = Builder.node('tr');
	var td4 = Builder.node('td');
	td4.appendChild(zoomInDiv);
	tr4.appendChild(Builder.node('td'));
	tr4.appendChild(td4);
	tr4.appendChild(Builder.node('td'));

	var tr5 = Builder.node('tr');
	var td5 = Builder.node('td');
	td5.appendChild(slider);
	tr5.appendChild(Builder.node('td'));
	tr5.appendChild(td5);
	tr5.appendChild(Builder.node('td'));

	var tr6 = Builder.node('tr');
	var td6 = Builder.node('td');
	td6.appendChild(zoomOutDiv);
	tr6.appendChild(Builder.node('td'));
	tr6.appendChild(td6);
	tr6.appendChild(Builder.node('td'));

	//tbody.appendChild(tr1);
	//tbody.appendChild(tr2);
	//tbody.appendChild(tr3);
	tbody.appendChild(tr4);
	tbody.appendChild(tr5);
	tbody.appendChild(tr6);
	table.appendChild(tbody);
	
	controlOuterDiv.appendChild(table);

	var container = Builder.node('div');
	container.appendChild(controlOuterDiv);

	GEvent.addDomListener(zoomInDiv, 'click', function() {
		sliderControl.setValue(map.getZoom()+1);
	});

	GEvent.addDomListener(zoomOutDiv, 'click', function() {
		sliderControl.setValue(map.getZoom()-1);
	});

	/*
	GEvent.addDomListener(moveNorth, 'click', function() {
		map.panDirection(0, 1);
	});

	GEvent.addDomListener(moveWest, 'click', function() {
		map.panDirection(1, 0);
	});

	GEvent.addDomListener(moveEast, 'click', function() {
		map.panDirection(-1, 0);
	});

	GEvent.addDomListener(moveSouth, 'click', function() {
		map.panDirection(0, -1);
	});
	*/

	/*
	GEvent.addDomListener(moveLastPosition, 'click', function() {
		map.returnToSavedPosition();
	});
	*/
	map.getContainer().appendChild(container);

	var sliderControl = new Control.Slider('handleZoomLevel','mapZoomLevel',{range:$R(19,0),
		axis:'vertical',
		sliderValue:map.getZoom(),
		values:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19],
		onSlide:function(v){map.setZoom(v)},
		onChange:function(v){map.setZoom(v)}});

	return container;
}

/*AhLargeMapControl.prototype.getDefaultPosition = function() {
	return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(0,47));
}*/




function setGMapType(type){
	switch (type) {
	case 2:
		map.setMapType(G_HYBRID_MAP);
		break;
	case 1:
		map.setMapType(G_SATELLITE_MAP);
		break;
	default:
		map.setMapType(G_NORMAL_MAP);
		break;
	}
}

function GZoomIN(){
	tmp = map.getZoom();
	if (tmp < 17) {
		map.setZoom(tmp + 1);
	}
}

function GZoomOUT() {
	tmp = map.getZoom();
	if (tmp >= 6) {
		map.setZoom(tmp - 1);
	}
}












