document.write('<a href="JavaScript:void(0)" onClick="changesound();return false;"><img src="/francais/trainerc/audio/audio.gif" width="40" height="40" id="thissound" alt="sound" border="0" align="right" style="padding-left:10px;padding-right:10px;" /></a><small>Durch Klicken auf den<br />Lautsprecher lässt sich der Ton<br />ab- bzw. anstellen: </small>');
var sound=1;
var bild= new Array;
bild[0] = new Image;
bild[1] = new Image;
bild[0].src = "/francais/trainerc/audio/audio.gif";
bild[1].src = "/francais/trainerc/audio/noaudio.gif";

if (getCookie("audio")==0) {
  var thisplay = "false";
  sound=0;
  window.document.thissound.src=bild[1].src;
}
else {
  var thisplay = "true";
}

var mysound = new FlashSound();

function changesound() {
  if (sound==1) {
    sound = 0;
    mysound.stop('/');
    window.document.thissound.src=bild[1].src;
    setCookie("audio","0",0,"/");
  }
  else {
    sound = 1;
    mysound.play('/');
    window.document.thissound.src=bild[0].src;
    setCookie("audio","1",0,"/");
  }
}
function getCookie( name ) {
	var start = document.cookie.indexOf( name + "=" );
	var len = start + name.length + 1;
	if ( ( !start ) && ( name != document.cookie.substring( 0, name.length ) ) ) {
		return null;
	}
	if ( start == -1 ) return null;
	var end = document.cookie.indexOf( ';', len );
	if ( end == -1 ) end = document.cookie.length;
	return unescape( document.cookie.substring( len, end ) );
}

function setCookie( name, value, expires, path, domain, secure ) {
	var today = new Date();
	today.setTime( today.getTime() );
	if ( expires ) {
		expires = expires * 1000 * 60 * 60 * 24;
	}
	var expires_date = new Date( today.getTime() + (expires) );
	document.cookie = name+'='+escape( value ) +
		( ( expires ) ? ';expires='+expires_date.toGMTString() : '' ) + //expires.toGMTString()
		( ( path ) ? ';path=' + path : '' ) +
		( ( domain ) ? ';domain=' + domain : '' ) +
		( ( secure ) ? ';secure' : '' );
}

function deleteCookie( name, path, domain ) {
	if ( getCookie( name ) ) document.cookie = name + '=' +
			( ( path ) ? ';path=' + path : '') +
			( ( domain ) ? ';domain=' + domain : '' ) +
			';expires=Thu, 01-Jan-1970 00:00:01 GMT';
}
