<?php global $color, $theme_options;
$fontelements = '.font, #slider .nivo-caption p'; ?>

<?php if ($theme_options['cp_font'] == 'Terminal Dosis Light') { ?>
<link href='http://fonts.googleapis.com/css?family=Terminal+Dosis+Light' rel='stylesheet' type='text/css'>
<style type="text/css">
	<?php echo $fontelements; ?> { font-family: 'Terminal Dosis Light', arial, serif; }
</style>

<?php } elseif ($theme_options['cp_font'] == 'EB Garamond') { ?>
<link href='http://fonts.googleapis.com/css?family=EB+Garamond' rel='stylesheet' type='text/css'>
<style type="text/css">
	<?php echo $fontelements; ?> { font-family: 'EB Garamond', arial, serif; }
</style>

<?php } elseif ($theme_options['cp_font'] == 'Quattrocento') { ?>
<link href='http://fonts.googleapis.com/css?family=Quattrocento' rel='stylesheet' type='text/css'>
<style type="text/css">
	<?php echo $fontelements; ?> { font-family: 'Quattrocento', arial, serif; }
</style>

<?php } elseif ($theme_options['cp_font'] == 'PT Sans') { ?>
<link href='http://fonts.googleapis.com/css?family=PT+Sans:regular,italic,bold,bolditalic' rel='stylesheet' type='text/css'>
<style type="text/css">
	<?php echo $fontelements; ?> { font-family: 'PT Sans', arial, serif; }
</style>

<?php } elseif ($theme_options['cp_font'] == 'Cuprum') { ?>
<link href='http://fonts.googleapis.com/css?family=Cuprum' rel='stylesheet' type='text/css'>
<style type="text/css">
	<?php echo $fontelements; ?> { font-family: 'Cuprum', arial, serif; }
</style>

<?php } elseif ($theme_options['cp_font'] == 'Goudy Bookletter 1911') { ?>
<link href='http://fonts.googleapis.com/css?family=Goudy+Bookletter+1911' rel='stylesheet' type='text/css'>
<style type="text/css">
	<?php echo $fontelements; ?> { font-family: 'Goudy Bookletter 1911', arial, serif; }
</style>

<?php } elseif ($theme_options['cp_font'] == 'Droid Serif') { ?>
<link href='http://fonts.googleapis.com/css?family=Droid+Serif:regular,italic,bold,bolditalic' rel='stylesheet' type='text/css'>
<style type="text/css">
	<?php echo $fontelements; ?> { font-family: 'Droid Serif', arial, serif; }
</style>

<?php } elseif ($theme_options['cp_font'] == 'Josefin Sans') { ?>
<link href='http://fonts.googleapis.com/css?family=Josefin+Sans:regular,regularitalic,bold,bolditalic' rel='stylesheet' type='text/css'>
<style type="text/css">
	<?php echo $fontelements; ?> { font-family: 'Josefin Sans', arial, serif; }
</style>

<?php } elseif ($theme_options['cp_font'] == 'Arimo') { ?>
<link href='http://fonts.googleapis.com/css?family=Arimo:regular,italic,bold,bolditalic' rel='stylesheet' type='text/css'>
<style type="text/css">
	<?php echo $fontelements; ?> { font-family: 'Arimo', arial, serif; }
</style>

<?php } elseif ($theme_options['cp_font'] == 'Raleway') { ?>
<link href='http://fonts.googleapis.com/css?family=Raleway:100' rel='stylesheet' type='text/css'>
<style type="text/css">
	<?php echo $fontelements; ?> { font-family: 'Raleway', arial, serif; }
</style>

<?php } elseif ($theme_options['cp_font'] == 'Neuton') { ?>
<link href='http://fonts.googleapis.com/css?family=Neuton:regular,italic' rel='stylesheet' type='text/css'>
<style type="text/css">
	<?php echo $fontelements; ?> { font-family: 'Neuton', arial, serif; }
</style>

<?php } elseif ($theme_options['cp_font'] == 'Allerta') { ?>
<link href='http://fonts.googleapis.com/css?family=Allerta' rel='stylesheet' type='text/css'>
<style type="text/css">
	<?php echo $fontelements; ?> { font-family: 'Allerta', arial, serif; }
</style>

<?php } elseif ($theme_options['cp_font'] == 'Lato') { ?>
<link href='http://fonts.googleapis.com/css?family=Lato:regular,regularitalic,bold,bolditalic' rel='stylesheet' type='text/css'>
<style type="text/css">
	<?php echo $fontelements; ?> { font-family: 'Lato', arial, serif; }
</style>

<?php } elseif ($theme_options['cp_font'] == 'Ubuntu') { ?>
<link href='http://fonts.googleapis.com/css?family=Ubuntu:regular,italic,bold,bolditalic' rel='stylesheet' type='text/css'>
<style type="text/css">
	<?php echo $fontelements; ?> { font-family: 'Ubuntu', arial, serif; }
</style>

<?php } elseif ($theme_options['cp_font'] == 'Yanone Kaffeesatz') { ?>
<link href='http://fonts.googleapis.com/css?family=Yanone+Kaffeesatz:regular,bold' rel='stylesheet' type='text/css'>
<style type="text/css">
	<?php echo $fontelements; ?> { font-family: 'Yanone Kaffeesatz', arial, serif; }
</style>

<?php } elseif ($theme_options['cp_font'] == 'Tinos') { ?>
<link href='http://fonts.googleapis.com/css?family=Tinos:regular,italic,bold,bolditalic' rel='stylesheet' type='text/css'>
<style type="text/css">
	<?php echo $fontelements; ?> { font-family: 'Tinos', arial, serif; }
</style>

<?php } elseif ($theme_options['cp_font'] == 'Puritan') { ?>
<link href='http://fonts.googleapis.com/css?family=Puritan:regular,italic,bold,bolditalic' rel='stylesheet' type='text/css'>
<style type="text/css">
	<?php echo $fontelements; ?> { font-family: 'Puritan', arial, serif; }
</style>

<?php } elseif ($theme_options['cp_font'] == 'Cousine') { ?>
<link href='http://fonts.googleapis.com/css?family=Cousine:regular,italic,bold,bolditalic' rel='stylesheet' type='text/css'>
<style type="text/css">
	<?php echo $fontelements; ?> { font-family: 'Cousine', arial, serif; }
</style>

<?php } elseif ($theme_options['cp_font'] == 'Droid Sans') { ?>
<link href='http://fonts.googleapis.com/css?family=Droid+Sans:regular,bold' rel='stylesheet' type='text/css'>
<style type="text/css">
	<?php echo $fontelements; ?> { font-family: 'Droid Sans', arial, serif; }
</style>

<?php } elseif ($theme_options['cp_font'] == 'Vollkorn') { ?>
<link href='http://fonts.googleapis.com/css?family=Vollkorn:regular,italic,bold,bolditalic' rel='stylesheet' type='text/css'>
<style type="text/css">
	<?php echo $fontelements; ?> { font-family: 'Vollkorn', arial, serif; }
</style>

<?php } elseif ($theme_options['cp_font'] == 'Anonymous Pro') { ?>
<link href='http://fonts.googleapis.com/css?family=Anonymous+Pro:regular,italic,bold,bolditalic' rel='stylesheet' type='text/css'>
<style type="text/css">
	<?php echo $fontelements; ?> { font-family: 'Anonymous Pro', arial, serif; }
</style>

<?php } elseif ($theme_options['cp_font'] == 'Droid Sans Mono') { ?>
<link href='http://fonts.googleapis.com/css?family=Droid+Sans+Mono' rel='stylesheet' type='text/css'>
<style type="text/css">
	<?php echo $fontelements; ?> { font-family: 'Droid Sans Mono', arial, serif; }
</style>

<?php } elseif ($theme_options['cp_font'] == 'Cantarell') { ?>
<link href='http://fonts.googleapis.com/css?family=Cantarell:regular,italic,bold,bolditalic' rel='stylesheet' type='text/css'>
<style type="text/css">
	<?php echo $fontelements; ?> { font-family: 'Cantarell', arial, serif; }
</style>

<?php } elseif ($theme_options['cp_font'] == 'Nobile') { ?>
<link href='http://fonts.googleapis.com/css?family=Nobile:regular,italic,bold,bolditalic' rel='stylesheet' type='text/css'>
<style type="text/css">
	<?php echo $fontelements; ?> { font-family: 'Nobile', arial, serif; }
</style>

<?php } elseif ($theme_options['cp_font'] == 'Inconsolata') { ?>
<link href='http://fonts.googleapis.com/css?family=Inconsolata' rel='stylesheet' type='text/css'>
<style type="text/css">
	<?php echo $fontelements; ?> { font-family: 'Inconsolata', arial, serif; }
</style>

<?php } elseif ($theme_options['cp_font'] == 'OFL Sorts Mill Goudy TT') { ?>
<link href='http://fonts.googleapis.com/css?family=OFL+Sorts+Mill+Goudy+TT:regular,italic' rel='stylesheet' type='text/css'>
<style type="text/css">
	<?php echo $fontelements; ?> { font-family: 'OFL Sorts Mill Goudy TT', arial, serif; }
</style>

<?php } elseif ($theme_options['cp_font'] == 'Molengo') { ?>
<link href='http://fonts.googleapis.com/css?family=Molengo' rel='stylesheet' type='text/css'>
<style type="text/css">
	<?php echo $fontelements; ?> { font-family: 'Molengo', arial, serif; }
</style>

<?php } elseif ($theme_options['cp_font'] == 'Crimson Text') { ?>
<link href='http://fonts.googleapis.com/css?family=Crimson+Text:regular,regularitalic,bold,bolditalic' rel='stylesheet' type='text/css'>
<style type="text/css">
	<?php echo $fontelements; ?> { font-family: 'Crimson Text', arial, serif; }
</style>

<?php } elseif ($theme_options['cp_font'] == 'Cardo') { ?>
<link href='http://fonts.googleapis.com/css?family=Cardo' rel='stylesheet' type='text/css'>
<style type="text/css">
	<?php echo $fontelements; ?> { font-family: 'Cardo', arial, serif; }
</style>

<?php } elseif ($theme_options['cp_font'] == 'Josefin Slab') { ?>
<link href='http://fonts.googleapis.com/css?family=Josefin+Slab:regular,regularitalic,bold,bolditalic' rel='stylesheet' type='text/css'>
<style type="text/css">
	<?php echo $fontelements; ?> { font-family: 'Josefin Slab', arial, serif; }
</style>

<?php } elseif ($theme_options['cp_font'] == 'Kreon') { ?>
<link href='http://fonts.googleapis.com/css?family=Kreon:regular,bold' rel='stylesheet' type='text/css'>
<style type="text/css">
	<?php echo $fontelements; ?> { font-family: 'Kreon', arial, serif; }
</style>

<?php } elseif ($theme_options['cp_font'] == 'Georgia') { ?>
<style type="text/css">
	<?php echo $fontelements; ?> { font-family: Georgia, "Times New Roman", Times, serif; }
</style>

<?php } elseif ($theme_options['cp_font'] == 'Junction') { ?>
<script type="text/javascript">
jQuery(document).ready(function($){
	// Cufon font replacement & text shadows
	Cufon.replace('#sidebar .font, #content .post .font, #card-container .font, #frontwidgets h3, #gallery .gal_item .font',{ fontFamily: 'Junction', textShadow: '#fff 0px 1px' });
	Cufon.replace('#footer .font',{ fontFamily: 'Junction', textShadow: '#000 0px -1px' });
	Cufon.replace('#content .title-container .font, #mainmenu ul.menu li:not(.current_page_item, .current-menu-parent) a.font',{ fontFamily: 'Junction', textShadow: '#<?php echo $color->bg['-4']; ?> 0px -1px' });
	Cufon.replace('#mainmenu ul.menu li.current-menu-item a.font, #mainmenu ul.menu li.current-menu-parent a.font',{ fontFamily: 'Junction', textShadow: 'none' });
	
	// Fixing menu hovers as cufon can't seem to handle different div-hover colors
	$('#mainmenu').find('ul.menu').children('li:not(.current-menu-item, .current-menu-parent)').hover(
		function () {
			Cufon.replace($(this).find('a.font'),{ fontFamily: 'Junction', color: '#<?php echo $color->bg['0']; ?>', textShadow: 'none' });
	  	},
	  	function () {
			Cufon.replace($(this).find('a.font'),{ fontFamily: 'Junction', color: '#<?php echo $color->fg['-2']; ?>', textShadow: '#<?php echo $color->bg['-4']; ?> 0px -1px' });
	  	}
	);
});
</script>
<?php } ?>