
var sndEl="musics/music.m4a"  //Set to name and path of your sound file
var music_on=""		//Set to image to display while music is on
var music_off=""	//Set to image to display while music is off
var active_img=""	//Set to image to display while image is hovered

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 toggleSound(el){
	var text=da? da.text : document.getElementById('text')
	if (da&&da.sound&&da.sound.src!==''){
		da.sound.src=''
		text.innerHTML=''
		text.innerHTML='&nbsp;Music On'
	}
	else if (document.getElementById('snd')){
		sndEl=document.getElementById('snd')
		document.getElementById('sndC').removeChild(sndEl)
		text.innerHTML=''
		text.innerHTML='&nbsp;Music On'
	}
	else if (da&&da.sound&&da.sound.src==''){
		da.sound.src=sndEl
		text.innerHTML=''
		text.innerHTML='&nbsp;Music Off'
	}
	else {
		document.getElementById('sndC').appendChild(sndEl)
		text.innerHTML=''
		text.innerHTML='&nbsp;Music Off'
	}
}
