function ToggleColourSelect(){
	if (colorselect.style.display=='none'){
		colorselect.style.display='block'; 
	}else{ 
		colorselect.style.display='none';
	};
};

function SelectColour(thecolor, bolswitch){

	thebgcolor = ''
	switch (thecolor){

    	case 1: { thebgcolor='#FFFFFF'; break }
    	case 2: { thebgcolor='#CCC599'; break }
    	case 3: { thebgcolor='#ADCC99'; break }
    	case 4: { thebgcolor='#99CCB9'; break }
    	case 5: { thebgcolor='#99BCCC'; break }
    	case 6: { thebgcolor='#99AFCC'; break }
    	case 7: { thebgcolor='#B699CC'; break }
    	case 8: { thebgcolor='#CC99CC'; break }
    	case 9: { thebgcolor='#CC9999'; break }
  	}

	document.bgColor = thebgcolor;

	if (bolswitch){

		ToggleColourSelect();
		Set_Cookie('bgcolour', thecolor, '30', '/', '', '' );
		document.getElementById("colorexample").src= '../images/colour_selector_' + thecolor + '.gif'
	}
}

function Set_Cookie( 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() : "" ) + 
( ( path ) ? ";path=" + path : "" ) + 
( ( domain ) ? ";domain=" + domain : "" ) +
( ( secure ) ? ";secure" : "" );
}