// JavaScript Document
var as="Y";
/**/
function controlSound(x, _sndObj, sndFile) { 
 /* */ var i, method = "", sndObj = eval(_sndObj);
  if (sndObj != null) {
    if (navigator.appName == 'Netscape') method = "play";
    else {
      if (window.MM_WMP == null) {
        window.MM_WMP = false;
        for(i in sndObj) if (i == "ActiveMovie") {
          window.MM_WMP = true; break;
      } }
      if (window.MM_WMP) method = "play";
      else if (sndObj.FileName) method = "run";
  } }
  if (method) eval(_sndObj+"."+method+"()");
  //else window.location = sndFile;
 //document.CS1163587144006.play(); 
}

function play(){
	if((readCookie("sound")=="Y" || readCookie("sound")=="") && as!="N"){
		controlSound('play','document.CS1163587144006','/images/111.wav');
		//controlSound();
	}else{
		return false;
	}
}

function allowSound(){
var i=document.getElementById("soundim");
	if(i.src=="http://zolotoyulov.ru/images/header/dissound.gif"){
		i.src="/images/header/ensound.gif";
		i.alt="Выключить звук меню.";
		writeCookie("sound", "Y", 8928);
		as="Y";
	}else{
		i.src="/images/header/dissound.gif";
		i.alt="Включить звук меню.";
		writeCookie("sound", "N", 8928);
		as="N";
	}

}

function writeCookie(name, value, hours){
var expire = "";
  if(hours != null){
    expire = new Date((new Date()).getTime() + hours * 3600000);
    expire = "; expires=" + expire.toGMTString();
  }
  document.cookie = name + "=" + escape(value) + expire + "; path=/";
}

function readCookie(name){
var cookieValue = "";
var search = name + "=";
  if(document.cookie.length > 0){ 
    offset = document.cookie.indexOf(search);
    if (offset != -1){ 
      offset += search.length;
      end = document.cookie.indexOf(";", offset);
      if (end == -1) end = document.cookie.length;
      cookieValue = unescape(document.cookie.substring(offset, end))
    }
  }
  return cookieValue;
}


