function ZoomMapControl() {

  this.id='zoommap';
  this.uri='zoomMap3.swf';
  this.cmdQueue='_root.javascript.cmdQueue';
  this.obj=null;

  this.writeHTML=function(uri, id, cmdQueue) {
    if(uri) this.uri=uri;
    if(id) this.id=id;
    if(cmdQueue) this.cmdQueue=cmdQueue;
    document.write(
      '<OBJECT ID="'+this.id+'" name="'+this.id+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" WIDTH="800" HEIGHT="640" ALIGN="">'
        +'<PARAM NAME="movie" VALUE="'+this.uri+'">'
        +'<PARAM NAME="play" VALUE="false">'
        +'<PARAM NAME="loop" VALUE="false">'
        +'<PARAM NAME="menu" VALUE="false">'
        +'<PARAM NAME="quality" VALUE="high">'
        +'<PARAM NAME="devicefont" VALUE="false">'
        +'<PARAM NAME="bgcolor" VALUE="#E9E6DF">'
        +'<PARAM NAME="swLiveConnect" VALUE="true">'
        +'<EMBED ID="'+this.id+'" name="'+this.id+'" src="'+this.uri+'" play="false" loop="false" menu="false" quality="high" devicefont="false" bgcolor="#E9E6DF"  WIDTH="800" HEIGHT="640" swLiveConnect="true" NAME="zoomMap3" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">'
        +'</EMBED>'
      +'</OBJECT>'
    );
    return this.id;
  };

  this.getZoomMap=function() {
    if(document.embeds && document.embeds[this.id]) {
      return document.embeds[this.id];
    } else if(document.getElementById) {
      return document.getElementById(this.id);
    } else {
      return null;
    }
  }

  this.focus=function() {
    if( this.obj || (this.obj=this.getZoomMap()) ) if(this.obj.focus) this.obj.focus();
  }

  this.sendCmd=function() {
    if( this.obj || (this.obj=this.getZoomMap()) ) {
      try {
        var obj=this.obj
            , queue=obj.GetVariable(this.cmdQueue)
            , cmd=''
        ;
        for(var i=0; i<arguments.length; i++) cmd+= (cmd ? ',' : '') + escape(String(arguments[i])).replace(/\+/g, '%2B') ;
        queue+= (queue?';':'') + cmd ;
        obj.SetVariable('_root.javascript.cmdQueue', queue);
      } catch(e) {
        return false;
      } finally {
        return true;
      }
    } else {
      return false;
    }
  }

}
