function playSound(soundSource)
{
	var sound2Embed = null;
	sound2Embed = document.createElement("embed");
	sound2Embed.setAttribute("src", soundSource);
	sound2Embed.setAttribute("hidden", true);
	sound2Embed.setAttribute("autostart", true);
	document.body.appendChild(sound2Embed);
}

function playDingSound()
{
	var soundSource = new Array();
	var soundName= new Array();
	
	//sound name and source map by number
	soundName[0]='ding';
	soundName[1]='chime';
	soundName[2]='breakingGlass';
	soundName[3]='pop';
	soundName[4]='click';

	soundSource[0]='http://llpromo.bidz.com/sound/ding.wav';
	soundSource[1]='http://llpromo.bidz.com/sound/wine_glass_1.wav';
	soundSource[2]='http://llpromo.bidz.com/sound/glass_breaking_1.wav';
	soundSource[3]='http://llpromo.bidz.com/sound/bottle_pop_2.wav';
	soundSource[4]='http://llpromo.bidz.com/sound/stapler_1.wav';

	//var dropDown = document.getElementById('bidAlert');
	var selectedSound = getBidSoundFromCookie();
	//alert("playDingSound - selectedSound: *" + selectedSound + "*");
	if (selectedSound !='')
	{
		var soundSourceToPlay="";
		if (selectedSound !="off")
		{
		
			for(var i = 0; i <soundName.length; i++)
			{
				if (soundName[i]==selectedSound)
				{
					soundSourceToPlay=soundSource[i];
				}
			}
			playSound(soundSourceToPlay);
		}
	}
}	

function selectBidSound()
{
	var bidSoundFromCookie = getBidSoundFromCookie();
	//alert("selectBidSound - preloaded bid sound value: " + bidSoundFromCookie);	
	var bidList = $('#bidAlert');
	if (bidSoundFromCookie!="")
	{
		bidList.val(bidSoundFromCookie);
	}//if bid sound is set in cookie, retrieve it
	else
	{
		//if sound is not set set it to ding
		bidList.val(5);
		//alert("selectBidSound - no preloaded bid sound exists.");
	}
}

function setBidSound(soundVal)
{
	//alert("setBidSound - setting cookie: " + soundVal);
	setBidzCookie('bidSound',soundVal,365);
}

function getBidSoundFromCookie()
{
	var cookieVal = getCookie('bidSound');
	//alert("getBidSoundFromCookie - getting sound val: " + cookieVal);
	return cookieVal;
}

function playFireworksSound(country)
{
	country = country.toUpperCase();
	
	var soundSource = new Array();
	var soundName= new Array();
	
	soundName[0]='AA';
	soundName[1]='AU';
	soundName[2]='BE';
	soundName[3]='CA';
	soundName[4]='CH';
	soundName[5]='DE';
	soundName[6]='DK';
	soundName[7]='EG';
	soundName[8]='ES';
	soundName[9]='GB';
	soundName[10]='IE';
	soundName[11]='IL';
	soundName[12]='IT';
	soundName[13]='JP';
	soundName[14]='LT';
	soundName[15]='MD';
	soundName[16]='NL';
	soundName[17]='NO';
	soundName[18]='NZ';
	soundName[19]='PR';
	soundName[20]='RU';
	soundName[21]='SA';
	soundName[22]='SE';
	soundName[23]='SG';
	soundName[24]='TW';
	soundName[25]='US';
	soundName[26]='UZ';
	soundName[27]='ZA';
	
	soundSource[0]='http://llpromo.bidz.com/sound/AA.mp3';
	soundSource[1]='http://llpromo.bidz.com/sound/AU.mp3';
	soundSource[2]='http://llpromo.bidz.com/sound/BE.mp3';
	soundSource[3]='http://llpromo.bidz.com/sound/CA.mp3';
	soundSource[4]='http://llpromo.bidz.com/sound/CH.mp3';
	soundSource[5]='http://llpromo.bidz.com/sound/DE.mp3';
	soundSource[6]='http://llpromo.bidz.com/sound/DK.mp3';
	soundSource[7]='http://llpromo.bidz.com/sound/EG.mp3';
	soundSource[8]='http://llpromo.bidz.com/sound/ES.mp3';
	soundSource[9]='http://llpromo.bidz.com/sound/GB.mp3';
	soundSource[10]='http://llpromo.bidz.com/sound/IE.mp3';
	soundSource[11]='http://llpromo.bidz.com/sound/IL.mp3';
	soundSource[12]='http://llpromo.bidz.com/sound/IT.mp3';
	soundSource[13]='http://llpromo.bidz.com/sound/JP.mp3';
	soundSource[14]='http://llpromo.bidz.com/sound/LT.mp3';
	soundSource[15]='http://llpromo.bidz.com/sound/MD.mp3';
	soundSource[16]='http://llpromo.bidz.com/sound/NL.mp3';
	soundSource[17]='http://llpromo.bidz.com/sound/NO.mp3';
	soundSource[18]='http://llpromo.bidz.com/sound/NZ.mp3';
	soundSource[19]='http://llpromo.bidz.com/sound/PR.mp3';
	soundSource[20]='http://llpromo.bidz.com/sound/RU.mp3';
	soundSource[21]='http://llpromo.bidz.com/sound/SA.mp3';
	soundSource[22]='http://llpromo.bidz.com/sound/SE.mp3';
	soundSource[23]='http://llpromo.bidz.com/sound/SG.mp3';
	soundSource[24]='http://llpromo.bidz.com/sound/TW.mp3';
	soundSource[25]='http://llpromo.bidz.com/sound/US.mp3';
	soundSource[26]='http://llpromo.bidz.com/sound/UZ.mp3';
	soundSource[27]='http://llpromo.bidz.com/sound/ZA.mp3';
	
	//alert("playFireworksSound - country: " + country);
	
	if (country !='')
	{
		for(var i = 0; i <soundName.length; i++)
		{
			if (soundName[i]==country)
			{
				//alert("playFireworksSound - playing sound for: " + country + " source: " + soundSource[i]);
				playSound(soundSource[i]);
				break;
			}
		}
	}
	
	
}//END: playAnthen
