
function EInsert(bounds,image,alpha,zindex){
var tr=bounds.getNorthEast();
var bl=bounds.getSouthWest();
this.topleft=new GLatLng(tr.lat(),bl.lng());
this.bottomright=new GLatLng(bl.lat(),tr.lng());
this.image=image;
this.alpha=alpha;
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}}
EInsert.prototype=new GOverlay();
EInsert.prototype.initialize=function(map){
var div=document.createElement("div");
div.style.position="absolute";
div.style.zIndex=this.zindex;
map.getPane(G_MAP_MAP_PANE).appendChild(div);
this.map_=map;
this.div_=div;}
EInsert.prototype.makeDraggable=function(){
this.dragZoom_=map.getZoom();
this.dragObject=new GDraggableObject(this.div_);
this.dragObject.parent=this;
GEvent.addListener(this.dragObject,"dragstart",function(){});
GEvent.addListener(this.dragObject,"dragend",function(){});}
EInsert.prototype.animate=function(){}
EInsert.prototype.remove=function(){
this.div_.parentNode.removeChild(this.div_);}
EInsert.prototype.copy=function(){
return new EInsert();}
EInsert.prototype.redraw=function(force){
if(force){
var tldiv=this.map_.fromLatLngToDivPixel(this.topleft);
var brdiv=this.map_.fromLatLngToDivPixel(this.bottomright);
this.div_.style.left=(tldiv.x)+"px";
this.div_.style.top=(tldiv.y)+"px";
var w=(brdiv.x-tldiv.x)+'px';
var h=(brdiv.y-tldiv.y)+'px';
var isPNG=(this.png==true);
if(this.ie&&isPNG){
var loader="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+this.image+"', sizingMethod='scale');";
var innerHTML='<div style="height:'+h+'; width:'+w+'; '+loader+'" ></div>';
this.div_.innerHTML=innerHTML;}else{
if(this.ie){
this.div_.style.filter="alpha(opacity="+this.alpha*100+")";}
else{
this.div_.style.opacity=this.alpha;}
this.div_.innerHTML='<img src="'+this.image+'"  width='+w+' height='+h+' >';}}}
EInsert.prototype.show=function(){
this.div_.style.display="";}
EInsert.prototype.hide=function(){
this.div_.style.display="none";}
var imgCache=[];
EInsert.prototype.startAnimate=function(imgarray,delay,index,caption){
if(!this.isRunning)return;
if(imgCache.length==0){
for(var i=0;i<imgarray.length;i++){
imgCache[i]=new Image();
imgCache[i].src=imgarray[i];}}
var me=this;
this.image=imgarray[index];
this.redraw(true);
if(isDefined(caption)&&isDefined(this.captionDiv)){
this.captionDiv.innerHTML=caption[index];}
if(logEnabled)GLog.write("trying "+imgarray.length+" : "+index+" : "+delay+" : "+this.image)
index=(index+1)%imgarray.length;
var mydelay=(index==0)?delay*3:delay;
if(!this.isRunning)return;
timer=setTimeout(function(){
me.startAnimate(imgarray,delay,index,caption);},mydelay);}

