	jQuery.noConflict(); // Apply jQuery.noConflict()
	jQuery(function(){
		jQuery("a:has(img)[href$='.jpg']").attr({ rel: "fancybox" });	// These four lines add the rel="fancybox"
		jQuery("a:has(img)[href$='.jpeg']").attr({ rel: "fancybox" });	//  attribute to all links that contain
		jQuery("a:has(img)[href$='.gif']").attr({ rel: "fancybox" });	//  an image (i.e thumbnail) and link
		jQuery("a:has(img)[href$='.png']").attr({ rel: "fancybox" });	// to a JPG, JPEG, PNG or GIF image.
		jQuery("a[rel='fancybox']").fancybox();		//This applies fancybox to the links we have just edited.
	});
	
	jQuery(document).ready(function() {
	    jQuery('.gallery-icon a')
	      .fancybox({'overlayShow': true, 'hideOnContentClick': true, 'overlayOpacity': 0.85});
	  });