/*======================================================================*\
|| #################################################################### ||
|| # ---------------------------------------------------------------- # ||
|| # Copyright ©2007-2009 Fillip Hannisdal AKA Revan/NeoRevan/Belazor # ||
|| # All Rights Reserved. 											  # ||
|| # This file may not be redistributed in whole or significant part. # ||
|| # ---------------------------------------------------------------- # ||
|| # You are not allowed to use this on your server unless the files  # ||
|| # you downloaded were done so with permission.					  # ||
|| # ---------------------------------------------------------------- # ||
|| #################################################################### ||
\*======================================================================*/

// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################

vBShout_Sounds_Obj = function()
{
	// Object variables
	this.vbshout;
	this.instanceid;
	this.muted = new Array();
	
	// #########################################################################
	// Initialiser for the functionality within
	this.init = function(instanceid)
	{
		this.instanceid = instanceid;
		eval("this.vbshout = vBShout" + instanceid + ";");		
	}
	
	// #########################################################################
	// Play the sound
	this.play = function(type)
	{
		if (this.vbshout.idle && !this.vbshout.idlesounds)
		{
			return false;
		}
		
		try
		{
			// Set the player var
			var player = YAHOO.util.Dom.get('dbtech_vbshout_sound_' + type + '_' + this.instanceid);
			
			// Set the track
			player.SetVolume(100);
			
			// Play the noise
			player.Play();
		}
		catch(e) { }
	}
	
	// #########################################################################
	// Mute the sound	
	this.mute = function(type)
	{
		var mute = true;
		if (this.muted[type])
		{
			// It was already muted
			mute = false;
		}
		
		// Set the muted for this type
		this.muted[type] = mute;
		
		try
		{
			YAHOO.util.Dom.get('dbtech_vbshout_sound_' + type + '_' + this.instanceid).SetMute(mute);
		}
		catch(e) {}
		
	}
}

/*======================================================================*\
|| #################################################################### ||
|| # Created: 21:48, Fri Jan 1st 2010								  # ||
|| # SVN: $Rev$							 							  # ||
|| #################################################################### ||
\*======================================================================*/