<?php
if (!isset($content_width))
	$content_width = 675;

function the_category_html5($output)
{
	return str_replace('rel="category tag"', 'rel="tag"', $output);
}
add_filter('the_category', 'the_category_html5');

function powerhouse_sidebars() {
	register_sidebar(array("name"=>"Footer Left", "tagline"=>"Left side of the footer"));
	register_sidebar(array("name"=>"Footer Right", "tagline"=>"Right side of the footer"));
}
add_action('widgets_init', 'powerhouse_sidebars');

function powerhouse_menu() {
	register_nav_menu("Header", "Header menu");
}
add_action('init', 'powerhouse_menu');

add_theme_support("automatic-feed-links");
/*
define("HEADER_TEXTCOLOR", "EEEEEE");
define("HEADER_IMAGE", "%s/images/logo_960x100.jpg");
define("HEADER_IMAGE_WIDTH", 960);
define("HEADER_IMAGE_HEIGHT", 100);
*/
function powerhouse_header_style() {
	?>
		<style type="text/css">
			#title {
				min-height: <?php echo HEADER_IMAGE_HEIGHT; ?>px;
			}

			<?php if (get_header_image()) { ?>
				#title {
					background: url(<?php header_image(); ?>) repeat-x top left;
				}
			<?php }

			if (get_header_textcolor() != "blank") { ?>
				#title {
					color: #<?php header_textcolor(); ?>;
				}
			 <?php } else { ?>
				#title h1, #description {
					visibility: hidden;
				 }
			<?php } ?>

			@media only screen and (max-device-width: 480px) {
				#title {
					min-height: <?php echo HEADER_IMAGE_HEIGHT/2; ?>px;
					background-size: <?php echo HEADER_IMAGE_WIDTH/2; ?>px <?php echo HEADER_IMAGE_HEIGHT/2; ?>px;
				}
			}
		</style>
	<?php
}

function powerhouse_admin_header_style() {
	?>
		<style type="text/css">
			#headimg {
				background-color: black;
				min-height: <?php echo HEADER_IMAGE_HEIGHT; ?>px;
				text-align: center;
				text-shadow: 0 0 3px black;
				font-family: Georgia, serif;
				font-weight: bold;
				overflow: hidden;
			}

			#name {
				font-size: 18px;
			}

			#desc {
				font-size: 16px;
			}

			#headimg h1 a:link	{
				text-decoration: none;
			}

			#headimg h1 a:hover {
				text-decoration: underline;
			}
		</style>
	<?php
}

$args = array(
	'flex-width'    => true,
	'width'         => 960,
	'flex-height'    => true,
	'height'        => 100,
	'default-image' => get_template_directory_uri() . '/images/logo_960x100.jpg',
);
add_theme_support( 'custom-header', $args );
?>
