//custom markers
	
	//Custom Travelwise controls for GMap
	var twControl=function(map, idstr, onclick, onmouseover, onmouseout, icon) { this.map=map;
this.idstr=idstr; this.onclick=onclick; this.onmouseover=onmouseover; this.onmouseout=onmouseout; this.icon=icon;};

	twControl.prototype=new GControl(true, false);
	twControl.prototype.initialize=function () {
		var oc=this.onclick;
		var omi=this.onmouseover;
		var omo=this.onmouseout;
		
		var cont=document.createElement("div");
		cont.id=this.idstr+"-container";
		with(cont.style){width="33px";height="33px";border="1px solid #bbb";overflow="hidden";cursor="pointer";}
		
		var bg=document.createElement("img");
		bg.alt="";//all the rest are overridden. check-not really...
		bg.title=bg.alt;
		bg.id=this.idstr;
		bg.src=this.icon;
		bg.style.width="34px";
		bg.style.height="34px";
		
		// DOM Listeners...
		GEvent.addDomListener(cont, 'click', function(){
			eval(oc);
		});
		GEvent.addDomListener(cont, 'mouseover', function(){
			eval(omi);
		});
		GEvent.addDomListener(cont, 'mouseout', function(){
			eval(omo);
		});
		
		this.map.getContainer().appendChild(cont);
		cont.appendChild(bg);
		return cont;
	}
	
	twControl.prototype.getDefaultPosition=function () {
		return new GControlPosition(G_ANCHOR_TOP_RIGHT, new
GSize(7,40));
	};
	
	var opts=[];
	var vals=[];
	
	opts[0]=" -- Select -- ";
	opts[1]="Nottingham City";
	opts[2]="Mansfield";
	opts[3]="Retford";
	opts[4]="Stapleford";
	opts[5]="Hucknall";
	opts[6]="West Bridgford";
	opts[7]="Arnold";
	opts[8]="Carlton";
	opts[9]="Harworth";
	opts[10]="Gringely on the Hill";
	opts[11]="Everton";
	opts[12]="Beckingham";
	opts[13]="Carlton-in-Lindrick";
	opts[14]="Blyth";
	opts[15]="Clayworth";
	opts[16]="Leverton";
	opts[17]="Sutton-in-Ashfield";
	opts[18]="Kirkby-in-Ashfield";
	opts[19]="Annesley";
	opts[20]="Newark";
	opts[21]="Southwell";
	opts[22]="Oxton";
	opts[23]="East Leake";
	opts[24]="Cotgrave";
	opts[25]="3 Counties";
	
	vals[0]="";
	vals[1]="52.9549467310722,-1.149444580078125,12";
	vals[2]="53.14368151364047,-1.1992263793945312,13";
	vals[3]="53.323244,-0.942591,14";
	vals[4]="52.929609,-1.274245,13";
	vals[5]="53.03796,-1.202481,13";
	vals[6]="52.929237,-1.134132,13";
	vals[7]="53.006458,-1.127903,13";
	vals[8]="52.963635,-1.098997,13";
	vals[9]="53.417467,-1.077131,13";
	vals[10]="53.407813,-0.895043,13";
	vals[11]="53.411445,-0.96138,13";
	vals[12]="53.402199,-0.826293,13";
	vals[13]="53.349411,-1.104178,13";
	vals[14]="53.377532,-1.062073,13";
	vals[15]="53.387345,-0.909265,13";
	vals[16]="53.331372,-0.812075,13";
	vals[17]="53.124431,-1.269552,13";
	vals[18]="53.100873,-1.263524,13";
	vals[19]="53.077071,-1.242116,13";
	vals[20]="53.076227,-0.811946,13";
	vals[21]="53.078023,-0.955314,13";
	vals[22]="53.05523,-1.062751,13";
	vals[23]="52.830289,-1.182066,13";
	vals[24]="52.911731,-1.040891,13";
	vals[25]="52.81355316759801,-1.256561279296875,10";
	
	var twDropdown=function(map, idstr) { this.map=map;
this.idstr=idstr;};
	twDropdown.prototype=new GControl(true, false);
	twDropdown.prototype.initialize=function () {
		var oc=this.onclick;
		var omi=this.onmouseover;
		var omo=this.onmouseout;
		var cont=document.createElement("div");

		cont.id=this.idstr+"-container";
		with(cont.style){padding="3px";fontWeight="bold";fontSize="9pt";width="150px";height="auto";border="1px solid #bbb";backgroundColor="#fff";overflow="hidden";cursor="pointer";textAlign="center";}
		cont.innerHTML ="Go to location:<br />";
		cont.style.zIndex='1';
		
		var s=document.createElement("select");
		s.id="twd";
		s.style.fontSize='9pt';
		s.style.zIndex='2';
		
		var options=[];
		for(var k=0;k<opts.length;k++){
			options[k]=document.createElement("option");
			options[k].value=vals[k];
			options[k].innerHTML=opts[k];
			s.appendChild(options[k]);
		}
		
		GEvent.addDomListener(s, 'change', function(){
			var t=document.getElementById('twd');
			var latlng=t.value.split(',');
			if(latlng[0]){map.setCenter(new GLatLng(latlng[0],latlng[1]),parseInt(latlng[2]));}else{return false;};
		});
		
		this.map.getContainer().appendChild(cont);
		cont.appendChild(s);
		
		return cont;
	}
		
	twDropdown.prototype.getDefaultPosition=function () {
		return new GControlPosition(G_ANCHOR_TOP_RIGHT, new
GSize(7,7));
	};
	
	var twInfoBox=function(map,idstr,width,height,mouseover,mouseout,bgcolor){this.map=map;this.idstr=idstr;this.width=width;this.height=height;this.mouseover=mouseover||'';this.mouseout=mouseout||'';this.bgcolor=bgcolor||'#fff';};
	twInfoBox.prototype=new GControl(true, false);
	twInfoBox.prototype.initialize=function () {
		//alert(this.bgcolor);
		var omi=this.mouseover;var omo=this.mouseout;
		var cont=document.createElement("div");
		cont.id=this.idstr;
		cont.title=this.idstr;
		GEvent.addDomListener(cont, 'mouseover', function(){eval(omi);});
		GEvent.addDomListener(cont, 'mouseout', function(){eval(omo);});
		with(cont.style){fontSize="9pt";width=this.width+"px";height=this.height+"px";border="1px solid #bbb";backgroundColor=this.bgcolor;overflow="hidden";cursor="pointer";zIndex='1';}
		this.map.getContainer().appendChild(cont);
		return cont;
	}
	twInfoBox.prototype.getDefaultPosition=function () {
		return new GControlPosition(G_ANCHOR_TOP_RIGHT, new
GSize(30,30));
	};
	
	
	//numberIcon
	function numberIcon(point, title, content, num, idx){
		this.point_=point;
		this.title_=title;
		this.content_=content;
		this.num_=num;
		this.idx_=idx;
	}
	numberIcon.prototype=new GOverlay();

	numberIcon.prototype.initialize=function(map) {
		var div=document.createElement("div");  
		with(div.style){zIndex=GOverlay.getZIndex(this.point_.lat());position="absolute";width="auto";height="auto";color="yellow";fontWeight="bold";backgroundColor="black";border="1px solid yellow";fontFamily="sans-serif";fontSize="7pt";textAlign="center";cursor="pointer";}
		div.innerHTML=this.num_;
		div.title=this.title_;
		map.getPane(G_MAP_MARKER_PANE).appendChild(div);
		this.map_=map;
		this.div_=div;
		var q=this.point_;
		var c=this.content_;
		GEvent.addDomListener(this.div_, 'click', function(){
			map.openInfoWindowHtml(q,c);
		});
		var idx=this.idx_;
		GEvent.addDomListener(this.div_, 'mouseover', function(){
			map.addOverlay(gLines[idx]);
		});
		GEvent.addDomListener(this.div_, 'mouseout', function(){
			map.removeOverlay(gLines[idx]);
		});
	}
	
	numberIcon.prototype.remove=function() {
		this.div_.parentNode.removeChild(this.div_);
    }
	
	numberIcon.prototype.copy=function() {
		return new numberIcon(this.point_, this.title_, this.content_, this.num_);
	}

	numberIcon.prototype.redraw=function(force) {
		if (!force) return;
		var p=this.map_.fromLatLngToDivPixel(this.point_);
		this.div_.style.left=(p.x-5) + "px";
		this.div_.style.top=(p.y-5) + "px";
	}
	numberIcon.prototype.getPoint=function(){
		return this.point_;
	}
	//vmsicon
	function vmsIcon(point, title, content){
		this.point_=point;
		this.title_=title;
		this.content_=content;
	}
	vmsIcon.prototype=new GOverlay();

	vmsIcon.prototype.initialize=function(map) {
		var div=document.createElement("div");  
		with(div.style){zIndex=GOverlay.getZIndex(this.point_.lat());position="absolute";width="auto";height="auto";color="yellow";backgroundColor="black";fontFamily="courier new;fixed-width";fontSize="8pt";textAlign="center";cursor="pointer";}
		div.innerHTML=this.title_;
		div.title='';
		map.getPane(G_MAP_MARKER_PANE).appendChild(div);
		this.map_=map;
		this.div_=div;
		var q=this.point_;
		var c=this.content_;
		GEvent.addDomListener(this.div_, 'click', function(){
			map.openInfoWindowHtml(q,c);
		});
	}
	
	vmsIcon.prototype.remove=function() {
		this.div_.parentNode.removeChild(this.div_);
    }
	
	vmsIcon.prototype.copy=function() {
		return new vmsIcon(this.point_, this.title_, this.content_);
	}

	vmsIcon.prototype.redraw=function(force) {
		if (!force) return;
		var p=this.map_.fromLatLngToDivPixel(this.point_);
		debugElement.innerHTML+="this.div.pixelWidth="+this.div_.style.pixelWidth;
		debugElement.innerHTML+="this.div.pixelHeight="+this.div_.style.pixelHeight;
		this.div_.style.left=(p.x) + "px";
		this.div_.style.top=(p.y) + "px";
	}
	
