jQuery(document).ready(function () {
	
	var images = ['old-streetmap.jpg', 'pettygrove-map.jpg', 'paving-map.jpg', 'grid.jpg', 'traction-map.jpg', 'building-ages.jpg', 'pdx-painting.jpg', 'radial-map.png', 'portland-map.jpg'];
	
	jQuery('#header-bg').css({'background-image': 'url(/wp-content/themes/thematic-dpc/img/header/' + images[Math.floor(Math.random() * images.length)] + ')'});
	
	jQuery('#mail-form').hide();
	
	jQuery('#mail-button').click(function(){
		jQuery(this).hide();
		jQuery('#mail-form').fadeIn();	
	});

  jQuery('input.text').each( function () {
    jQuery(this).val(jQuery(this).attr('title'));
      });

  jQuery('input.text').focus(function(){
    if ( jQuery(this).val() == jQuery(this).attr('title') ){
      jQuery(this).val('');
    }
    });
  jQuery('input.text').blur(function(){
    if (jQuery(this).val() == '' ){
      jQuery(this).val(jQuery(this).attr('title'));
    }
    });
    
			
	jQuery("div.join-card a").bigTarget({
    	hoverClass: 'over', // CSS class applied to the click zone onHover
    	clickZone : 'div:eq(0)' // jQuery parent selector
  	});
  	
	//Hide (Collapse) the toggle containers on load
	jQuery(".slider").hide(); 

	//Switch the "Open" and "Close" state per click then slide up/down (depending on open/close state)
	jQuery(".toggler").click(function(){
		jQuery(this).toggleClass("active").next().slideToggle("medium");
	});
    
});
