<?php
/**
 * @package WordPress
 * @subpackage Light
 */

$themecolors = array(
	'bg' => 'ffffff',
	'text' => '656565',
	'link' => '707070',
	'border' => 'c9d9e6',
	'url' => '516f86',
);

// actually 483px
$content_width = 480;

function light_body_class( $classes, $class ) {
	return $class;
}

add_filter( 'body_class', 'light_body_class', 1, 2 );

if ( function_exists( 'register_sidebars' ) )
	register_sidebars( 1 );

add_theme_support( 'automatic-feed-links' );

add_custom_background();

register_nav_menus( array(
	'primary' => __( 'Primary Navigation', 'light' ),
) );

/**
 * Enqueue scripts and styles
 */
function light_scripts() {
	wp_enqueue_style( 'light', get_stylesheet_uri() );

	if ( is_singular() && comments_open() && get_option( 'thread_comments' ) )
		wp_enqueue_script( 'comment-reply' );
}
add_action( 'wp_enqueue_scripts', 'light_scripts' );

function light_page_menu() {
	$pg_li = '';
	// fallback for primary navigation ?>
<ul class="navigation">
	<?php if ( is_home() || is_front_page() ) { $pg_li .="current_page_item"; } ?>
	<li class="<?php echo esc_attr( $pg_li ); ?>"><a href="<?php bloginfo( 'url' ); ?>" title="Blog"><span><?php esc_html_e( 'Blog' ); ?></span></a></li>
	<?php wp_list_pages( 'depth=1&title_li=&link_before=<span>&link_after=</span>' ); ?>
</ul>
<?php }

function light_comment($comment, $args, $depth) {
	$GLOBALS['comment'] = $comment;
	extract($args, EXTR_SKIP);
?>

<li <?php comment_class(empty( $args['has_children'] ) ? '' : 'parent') ?> id="comment-<?php comment_ID() ?>">
<div id="div-comment-<?php comment_ID() ?>">
	<div class="commentname comment-author vcard">
	<?php if ($args['avatar_size'] != 0) echo get_avatar( $comment, $args['avatar_size'] ); ?>
		<span class="fn"><?php comment_author_link()?></span>
		on
		<span class="comment-meta commentmetadata">
		<?php comment_date() ?>
		<?php edit_comment_link(__("Edit This"), ''); ?>
		</span>
	</div>
	<?php if ($comment->comment_approved == '0') : ?>
	<em><?php _e('Your comment is awaiting moderation.'); ?></em>
	<?php endif; ?>
	<div class='commenttext'>
		<div class="commentp">
			<?php comment_text();?>
		</div>
	</div>
	<div class="reply">
	<?php comment_reply_link(array_merge( $args, array('add_below' => 'div-comment', 'depth' => $depth, 'max_depth' => $args['max_depth']))) ?>
	</div>
</div>
<?php
}

/**
 * Filters wp_title to print a neat <title> tag based on what is being viewed.
 *
 * @since Light 1.1
 */
function light_wp_title( $title, $sep ) {
	global $page, $paged;

	if ( is_feed() )
		return $title;

	// Add the blog name
	$title .= get_bloginfo( 'name' );

	// Add the blog description for the home/front page.
	$site_description = get_bloginfo( 'description', 'display' );
	if ( $site_description && ( is_home() || is_front_page() ) )
		$title .= " $sep $site_description";

	// Add a page number if necessary:
	if ( $paged >= 2 || $page >= 2 )
		$title .= " $sep " . sprintf( __( 'Page %s', 'light' ), max( $paged, $page ) );

	return $title;
}
add_filter( 'wp_title', 'light_wp_title', 10, 2 );