function getCookie (name) { 
    var dc = document.cookie; 
    var cname = name + "="; 

    if (dc.length > 0) { 
      begin = dc.indexOf(cname); 
      if (begin != -1) { 
        begin += cname.length; 
        end = dc.indexOf("", begin);
        if (end == -1) end = dc.length;
        return unescape(dc.substring(begin, end));
        } 
      } 
    return null; 
}

function setCookie(name, value, expires) { 
document.cookie = name + "=" + escape(value) + "; path=/" + ((expires == null) ? "" : "; expires=" + expires.toGMTString()); 
} 

function delCookie(name) { 
document.cookie = name + "=; expires=Thu, 01-Jan-70 00:00:01 GMT" + "; path=/"; 
} 


var exp = new Date();     //set new date object 
exp.setTime(exp.getTime() + (1000 * 60 * 60 * 24 * 30));     //set it 30 days ahead


function Play1(set)
{
   if(set == "on")
   {
      document.getElementById("music1").innerHTML="<embed autostart='true' loop='true' src='/music_4.mp3' width=0 height=0><input name='sound' type='image' value='off' onClick='Play1(this.value)' src='/graphics/music_off.gif'>";
	  delCookie("music"); 
   }
   else
   {
      document.getElementById("music1").innerHTML="<embed autostart='false' loop='false' src='/music_4.mp3' width=0 height=0><input name='sound' type='image' value='on' onClick='Play1(this.value)' src='/graphics/music_on.gif'>";
	  setCookie('music','off', exp);
   }
}

musicstate = getCookie("music")

/*document.write(musicstate)*/

if(musicstate == null)
	{
		document.write("<span id='music1' style='text-align:left; float:left; padding-top:16px; '><embed autostart='true' loop='true' src='/music_4.mp3' width=0 height=0><input name='sound' type='image' value='off' onClick='Play1(this.value)' src='/graphics/music_off.gif'></span>");
	}
	else
	{
		document.write("<span id='music1' style='text-align:left; float:left; padding-top:16px; '><embed autostart='false' loop='false' src='/music_4.mp3' width=0 height=0><input name='sound' type='image' value='on' onClick='Play1(this.value)' src='/graphics/music_on.gif'></span>");
	}
