/*Toggle Sound Script II © John Davenport Scheuer
  as first seen in www.dynamicdrive.com/forums (user name:
  jscheuer1). Visit http://www.dynamicdrive.com for 100's
  of DHTML scripts.  This credit must remain for legal use.
  */

var sndEl="/mp3/Purple_20Star_20Generic_20-_20Email.mp3"  //Set to name and path of your sound file
var music_on="/images/equalizer_anim02_on.gif"		//Set to image to display while music is on
var music_off="/images/equalizer_anim02_off.gif"	//Set to image to display while music is off
var active_img="/images/equalizer_anim02_hover.gif"	//Set to image to display while image is hovered

///////////////Stop Editing///////////////

var da=document.all
var preload=[music_on, music_off, active_img]
var preloading=new Array();
for (var i_tem = 0; i_tem < preload.length; i_tem++){
preloading[i_tem]=new Image();
preloading[i_tem].src=preload[i_tem]
}

function textReveal(el, state){
var text=da? da.text : document.getElementById('text')
text.style.visibility=state=='on'? 'visible' : ''
el.src=state=='on'? active_img : el.lowsrc
}

function setCookie(c_name,value,expiredays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}

function toggleSound(el){
var text=da? da.text : document.getElementById('text');
if (da&&da.sound&&da.sound.src!==''){
da.sound.src=''
el.lowsrc=music_off
text.innerHTML='Sound On'
}
else if (document.getElementById('snd')){
sndEl=document.getElementById('snd')
document.getElementById('sndC').removeChild(sndEl)
el.lowsrc=music_off
text.innerHTML='Sound On'
}
else if (da&&da.sound&&da.sound.src==''){
da.sound.src=sndEl
el.lowsrc=music_on
text.innerHTML='Sound Off'
}
else {
document.getElementById('sndC').appendChild(sndEl)
el.lowsrc=music_on
text.innerHTML='Sound Off'
}
}