function Sound(name)
{	this.url = '/sound/';
	this.ext = '.swf';
	this.file = '';
	this.name = name;
	this.after = false;
	this.delay = false;

	var me = this;

	this.play = function(n,f,d)
	{		if(wSettings.sound_off)
		{
		    if(f) f();
		    return;
		}
		if(n) this.file = n;
		this.after = f ? f : false;
		this.delay = d ? d : false;
		this.start();	}

	this.start = function()
	{		if(wSettings.sound_off) return;
		$_($(this.name));
		var el = document.createElement('embed');
		el.id = this.name;
		if(!IE6){el.width = 0; el.height = 0;}
		else {el.width = 1; el.height = 1;}
		el.src = this.url+this.file+this.ext;

		document.body.appendChild(el);
		if(this.after)
		{
		    if(this.delay)
		        window.setTimeout(this.after,this.delay);
		    else this.after();
		}
	}

	this.stop = function()
	{
		$(this.name).src = '';	}}

window.sound = new Sound('index_sound');
