
var jj = jQuery.noConflict();
jj(document).ready(function(){	
	//created this to fix archive z-index bug once and for all.
	var zIndexNumber = 1000;

	jj('li .actions .button').each(function(){	
		jj(this).parent().parent().css('zIndex', zIndexNumber);
		zIndexNumber -= 10;

		jj(this).hover(
			function () {				
				jj('.menu', this).css({'z-index':'10001', 'display': 'block'});
			},
			function () {
				jj('.menu', this).css({'z-index':'2', 'display' : 'none'});
		});
	});

	jj('#groups_resourcelist li .actions .button').each(function(){	
		jj(this).parent().parent().css('zIndex', zIndexNumber);
		zIndexNumber -= 10;

		jj(this).hover(
			function () {				
				jj('.menu', this).css({'z-index':'10001', 'display': 'block'});
			},
			function () {
				jj('.menu', this).css({'z-index':'2', 'display' : 'none'});
		});
	});
	
	jj('.groups_featured li .actions .button').each(function(){
		jj(this).parent().parent().css('zIndex', zIndexNumber);
		zIndexNumber -= 10;

		jj(this).hover(
			function () {
				jj('.label', this).css({'z-index':'10001', 'display': 'block'});
			},
			function () {
				jj('.label', this).css({'z-index':'2', 'display' : 'none'});
		});
	});

	jj('.groups_recommended li .actions .button').each(function(){	
		jj(this).parent().parent().css('zIndex', zIndexNumber);
		zIndexNumber -= 10;

		jj(this).hover(
			function () {				
				jj('.label', this).css({'z-index':'10001', 'display': 'block'});
			}, 
			function () {
				jj('.label', this).css({'z-index':'2', 'display' : 'none'});
		});
	});

});
