// JavaScript Document
	function bgchangecol(id, col) { //function used to swap the background colour of an element
		var item = $(id);
		
		var colours = new Array();
		colours['topmenuover'] = '#FF335F';
		colours['topmenuout'] = 'none';
		
		if (colours[col] != null) {
			col = colours[col];
		}
		
		item.style.background = col;	
		
	}
	
	/* 
	TOPMENU IMAGE PRELOAD CODE
	TOPMENU IMAGE PRELOAD CODE
	TOPMENU IMAGE PRELOAD CODE
	*/
	
	var topmenuIDs = new Array(10);
	
		topmenuIDs[0] = 'countryside';
		topmenuIDs[1] = 'things';
		topmenuIDs[2] = 'farm';
		topmenuIDs[3] = 'display';
		topmenuIDs[4] = 'wherefrom';
		topmenuIDs[5] = 'weather';
		topmenuIDs[6] = 'creepy';
		topmenuIDs[7] = 'fourlegged';
		topmenuIDs[8] = 'feathered';
		topmenuIDs[9] = 'greenfingers';

	var topmenuImgs = new Array(10);
	
	for (var i = 0; i < topmenuIDs.length; i++) {
		topmenuImgs[i] = 'images/topmenu/' + topmenuIDs[i] + '-hover.gif';
	}
	
	function preloadTopmenuImgs() {
		var tmp = null;
		for (var j = 0; j < topmenuImgs.length; j++) {
			tmp = topmenuImgs[j];
			topmenuImgs[j] = new Image();
			topmenuImgs[j].src = tmp;
		}
	}
	void(preloadTopmenuImgs());
	
	function topmenuChangeImage(state, num) {
		
		var item = $(topmenuIDs[num]);
		var imgname = null;
		
		if (state == 'hover') {
			imgname = topmenuImgs[num].src;
		}
		if (state == 'out') {
			imgname = 'images/topmenu/' + topmenuIDs[num] + '.gif';
		}
		
		item.style.background = 'url(' + imgname + ')';
		item.style.backgroundRepeat = 'no-repeat';
	
	}
	/*
	END OF TOPMENU IMAGE PRELOAD CODE
	END OF TOPMENU IMAGE PRELOAD CODE
	END OF TOPMENU IMAGE PRELOAD CODE
	*/
	
	//Media bar selected section highlighting
	function highlight_selected_media(selected_media) {

	if (selected_media == '' || selected_media == null) {
		selected_media = 'info';
	}

	var selected_item = $('media_' + selected_media);
	selected_item.className = 'highlightMediaSelected';
	}

	//Sidemenu image code
	sidemenuImg = new Image();
	sidemenuImg.src = 'images/navmenu/navmenu-button-hover.gif';
	
	function sidemenuChangeImage(state, elem) {
		
		var item = $(elem);
	
		if (state == 'hover') {
			imgname = sidemenuImg.src
		}
		if (state == 'out') {
			imgname = 'images/navmenu/navmenu-button.gif';
		}
		
		item.style.background = 'url(' + imgname + ')';
		item.style.backgroundRepeat = 'repeat-x';
	
	}
			