
function IMap(point, image, size, basezoom, zindex) {
	this.point = point;
	this.image = image;
	this.size = size;
	this.basezoom = basezoom;
	this.zindex=zindex||0;
  	var agent = navigator.userAgent.toLowerCase();
  	if ((agent.indexOf("msie") > -1) && (agent.indexOf("opera") < 1)){this.ie = true} else {this.ie = false}
} 

IMap.prototype = new GOverlay();

IMap.prototype.initialize = function(map) {
	//var Tval=document.getElementById("transparent").value;
	var Tval=80;
	var div = document.createElement("div");
	div.style.position = "absolute";
	div.style.zIndex=this.zindex;
	//div.style.filter="DXImageTransform.Microsoft.Chroma(Color=#ffffff)";
	//div.style.opacity = "0.90"; 
	div.style.opacity = Tval*0.01; 
	
	//div.style.filter='Chroma(Color=#ffffff) alpha(style=0, opacity=70)';
	//div.style.filter='alpha(style=0, opacity=90)';
	div.style.filter='alpha(style=0, opacity='+Tval+')';
	map.getPane(G_MAP_MAP_PANE).appendChild(div);
	this.map_ = map;
	this.div_ = div;
	
}

IMap.prototype.redraw = function(force) {
 	if (force) {
  		var p = this.map_.fromLatLngToDivPixel(this.point);
  		var z = this.map_.getZoom();
  		var scale = Math.pow(2,(z - this.basezoom));
  		var h=this.size.height * scale;
  		var w=this.size.width * scale;

  		this.div_.style.left = (p.x - w/2) + "px";
  		this.div_.style.top = (p.y - h/2) + "px";

  		if (this.ie) {
    		//	var loader = "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+this.image+"', sizingMethod='scale');";
   	 		//this.div_.innerHTML = '<div style="height:' +h+ 'px; width:'+w+'px; ' +loader+ '" ></div>';
   	 		this.div_.innerHTML = '<img src="' +this.image+ '"  width='+w+'px;  height='+h+'px;  >';
   	 		
  		} 
  		else {
    			this.div_.innerHTML = '<img src="' +this.image+ '"  width='+w+' height='+h+' >';
    			
  		}
  		
 	} 
 	
}
IMap.prototype.remove = function() {
  	this.div_.parentNode.removeChild(this.div_);
}

IMap.prototype.copy = function() {
  	return new IMap(this.point, this.image, this.size, this.basezoom);
}

IMap.prototype.show = function() {
  	this.div_.style.display="";
}

IMap.prototype.hide = function() {
  	this.div_.style.display="none";
}



  
