function equalHeight(group) {
	var tallest = 0;
	group.each(function() {
		var thisHeight = $(this).height();
		if(thisHeight > tallest) {
			tallest = thisHeight;
		}
	});
	group.height(tallest);
}

$.fn.imagesLoaded = function(callback){
	var elems = this.filter('img'),
	   len   = elems.length;
	   
	elems.bind('load',function(){
	   if (--len <= 0){ callback.call(elems,this); }
	}).each(function(){
	  // cached images don't fire load sometimes, so we reset src.
	  if (this.complete || this.complete === undefined){
	     var src = this.src;
	     // webkit hack from http://groups.google.com/group/jquery-dev/browse_thread/thread/eee6ab7b2da50e1f
	     // data uri bypasses webkit log warning (thx doug jones)
	     this.src = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==";
	     this.src = src;
	  }  
	}); 

	return this;
	};


$(document).ready(function(){
	
	$('#select > div').toggle(function(){
		$(this).find('.list').slideDown('fast');
	},function(){
		$(this).find('.list').slideUp('fast');
	});
	
	$('#select > div .list a').click(function(){
		window.location.href = $(this).attr('href');
	});
	
	$('a[href*=.jpg], a[href*=.jpeg], a[href*=.gif], a[href*=.png]').lightBox();
	
	
	$('#left .links li.slide ul, li.slide2 ul').hide();
	$('#left .links li.slide span').click(function(){
		if($(this).attr('class') == '') {
			$(this).parent('li').find('> ul').slideDown('fast');
			$(this).addClass('open');
		} else {
			$(this).parent('li').find('> ul').slideUp('fast');
			$(this).removeClass('open');
		}
	});
	
	if($.browser.msie) {
		$('.items > div').addClass('round').append('<u class="r1"></u><u class="r2"></u><u class="r3"></u><u class="r4"></u>');
	}
	

    
    $('.show-pager select').change(function () {
        $(this).parents('form').submit();
    });
    
    
        
            $('.anythingSlider').anythingSlider({
                easing: "easeInOutCubic",        // Anything other than "linear" or "swing" requires the easing plugin
                autoPlay: true,                 // This turns off the entire FUNCTIONALY, not just if it starts running or not.
                delay: 4000,                    // How long between slide transitions in AutoPlay mode
                startStopped: false,            // If autoPlay is on, this can force it to start stopped
                animationTime: 1500,             // How long the slide transition takes
                hashTags: false,                 // Should links change the hashtag in the URL?
                buildNavigation: true,          // If true, builds and list of anchor links to link to each slide
        		pauseOnHover: true             // If true, and autoPlay is enabled, the show will pause on hover
            });
            
            
            function oneHeight(){
            	//equalHeight($("#types .one img"));
            	equalHeight($("#types .one"));
            }	
            $('#types .one img',this).imagesLoaded(oneHeight);
});


