Cufon.replace('#topnav .menu, #header .menu li a, #offers-slider a', {fontFamily: 'MuseRegular', hover: true});
Cufon.replace('#topnav .menu li.current-menu-item a', {fontFamily: 'MuseBold', hover: true});
Cufon.replace('h1.small, .muse', {fontFamily: 'MuseRegular'});
Cufon.replace('h1, #sidebar .widget h4, #footer .widget h4, .wpcf7 h4, .wpcf7 h3, #subfooter h3, span.collapse, .musebold', {fontFamily: 'MuseBold'});
Cufon.replace('#sidebar #text-3 h4', {fontFamily: 'MuseRegular', hover: false});

$(document).ready( function() {
/*
	if ($('#content > h2').size() > 0) {
		$('#content h2:first').hide();
	}
*/
	// make the main navigation icons clickable
	$('#header .menu li').css('cursor','pointer').click(function() {
		location.href = $(this).find('a:first').attr('href');
	});
	
	// create tabs for pages with tabbed content
	$('#tabbed-content').tabs();

/*
	$(".dropdown dt a").click(function() {
	    $(".dropdown dd ul").toggle();
	});
*/

	// create slider for pages with slides
	// + make sure that the whole slide is clickable	
	$('#offers-slider .items').cycle({ 						    
		speed:  'fast', 						    
		timeout: 5000 						    
		// pager:  '#frame .nav'						
	}).find('.offer').css('cursor','pointer').click(function() {
		location.href = $(this).find('a:first').attr('href');
	});					
	
	// ui improvement to data input
	$( "input.date" ).datepicker({ autoSize: true, dateFormat: 'dd/mm/yy' });
	
	// ui improvement to long select inputs
	$( "select.autocomplete" )
		.find('option:first').text('').end()
		.select_autocomplete();
		
	// ui improvement to long forms (hides + expands the form)
	$( ".wpcf7 span.collapse" )
		.click(function() {
			$(this).parent().nextAll().slideDown();
			$(this).hide();
		} )
		.parent().nextAll().hide();
		
	// converts a wp gallery to a single image with link to slideshow - cool!
	$(".gallery .gallery-item .gallery-icon a")
		.attr('rel','gallery').fancybox({
			'transitionIn'	:	'elastic',
			'transitionOut'	:	'elastic',
			'speedIn'		:	600, 
			'speedOut'		:	200, 
			'overlayShow'	:	true,
			'padding'		: 	0,
			'margin'		: 	0,
			'titleShow'		: 	false,
			'titlePosition' :   'over',
			'overlayColor'	: 	'#333'
		})
		.parents('.gallery')
		.find('.gallery-item').hide().end()
		.find('.gallery-item:first').show().end()
		.show();
	$("#launch-gallery").css('cursor','pointer').click(function() {
		$('.gallery a:first').trigger('click');
	} );
	
	$(".vertical-tabs").tabs().addClass('ui-tabs-vertical ui-helper-clearfix');
	$(".vertical-tabs").removeClass('ui-corner-top').addClass('ui-corner-left');
} );
