<?php
//first thing load options
global $ap_options;
$ap_options = get_option('ap_cleanroar_options');

//then register sidebars and widget areas
if ( function_exists('register_sidebars') ){
	$sbpos = $ap_options['sbpos'];
	if (in_array($sbpos,array('snright','snleft'))){
		register_sidebar(array('name'=> 'Wide Sidebar','description' => 'This sidebar is 340px wide.'));
	}else{
		register_sidebar(array('name'=> 'Wide Sidebar','description' => 'This sidebar is 195px wide.'));
		register_sidebar(array('name'=> 'Thin Sidebar','description' => 'This sidebar is 125px wide.'));
	}
	//reserve this for future
	//register_sidebar(array('name'=> 'Top Sidebar','description' => 'This sidebar is 335px wide. It will only appear if both sidebars (Thin and Wide) are on the same side.'));
}

include_once (TEMPLATEPATH. '/utilities/ap_autoinclude.php');

add_action('wp_head','ap_cleanroar_custom_css',999);
function ap_cleanroar_custom_css(){
	global $ap_options;
	$css = $ap_options['css'];
	if (!$css) return;
	
	echo "
<style type='text/css'>
	/*<![CDATA[*/
	$css
	/*]]>*/
</style>
\n";
	
}

    
?>