function doHtml() {
  $('ctrl_sound_player').hide();
  //Initialise audio - remove object and replace with file text
  var file = $('ctrl_sound_player_object').readAttribute('data');
  $('ctrl_sound_player').update(file);

  //PICTURE STUFF------------------------------------------
  //(try because no picture on homepage)
  try {
    $('picture').hide();
    new Effect.Move('picture', { x: -1000, y: 0, duration: 0.01 });
    $('picture').show();
    new Effect.Move('picture', { x: 1000, y: 0,
	  duration: 1.0,
	  queue: 'end' });
  } catch(err) {//no picture on homepage, so do nothing
  }

  //NAVIGATION BAR STUFF-------------------------------------
  //
  //first, turn audio off if cookie says so
  if (!checkCookie('sound')) {
    setCookie('sound','on');
  } else {
    setCookie('sound','off');
  }
  toggleAudio();

  //player events (mouseover/out)
  //  Event.observe('ctrl_sound', 'mouseover', function() {
  //$('ctrl_sound_player').setStyle({
  //  visibility: 'visible'
  //});
  //});
  //Event.observe('ctrl_sound', 'mouseout', function() {
  //$('ctrl_sound_player').setStyle({
  //  visibility: 'hidden'
  //});
  //});
  //add onclick player event
  $('ctrl_sound_text').update(
    '<a href="#" id="ctrl_sound_control"><img src="images/blank.gif" alt="Sound on/off" /></a>'
  );
  Event.observe('ctrl_sound_control', 'click', function(event) {
      event.stop();
      toggleAudio();
    });
  $('ctrl_sound').addClassName('image');//shift div up as it contains an image now rather than text
  $('ctrl_sound').addClassName('on');//turn highlighting on
  
  //'home' button - remove text
  if (!$('ctrl_home').hasClassName('current')) {
    $('ctrl_home_text').down('a').update(
      '<img src="images/blank.gif" alt="Home" />'
    );
    $('ctrl_home').addClassName('image');
  } else {
    $('ctrl_home_text').hide();
  }

  //'more info' button - remove text
  if ($('ctrl_more').hasClassName('active')) {
    $('ctrl_more_text').down('a').update(
      '<img src="images/blank.gif" alt="More Info" />'
    );
    $('ctrl_more').addClassName('image');
  } else {
    $('ctrl_more_text').hide();
  }
}

//hide player after everything has loaded, as firefox doesn't like it otherwise
//Event.observe(window, 'load', function() {
//$('ctrl_sound_player').setStyle({
//  visibility: 'hidden'
//});
//});

//FUNCTIONS------------------------------
function toggleAudio() {
  if (checkCookie('sound')) {//check if on or off at the moment, and adjust things accordingly
    Sound.enable();
    Sound.play('audio/blank.mp3',{replace:true});
    Sound.disable();
    $('ctrl_sound').removeClassName('on');
    $('ctrl_sound').addClassName('off');
    setCookie('sound','off');
  } else {
    Sound.enable();
    Sound.play($('ctrl_sound_player').innerHTML,{replace:true});
    $('ctrl_sound').removeClassName('off');
    $('ctrl_sound').addClassName('on');
    setCookie('sound','on');
 }
}

//cookie functions - fairly standard and self explanatory
function getCookie(c_name) {
	if (document.cookie.length>0) {
		c_start=document.cookie.indexOf(c_name + "=");
		if (c_start!=-1) {
			c_start=c_start + c_name.length+1; 
			c_end=document.cookie.indexOf(";",c_start);
			if (c_end==-1) c_end=document.cookie.length;
			return unescape(document.cookie.substring(c_start,c_end));
		}
	}
	return "";
}

function setCookie(c_name,value,expiredays) {
	var exdate=new Date();
	exdate.setDate(exdate.getDate()+expiredays);
	document.cookie=c_name+ "=" +escape(value)+
	((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}

function checkCookie(cName) {
	sound=getCookie(cName);
	if (sound=="off") {
		return false;
	}
	return true;
}
