function change_bg (value)
{	
	if(value=="toggle"){
		bodybg=get_cookie ("backg");
		var cookie_string = ""	
		//alert (bodybg);
		if(bodybg=="bg"){
			cookie_string = "backg=nobg"
		}
		else{
			cookie_string = "backg=bg"
		}		
		var current_date = new Date;
		var cookie_year = current_date.getFullYear ( );
		var cookie_month = current_date.getMonth ( ) + 1;
		var cookie_day = current_date.getDate ( );
		var expires = new Date ( cookie_year, cookie_month, cookie_day );
		cookie_string += "; expires=" + expires.toGMTString() + "; path=/";
		document.cookie = cookie_string;		
	}
	else{			
		var cookie_string = "class=" + escape ( value )
		var current_date = new Date;
		var cookie_year = current_date.getFullYear ( );
		var cookie_month = current_date.getMonth ( ) + 1;
		var cookie_day = current_date.getDate ( );
		var expires = new Date ( cookie_year, cookie_month, cookie_day );
		cookie_string += "; expires=" + expires.toGMTString() + "; path=/";
		document.cookie = cookie_string;
	}
	bodyclass=get_cookie ( "class" );
	bodybg=get_cookie ( "backg" );
	if(bodyclass==null){
		bodyclass="blue"
	}	
	if(bodybg==null){
		bodybg="nobg"
	}	
	document.body.className=bodyclass+bodybg;
}



function get_cookie ( cookie_name )
{
  var results = document.cookie.match ( '(^|;) ?' + cookie_name + '=([^;]*)(;|$)' );

  if ( results ) {
    return ( unescape ( results[2] ) );
  }
  else {
    return null;
  }
}

