// Cufon Setup

Cufon.replace('h1, .phrase span em, #m-news-events .month, #m-news-events .day', { fontFamily: 'cartogothic bold' });
Cufon.replace('h2, h3, h4, h5, h6, .tagline', { fontFamily: 'cartogothic book' });

Cufon.replace('.phrase span em', { textShadow: 'rgba(0,0,0,0.2) 1px 2px' });
Cufon.replace('h3.block-title', { fontFamily: 'cartogothic book', textShadow: 'rgba(255,255,255,0.5) 0 1px' });


function MonsterVideo()
{msgWindow=window.open("http://www.monstervideoprofile.com/mvp/selectgroup","OpenWindow","width=640,height=480,scrollbars=no"); }

$(document).ready(function() {
	$('.datepicker').datepicker({ 'dateFormat':'yy-mm-dd' });
	
	// prettyPhoto
	$('a[rel^="prettyPhoto"]').prettyPhoto({ theme: 'dark_rounded' });
	
	// news feed, events feed - limit to homepage box
	$('#news-snippets, .news-list', '#m-news-events').cycle('fade');
	
	// Homepage Feature
	$("#crop-outer").cycle({
		fx: 'fade',
		speed: 1000,
		timeout: 7000
	});
	
	// Latest News + Upcoming Events
	$('body#index #news, body#index #events').equalHeights();
	$('body#index #news, body#index #events').css("overflow","inherit");
	
	//minimize button - dynamic content sections
	$('.dynamic-type').delegate('.dynamic-attribute > .minimize, .dynamic-attribute > .maximize', 'click', function(event){
		$(this).parent().next().slideToggle();
		$(this).toggleClass('minimize');
		$(this).toggleClass('maximize');
		if( $(this).hasClass('minimize') ){
			$(this).html('Minimize');
		}else{
			$(this).html('Maximize');
		}
		
		event.preventDefault();
	});

	//search box - hide text on click
	$('#site-search-box').delegate('#q','focus', function(){
		$(this).val('');
	});
	
	//search 'advanced' toggle
	$('#search-results,#hot-jobs').delegate('#refine-search', 'click', function(){
		$('#site-search-advanced').slideToggle();
		return false;
	});
	
	//search 'advanced' - dynamic content section toggle
	//$('#search-results').delegate('#search-section', 'change', function(){	//fails in IE - must bind change directly
	$('#search-section','#search-results').change(function(){
		switch( $(this).val() ){
			case '2':
			case 'JP':
			case 'J':
				$('#jobs-search').slideDown();
				break;
			default:
				$('#jobs-search').slideUp();
				break;
		}
		
		return false;
	});
	
	//hide elements by default
	$('#site-search-advanced', '#search-results').hide();
	//hide in code $('#jobs-search', '#search-results,#search-results-none').hide();
	
	
}); 
