function OffsetableMarker(mkrPoint, mkrOpts, opt_color, opt_width, opt_opacity, opt_dx, opt_dy, opt_title, opt_img, html,mtype) {
	this.poi = mkrPoint;//original point of interest
	this.color = opt_color || "";
	this.width = opt_width || 1;
	this.opacity = opt_opacity || 1.0;
	this.dx = opt_dx || 0;
	this.dy = opt_dy || 0;
	this.line = null;
	if(!mkrOpts) 
		mkrOpts = {};
	mkrOpts.draggable = true;
	mkrOpts.bouncy = true;
	mkrOpts.dragCrossMove = true;//? does not work in 6.5
	mkrOpts.bounceGravity = 1;
	mkrOpts.title = opt_title;
	if(html){
	    GEvent.addListener(this,"click", function() {
	          this.openInfoWindowHtml(html);
	        });
    }
    if(mtype){
    	this.mycategory = mtype;
    	gmarkers.push(this);
    }  else
    {
    	this.mycategory = '';
    } 
	if(opt_img == 0){
		mkrOpts.icon = new GIcon(G_DEFAULT_ICON, "StartPointer.png");
	}
	if(opt_img == 2){
		mkrOpts.icon = new GIcon(G_DEFAULT_ICON, "FinishPointer.png");
	}
	if(opt_img == 3){
		mkrOpts.icon = new GIcon(G_DEFAULT_ICON, "PowerPointer.png");
	}
	if(opt_img == 10){
		mkrOpts.icon = new GIcon(G_DEFAULT_ICON, "fiphone.png");
	}
	if(opt_img == 11){
		mkrOpts.icon = new GIcon(G_DEFAULT_ICON, "ftouch.png");
	}
	if(opt_img == 12){
		mkrOpts.icon = new GIcon(G_DEFAULT_ICON, "fclassic.png");
	}
	if(opt_img == 13){
		mkrOpts.icon = new GIcon(G_DEFAULT_ICON, "fnano.png");
	}
	if(opt_img == 14){
		mkrOpts.icon = new GIcon(G_DEFAULT_ICON, "fshuffle.png");
	}
	if(opt_img == 15){
		mkrOpts.icon = new GIcon(G_DEFAULT_ICON, "fmini.png");
	}
	if(opt_img == 16){
		mkrOpts.icon = new GIcon(G_DEFAULT_ICON, "fvideo.png");
	}
	if(opt_img == 17){
		mkrOpts.icon = new GIcon(G_DEFAULT_ICON, "fother.png");
	}
	if(opt_img == 18){
		mkrOpts.icon = new GIcon(G_DEFAULT_ICON, "fpad.png");
	}
	if(opt_img == 19){
			mkrOpts.icon = new GIcon(G_DEFAULT_ICON, "macbook.png");
		}
	
    GMarker.call(this,mkrPoint,mkrOpts);//call super class constructor 
}
OffsetableMarker.prototype = new GMarker(new GLatLng(0,0));//subclass from GMarker

OffsetableMarker.prototype.initialize = function(map) {
    GMarker.prototype.initialize.call(this,map); //super class
	this.map = map;//save
    if((this.dx != 0) || (this.dy !=0)){
        var pt = map.fromLatLngToDivPixel(this.poi);
	    pt.x += this.dx;
	    pt.y += this.dy;
	    this.setPoint(map.fromDivPixelToLatLng(pt));
	}
	var mkr = this;
	GEvent.addListener(this,"dragstart", this.onDragStart);
	GEvent.addListener(this,"drag", this.onDrag);
	GEvent.addListener(this.map,"zoomend", function(oldL,newL){
		var pt = mkr.map.fromLatLngToDivPixel(mkr.poi);
		pt.x += mkr.dx;
		pt.y += mkr.dy;
		mkr.setPoint(mkr.map.fromDivPixelToLatLng(pt));
		mkr.redraw.call(mkr);//and redraw the line
	});
}
OffsetableMarker.prototype.onDragStart = function() {
    if(!this.map.getInfoWindow().isHidden())
        this.map.closeInfoWindow();
}
OffsetableMarker.prototype.onDrag = function(){
	var pt2 = this.map.fromLatLngToDivPixel(this.getPoint());
	var pt1 = this.map.fromLatLngToDivPixel(this.poi);
	this.dx = pt2.x-pt1.x;
	this.dy = pt2.y-pt1.y;	
	this.redraw();
}
OffsetableMarker.prototype.remove = function() {
    this.remLine();
    GMarker.prototype.remove.call(this);//super class
}
OffsetableMarker.prototype.hide = function() {
    this.remLine();
    GMarker.prototype.hide.call(this);//super class
}
OffsetableMarker.prototype.remLine = function() {
	if(this.line != null){//the offset line
	    this.map.removeOverlay(this.line);
		this.line = null;
		}
}
OffsetableMarker.prototype.copy = function() {
	return new OffsetableMarker(this.poi,this.opts,this.color,this.width,this.opacity,this.dx,this.dy);
}  	
OffsetableMarker.prototype.redraw = function(force) {
    this.remLine();
	if((this.dx != 0) || (this.dy != 0)){
		var pts = new Array();//draw new line
		pts[0] = this.poi;
		var pt = this.map.fromLatLngToDivPixel(this.poi);
		pt.x += this.dx;
		pt.y += this.dy;
		pts[1] = this.map.fromDivPixelToLatLng(pt);
		//default color
		var lc = this.color;
		if (lc.length < 7){
			lc = this.map.getCurrentMapType().getTextColor();
			}
		this.line = new GPolyline(pts,lc,this.width,this.opacity);
		this.map.addOverlay(this.line);
	}
	GMarker.prototype.redraw.call(this,force);//super class
}
