function CH_ToggleView( type ) {
	
	switch(type) {
		case 'basic':
			var areaShow = document.getElementById( "basicView" );
			var optionsShow = document.getElementById( "basicViewOptions" );			
			var areaHide = document.getElementById( "detailedView" );
			var optionsHide = document.getElementById( "detailedViewOptions" );
			break;
		case 'detailed':
			var areaShow = document.getElementById( "detailedView" );
			var optionsShow = document.getElementById( "detailedViewOptions" );			
			var areaHide = document.getElementById( "basicView" );
			var optionsHide = document.getElementById( "basicViewOptions" );
			break;
	}	

	if(areaShow){
		areaShow.style.display = "block";
	}
	if(optionsShow){
		optionsShow.style.display = "inline";
	}
	if(areaHide){
		areaHide.style.display = "none";
	}
	if(optionsHide){
		optionsHide.style.display = "none";
	}
	CH_SetCookie( "display", type );
	
}

function CH_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() : "" ) + 
	( ( path ) ? ";path=" + path : "" ) + 
	( ( domain ) ? ";domain=" + domain : "" ) +
	( ( secure ) ? ";secure" : "" );
}
