$.noConflict();
	jQuery(document).ready(function($) {
	
	$(document).ready(function() { 
       $('.menuItem').delay(800).animate({ opacity: 0.3 }, 500, function() {});
	   $('.subMenuItem').delay(800).animate({ opacity: 0.3 }, 500, function() {});
	   $('.feedPlus').delay(800).animate({ opacity: 0.3 }, 500, function() {});
   });
	
   
	$('.menuItem').hover( 
   function () { 
       $(this).stop(true, true).animate({ opacity: 1 }, 200, function() {});
       $(this).addClass('pointer'); 
   },
   function () { 
       $(this).stop(true, true).animate({ opacity: 0.3 }, 400, function() {}); 
   });
   
   
   $('.subMenuItem').hover( 
   function () { 
       $(this).stop(true, true).animate({ opacity: 1 }, 200, function() {});
       $(this).addClass('pointer'); 
   },
   function () { 
       $(this).stop(true, true).animate({ opacity: 0.3 }, 400, function() {}); 
   });
   
   
   $('.menuItemSelected').hover( 
   function () { 
       $(this).stop(true, true).animate({ opacity: 0.3 }, 200, function() {});
       $(this).addClass('pointer'); 
   },
   function () { 
       $(this).stop(true, true).animate({ opacity: 1 }, 400, function() {}); 
   });
   
   
   $('.subMenuItemSelected').hover( 
   function () { 
       $(this).stop(true, true).animate({ opacity: 0.3 }, 200, function() {});
       $(this).addClass('pointer'); 
   },
   function () { 
       $(this).stop(true, true).animate({ opacity: 1 }, 400, function() {}); 
   });
   
   
   
	$('.imageContainer').hover( 
   function () { 
		$("img", this).stop(true, true).animate({ opacity: 0.7 }, 50, function() {});
		$(this).children('#imageTitle').css({ opacity: 0.7 });
		$(this).children('#imageSubTitle').css({ opacity: 0.7 });
		$(this).children('#imageCount').css({ opacity: 0.7 });
		$(this).children('#imageDate').css({ opacity: 0.7 });
       	$(this).addClass('pointer'); 
   },
   function () { 
	    $("img", this).stop(true, true).animate({ opacity: 1 }, 200, function() {});
		$(this).children('#imageTitle').css({ opacity: 1 });
		$(this).children('#imageSubTitle').css({ opacity: 1 });
		$(this).children('#imageCount').css({ opacity: 1 });
		$(this).children('#imageDate').css({ opacity: 1 });
   });
   
   $('.imageSmallCrop').hover( 
   function () { 
		$("img", this).stop(true, true).animate({ opacity: 0.7 }, 50, function() {});
       	$(this).addClass('pointer'); 
   },
   function () { 
	   $("img", this).stop(true, true).animate({ opacity: 1 }, 200, function() {});
   });
   
   $('.imageTile').hover( 
   function () { 
		$("img", this).stop(true, true).animate({ opacity: 0.7 }, 50, function() {});
       	$(this).addClass('pointer'); 
   },
   function () { 
	   $("img", this).stop(true, true).animate({ opacity: 1 }, 200, function() {});
   });
   
   $('.imageTileEnd').hover( 
   function () { 
		$("img", this).stop(true, true).animate({ opacity: 0.7 }, 50, function() {});
       	$(this).addClass('pointer'); 
   },
   function () { 
	   $("img", this).stop(true, true).animate({ opacity: 1 }, 200, function() {});
   });
   
   $('.feedItemLeft').hover( 
   function () { 
	   $(this).css({ opacity: 0.3 });
       $(this).addClass('pointer'); 
   },
   function () { 
		$(this).css({ opacity: 1 });
   });
   
     $('.feedItemRight').hover( 
	function () { 
	   $(this).css({ opacity: 0.3 });
       $(this).addClass('pointer'); 
	},
	function () { 
		$(this).css({ opacity: 1 });
	});   
	
	
	// Popup
	//When you click on a link with class of poplight and the href starts with a # 
	$('a.poplight[href^=#]').click(function() {
		var popID = $(this).attr('rel'); //Get Popup Name
		var popURL = $(this).attr('href'); //Get Popup href to define size
	
		//Pull Query & Variables from href URL
		var query= popURL.split('?');
		var dim= query[1].split('&');
		var popWidth = dim[0].split('=')[1]; //Gets the first query string value
	
		//Fade in the Popup and add close button
		$('#' + popID).fadeIn().css({ 'width': Number( popWidth ) });
	
		//Define margin for center alignment (vertical / horizontal) - we add 80px to the height/width to accomodate for the padding  and border width defined in the css
		var popMargTop = 0;
		var popMargLeft = ($('#' + popID).width() + 40) / 2;
	
		//Apply Margin to Popup
		$('#' + popID).css({
			'margin-top' : -popMargTop,
			'margin-left' : -popMargLeft
		});
	
		//Fade in Background
		$('body').append('<div id="fade"></div>'); //Add the fade layer to bottom of the body tag.
		$('#fade').css({'filter' : 'alpha(opacity=80)'}).show(); //Fade in the fade layer - .css({'filter' : 'alpha(opacity=80)'}) is used to fix the IE Bug on fading transparencies 
	
		return false;
	});
	
	//Close Popups and Fade Layer
	$('a.close, #fade').live('click', function() { //When clicking on the close or fade layer
		$('#fade , .popup_block').hide();  //Hide
		return false;
	});
	
	
    $("input[name$='toggler']").click(function() {
        var test = $(this).val();

        $("div.toHide").hide();
        $("#content-" + test).show();
		
    });
	
});
