<?php
	
	// User defined styles
	function serifly_custom_theme()
	{
		$customTheme = '<style type="text/css">';
		
		if (serifly_option('styling_color_link'))
		{
			$customTheme.= 'a, .contentWrapper a, .siteHeader .navigation li:hover a, .siteHeader .navigation li ul.dropdown li a:hover, .contentSlider .slideSwitch div.active, .siteFooter .column .columnNavigation li a { color: #' . serifly_option('styling_color_link') . ' !important; }';
			$customTheme.= '.siteHeader .navigation li a span { color: #fff; }';
			$customTheme.= 'a.colorButton, button, input[type="submit"] { color: #333; }';
		}
		
		if (serifly_option('styling_color_button'))
		{
			if (serifly_option('styling_color_button') == 'blue')
			{
				$customTheme.= 'a.colorButton, button, input[type="submit"] { color: #fff !important; text-shadow: 0 1px 0 #19537b !important; background: #2e709e url(' . get_template_directory_uri() . '/img/buttons/blueColorButton.png) left top no-repeat; }';
			}
			else if (serifly_option('styling_color_button') == 'green')
			{
				$customTheme.= 'a.colorButton, button, input[type="submit"] { color: #fff !important; text-shadow: 0 1px 0 #6a8110 !important; background: #86a11a url(' . get_template_directory_uri() . '/img/buttons/greenColorButton.png) left top no-repeat; }';
			}
			else if (serifly_option('styling_color_button') == 'red')
			{
				$customTheme.= 'a.colorButton, button, input[type="submit"] { color: #fff !important; text-shadow: 0 1px 0 #a10601 !important; background: #b60600 url(' . get_template_directory_uri() . '/img/buttons/redColorButton.png) left top no-repeat; }';
			}
			
			$customTheme.= 'a.colorButton span.pointer { background: transparent url(' . get_template_directory_uri() . '/img/buttons/colorButtonPointer.png) right center no-repeat; }';
		}
		
		if (serifly_option('styling_fixed_header'))
		{
			$customTheme.= 'siteHeaderShadow, .siteHeader { position: fixed; }';
			
			if (serifly_option('styling_color_set') == 'blue')
			{
				$customTheme.= '.siteHeader { background: #196ea9 url(' . get_template_directory_uri() . '/themes/blueHeader/img/layout/siteHeaderShadow.png) left top repeat-x; }';
			}
			else if (serifly_option('styling_color_set') == 'green')
			{
				$customTheme.= '.siteHeader { background: #7c9613 url(' . get_template_directory_uri() . '/themes/blueHeader/img/layout/siteHeaderShadow.png) left top repeat-x; }';
			}
			else if (serifly_option('styling_color_set') == 'red')
			{
				$customTheme.= '.siteHeader { background: #701614 url(' . get_template_directory_uri() . '/themes/blueHeader/img/layout/siteHeaderShadow.png) left top repeat-x; }';
			}
			else
			{
				$customTheme.= '.siteHeader { background: transparent url(' . get_template_directory_uri() . '/img/layout/siteFooterPattern.png) left top repeat }';
			}
		}
		
		if (serifly_option('styling_custom_css'))
		{
			$customTheme.= stripslashes(serifly_option('styling_custom_css'));
		}
		
		$customTheme.= '</style>';
		
		if ($customTheme != '<style type="text/css"></style>')
		{
			$customTheme = str_replace('  ', ' ', $customTheme);
			$customTheme = str_replace("\n", '', $customTheme);
			$customTheme = str_replace("\r", '', $customTheme);
			$customTheme = str_replace("\t", '', $customTheme);
		
			echo $customTheme . "\n";
		}
	}
	
?>