function JVSImageSwap(prmTagNam, prmImgRsc)
{
 if(document.images)
 {
  var varImgSrc=document.images[prmTagNam].src;
  document.images[prmTagNam].src=prmImgRsc;
  if((document.images[prmTagNam].src==null)&&(varImgSrc!=null))
  {document.images[prmTagNam].src=varImgSrc;}
 }
}
//====================================================================
// --- SoundPlayer - Object - Implementation
//====================================================================
function JVSSoundPlayer(id)
{
 this.Cls='obj/soundplayer';
 this.Idt=id;
 this.Doc=null;
 this.Src='';
 this.PlaySrc='';
 return this;
}
//
function JVSSoundPlayer_write(doc)
{
 if(doc.writeln)
 {
  this.Doc=doc;
  varContent='<div id="'+this.Idt+'" name="'+this.Idt+'" style="position:absolute;overflow:none;left:0px;top:0px;width:1px;height:1px;visibility:visible;" >\n';
  varContent+=JVSSoundPlayer_getContent(this);
  varContent+='</div>\n';
  this.Doc.writeln(varContent);
 }
}
//
function JVSSoundPlayer_setUrl(value)
{this.Src=(value.substring)?value:'';}
//
function JVSSoundPlayer_getUrl()
{return this.Src;}
//
function JVSSoundPlayer_start()
{return JVSSoundPlayer_startStop(this);}
//
function JVSSoundPlayer_autoStartUrl(value)
{this.setUrl(value);return JVSSoundPlayer_startStop(this);}
//
function JVSSoundPlayer_stop()
{return JVSSoundPlayer_stop(this);}
//
function JVSSoundPlayer_getElementById(id,doc)
{
 var varRtnObj=null;
 if((typeof(doc)=='object')&&(doc.getElementById))
 {varRtnObj=doc.getElementById(id);}
 return varRtnObj;
}
//
function JVSSoundPlayer_startStop(soundPlayer)
{
 varRtnObj=false;
 if(soundPlayer.PlaySrc==soundPlayer.Src){soundPlayer.Src='';}
 JVSSoundPlayer_reset(soundPlayer);varRtnObj=true;
 return varRtnObj;
}
//
function JVSSoundPlayer_reset(soundPlayer)
{
 var varTag=JVSSoundPlayer_getElementById(soundPlayer.Idt,soundPlayer.Doc);
 if(varTag!=null)
 {
  var varContent=JVSSoundPlayer_getContent(soundPlayer);
  varTag.innerHTML=varContent;
  soundPlayer.PlaySrc=soundPlayer.Src;
 }
}
//
function JVSSoundPlayer_getContent(soundPlayer)
{
 var varContent='&nbsp;'
 if((soundPlayer.Src!=null)&&(soundPlayer.Src.substring)&&(soundPlayer.Src.length>0))
 {
  varContent ='<embed width="1" height="1"';
  varContent+=' uimode="full"';
  varContent+=' controller="true"';
  varContent+=' autostart="true"';
  varContent+=' autoplay="true"';
  varContent+=' loop="true"';
  varContent+=' playcount="infinite"';
  varContent+=' volume="50"';
  varContent+=' src="'+soundPlayer.Src+'"';
  varContent+=' />\n';
 }else{soundPlayer.Src='';}
 return varContent;
}
//====================================================================
// --- SoundPlayer - Object - Properties
//====================================================================
JVSSoundPlayer.prototype.Cls=null;
JVSSoundPlayer.prototype.Idt=null;
JVSSoundPlayer.prototype.Doc=null;
JVSSoundPlayer.prototype.Src=null;
JVSSoundPlayer.prototype.PlaySrc=null;
//====================================================================
// --- SoundPlayer - Object (Methods)
//====================================================================
JVSSoundPlayer.prototype.write=JVSSoundPlayer_write;
JVSSoundPlayer.prototype.setUrl=JVSSoundPlayer_setUrl;
JVSSoundPlayer.prototype.getUrl=JVSSoundPlayer_getUrl;
JVSSoundPlayer.prototype.autoStartUrl=JVSSoundPlayer_autoStartUrl;
JVSSoundPlayer.prototype.stop=JVSSoundPlayer_stop;
JVSSoundPlayer.prototype.start=JVSSoundPlayer_start;
//********************************************************************
