/*
File: jquery.config.js
Copyright: (c) 2011 Brand Rich Media
Author: Brandon Neil Richards
Author URI: http://www.brandrichmedia.com/
*/

// callback functions
$(function() 
{
		
		
		//concantenate firt and last name for subscriber entry into Campaign Monitor
		$('.submit').click(function () {
	  		var str1 = $('input[name="first_name"]').val();
	  		var str2 = $('input[name="last_name"]').val();
	  		var fullname = str1+" "+str2;
	  		//alert(fullname);
	  		$('input[name="name"]').attr('value', fullname);
	  	
    	});
		// overlays
				$("#team a[rel]").overlay(
					{
						mask: '#000', 
						top: 'center',
						close: '.close'
					});
		// jquery.cycle.min.js
				$('.slide-container').cycle({
					fx:     'fade', 
			    	timeout: 7500,
					height: '345px',
			 		pause: 1
				});
		//make tabs clickable
				$("#feature-tabs ul").click(function(){
				      window.location = $(this).children().find(".thehref").attr("href")
				   });
		// make tabbed area
		//tabbed menu
		
		var tabContainers = $('#directors,#leadership,#tab-donation,#tab-login,#tab-history,#tab-bymail');
		$('#inline-tabs a').click(function () {
		tabContainers.hide().filter(this.hash).show();
		$('#inline-tabs a').removeClass('selected');
		$(this).addClass('selected');
		return false;
		}).filter(':first').click();
		
		var tabContainers2 = $('#tab-need,#tab-do,#tab-help');
		$('#tabnav a').click(function () {
		tabContainers2.hide().filter(this.hash).show();
		$('#tabnav a').removeClass('selected');
		$(this).addClass('selected');
		return false;
		}).filter(':first').click();
		
		// remove input text
		$('.rmv').click(function() {
			if (this.value == this.defaultValue) {
				this.value = '';
			}
		});
		
		$('.rmv').blur(function() {
			if (this.value == '') {
				this.value = this.defaultValue;
			}
		});
		
		//open windows without embedding target="_blank"				
		$('a[rel="external"]').each(function() {
			$(this).attr('target', '_blank');
		});
		

});

