var AUDIO_MAN=new Object();
AUDIO_MAN['n'] = 0;
AUDIO_MAN['last_obj'] = null;
function setupAudio(obj,url)
{
	obj.id = 'audio-'+AUDIO_MAN['n'];
	obj.url = url;
	obj.onmousedown=manAudio;
	obj.onmouseover=hoverAudio;
	obj.onmouseout=hoverAudio;
	AUDIO_MAN['n']++;
}
function hoverAudio(e)
{
	if( !this.src.match(/stop2/) )
	{
		if( this.src.match(/_on/) )
			this.src = TMPLVARS['prefix']['img_shared']+'play2.gif'+TMPLVARS['suffix']['img_shared'];
		else
			this.src = TMPLVARS['prefix']['img_shared']+'play2_on.gif'+TMPLVARS['suffix']['img_shared'];
	}
}
function manAudio(e)
{
	if( AUDIO_MAN['last_obj'] != null )
	{
		document['audioman'].am_stop();
		AUDIO_MAN['last_obj'].src = TMPLVARS['prefix']['img_shared']+'play2_on.gif'+TMPLVARS['suffix']['img_shared'];
	}
	if(AUDIO_MAN['last_obj'] == null || this.id != AUDIO_MAN['last_obj'].id)
	{
		document['audioman'].am_loadSound(this.url, true);
		document['audioman'].am_start();
		this.src = TMPLVARS['prefix']['img_shared']+'stop2.gif'+TMPLVARS['suffix']['img_shared'];
		if( AUDIO_MAN['last_obj'] != null )
			AUDIO_MAN['last_obj'].src = TMPLVARS['prefix']['img_shared']+'play2.gif'+TMPLVARS['suffix']['img_shared'];
		AUDIO_MAN['last_obj'] = this;
	}
	else
	{
		AUDIO_MAN['last_obj'] = null;
	}
}
