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


	$('#access li.menu-item').children('ul.sub-menu').parent().children('a.main-item').addClass('hasSubMenu');
	$('#access li.menu-item ul li').children('ul.sub-menu').parent().children('a').addClass('hasSubMenu');
	
// rollovers for search and email signup
		
	$('input#searchsubmit').mouseover(function() {
		$('#search_form_holder form#searchform').css('background-position', '1px -45px');
	});
	
	$('input#searchsubmit').mouseout(function() {
		$('#search_form_holder form#searchform').css('background-position', '0 0');
	});

	
	$('#footer_widget #mc-embedded-subscribe').mouseover(function() {
		$('form#mc-embedded-subscribe-form').css('background-position', '1px -45px');
	});

	$('#footer_widget #mc-embedded-subscribe').mouseout(function() {
		$('form#mc-embedded-subscribe-form').css('background-position', '0 0');
	});
	


// for form fields clear on focus...
  
	$("#search_form_holder form#searchform input#s, #fieldformBuilderFieldEmail").focus(function() {
		if( this.value == this.defaultValue ) {
			this.value = "";
			}
		}).blur(function() {
			if( !this.value.length ) {
				this.value = this.defaultValue;
			}
	});

		
	
// append class to even elements
    $("#content table tr:even").addClass("even_row");



// manually append lightbox class to gallery.
    
    $("a.shutterset_set_1").addClass("cboxModal").attr('rel', '[gallery-photo]');



// load meet videos 
	
	

	// have to do this b/c of IE and its usually buginess with Flash...
	function refreshMeetVideo() {
		$('.inline_video').each(function() {
			var meetHolderHTML = $(this).html();
			$(this).empty();
			$(this).html(meetHolderHTML);
		});	
	}

	
	
	
    
    $('#meet_thumb_wrap a.video_link').click(function() {
    	
    	refreshMeetVideo();
    	
    	var currVideo = "#the-" + $(this).attr('id');
    	$(currVideo).css('display', 'block');
    	$(currVideo + ' object').css('visibility', 'visible');
    	
    	$(currVideo).siblings('.inline_video').css('display', 'none');
    	//$(currVideo).siblings('.inline_video').children('object').css('display', 'none');

    	
    	
		$(this).addClass('current_vid');
		$(this).siblings('a.video_link').removeClass('current_vid');

    	return false;


		
   	}); // stop load function

    
    $('#access a').click(function() {
    	//$('.meet_video_holder').empty();
    	$('a.video_link').removeClass('current_vid');
    });
    
    

    
    

	
	
 // hover for media thumbs...

 	
 	$('.ngg-gallery-thumbnail a img:first-child').attr('class', 'orig_img');	
 	
 	$('.ngg-gallery-thumbnail a').each( function() { 
 		var imgTitle = $(this).children('img').attr('title');
 		$(this).before('<span class="img_title">'+imgTitle+'</span>');
 	});
 	
 	$('.ngg-gallery-thumbnail a').mouseover( function() {
 		$(this).parent().children('span.img_title').css('display', 'block');
 	});
 	$('.ngg-gallery-thumbnail a').mouseout( function() {
 		$(this).parent().children('span.img_title').css('display', 'none');
 	});

 	
 	
 	


 	

$('.photos-gallery a.cboxModal').colorbox({
 	maxWidth: '800px'
 });
    






}); //stop jquery






