/*******************************************************************************

	CSS on Sails Framework
	Title: Gumbuya Park
	Author: XHTMLized (http://www.xhtmlized.com/)
	Date: March 2011

*******************************************************************************/

// jQuery
if(typeof jQuery !== 'undefined') {

	jQuery(document).ready(function($) {

		/* Menu */
		$('#header .menu li').hover(
			function() {
				if($(this).find('.caption').length > 0) {
					$(this).addClass('open');
				}
			},
			function() {
				if($(this).find('.caption').length > 0) {
					$(this).removeClass('open');
				}
			}
		);

		/* Entry Childs Headlines */
		$.each($('.entry-childs .child').find('h2'), function(i, data) {
			if($(this).text().length < 21) {
				$(this).css({
					'line-height': '79px',
					'padding-top': '0',
					'height': '79px'
				});
			}
		});

	});

}

// Cufon
if (typeof Cufon !== 'undefined') {

	var Gotham_Black = [
		'#navigation',
		'.phone',
		'.entry-excerpt',
		'.wp-caption-text'
	];
	if(Gotham_Black.length > 0) {
		Cufon.replace(Gotham_Black.join(','), { fontFamily: 'Gotham_Black', hover: 'true' });
	}

	var Gotham_Medium = [
		'#footer .social-media'
	];
	if(Gotham_Medium.length > 0) {
		Cufon.replace(Gotham_Medium.join(','), { fontFamily: 'Gotham_Medium', hover: 'true' });
	}

	var Gotham_Ultra = [
		'#header .page-title',
		'.home .welcome-msg h2',
		'.home .events h2',
		'.home .events h3',
		'.phone',
		'.entry-childs .child h2',
		'.entry-childs-interlacement .child h2',
		'.entry-childs-events .event h2',
		'.entry-content h2'
	];
	if(Gotham_Ultra.length > 0) {
		Cufon.replace(Gotham_Ultra.join(','), { fontFamily: 'Gotham_Ultra', hover: 'true' });
	}

	Cufon.replace('#header .menu .caption p', { 
		fontFamily: 'Gotham_Medium', 
		textShadow: '0px 1px rgba(0, 0, 0, 0.3)'
	});

	Cufon.replace('#header .menu li > a, #header .menu .caption .more, #footer .extras li h4, #sidebar .parent strong', { 
		fontFamily: 'Gotham_Ultra', 
		hover: 'true',
		textShadow: '0px 1px rgba(0, 0, 0, 0.4)'
	});

}
