$(document).ready(function() {

		$("#block-menu-primary-links li a").each(function() {
			$(this).append('<div class="garnish">');
		});
		
		$(".menu_block_wrapper>.menu>li>a").each(function() {
			$(this).append('<div class="garnish">');
		});

		$(".menu_block_wrapper>.menu>li>a.active").each(function() {
			$(this).append('<div class="bullet-garnish">');
		});



	// ---  Start Input Box Interactivity   [not used]

	$('#edit-submitted-email').each(function() {
			var default_value = this.value;
			$(this).focus(function() {
					if(this.value == default_value) {
							this.value = '';
					}
			});
			$(this).blur(function() {
					if(this.value == '') {
							this.value = default_value;
					}
			});
	});

	//---Sample if statement
	if ($('.view-projects-menu').length>0) {
	$('.view-projects-menu .proj-menu-container.last').html($('.view-projects-menu .proj-menu-container.last').html().replace('military-aerospace','<a href="/portfolio/military-aerospace">military-aerospace</a>'));
				};


//--- Makes seperate lines of links function as one

	$('.views-row').bind('mouseenter', function() {
		$(this).addClass('hover');
	}).bind('mouseleave', function() {
		$(this).removeClass('hover');
	});

	$('.block').bind('mouseenter', function() {
		$(this).addClass('hover');
	}).bind('mouseleave', function() {
		$(this).removeClass('hover');
	});


// --- Make links open in new window

	$("#jdock #block-menu-primary-links").each(function() {
		$("a[href^='http']").attr('target','_blank');
	});

//---- Lightbox Multi-View   [ -- Dont' forget the CSS and to enable the Lightbox 2 Module!!! -- ]
	// These blocks set up a mouseenter event system that replaces the visible detail image with a detail image matching the moused-over thumbnail
	// Visible Thumbnails are in  .views-field-field-images-fid-1
	// Hidden Details are in      .views-field-field-images-fid
	// Visible Detail image is    .views-field-field-images-fid-2

	var view_class = '.view-id-lightbox_multi_view';
	var visible_thumbs = '.views-field-field-images-fid-1';
	var hidden_details = '.views-field-field-images-fid';
	var visible_detail = '.views-field-field-images-fid-2';

	//Give field-images matching item numbers
	$(view_class+' .views-row').each(function() {
		var itemid = 0;
		var sibling = $(this).find(hidden_details+' .field-item:first-child');
		$(this).find(visible_thumbs+' .field-item').each(function() {
			$(this).attr('itemid',itemid);
			sibling.attr('itemid',itemid).addClass('item-'+itemid);
			sibling = sibling.next();
			itemid++;
		});
	});
	//Add mouseenter events to each of the thumbnail images
	$(view_class+' '+visible_thumbs+' img').each(function (i) {
		$(this).bind('mouseenter',function(e){
			viewsrow = $(this).parent().parent().parent().parent().parent();
			var itemid = $(this).parent().parent().attr('itemid');
			var linkobj = $(this).parent();

			previewimg = viewsrow.find(hidden_details+' .item-'+itemid+' img').attr('src');
			viewsrow.find(visible_detail+' img').attr('src',previewimg);
			viewsrow.find(visible_detail+' a').attr('href',linkobj.attr('href'));
		});
	});






});
