function readSoundCookie(cName) {
	var cContent = document.cookie.split(";");
	for (i=0; i<cContent.length; i++) {
		cParts = cContent[i].split("=");
		if (cParts[0].charAt(0) == ' ') {
			cParts[0] = cParts[0].substring(1, cParts[0].length);
		}
		if (cParts[0] == cName) {
			return unescape(cParts[1]);
		}
	}
	return "null";
}

function setSoundCookie(name, wert) {
	var arg_wert = setSoundCookie.arguments;
	var arg_laenge = setSoundCookie.arguments.length;
	var expires = (arg_laenge > 2) ? arg_wert[2] : null;
	var path = (arg_laenge > 3) ? arg_wert[3] : null;
	var domain = (arg_laenge > 4) ? arg_wert[4] : null;
	var secure = (arg_laenge > 5) ? arg_wert[5] : null;
	document.cookie = name + "=" + escape(wert) +
		( ( expires ) ? ";expires=" + expires.toGMTString()*1000*60*60*3 : "" ) +
		( ";path=/" ) +
		( ( domain ) ? ";domain=" + domain : "" ) +
		( ( secure ) ? ";secure" : "" );		
}

function toggleSoundOnOff() {
	if(readSoundCookie('newArrivalsSound') != null) {
		if (readSoundCookie('newArrivalsSound') == 'false') {
			setSoundCookie('newArrivalsSound','true');
			// alert("getSoundOnOff = " + readSoundCookie('newArrivalsSound'));
		}
		else {
			setSoundCookie('newArrivalsSound','false');
			// alert("getSoundOnOff = " + readSoundCookie('newArrivalsSound'));
		}
	
	} else {
		setSoundCookie('newArrivalsSound','true');
		// alert("getSoundOnOff = " + readSoundCookie('newArrivalsSound'));
	}
}
