$(document).ready(function(){

	// Removes bottom line from last item in right column
	$('.glRightColumnPadding:last').css('border-bottom', 'solid 0px #fff');
	$('.glRightColumnPadding:last').css('padding-bottom', '0px');
	$('.glRightColumnPadding:last').css('background', 'none');
	
	// 
	var columnCount = $('.glChipFlavor').length;
    var tallestCol = 0;

    for(var i=0; i<columnCount; i++)
    {
        var divUsed =$('.glChipFlavor')[i];
        var divHeight = jQuery(divUsed).height();
        
        if(divHeight != "NaN")
        {
            if(divHeight > tallestCol)
            {
                tallestCol = divHeight;
            }
        }
    }
    jQuery($('.glChipFlavor')).css("height",tallestCol);
	
	var x = 3;
	
	$('.glChipFlavor').each(function(){
		$('.glChipFlavor').eq(x).after("<div class='clear'></div>");
		
		x = x + 4;
	});
	
	// 
	var columnCount = $('.glChipRecommendationsBag').length;
    var tallestCol = 0;

    for(var i=0; i<columnCount; i++)
    {
        var divUsed =$('.glChipRecommendationsBag')[i];
        var divHeight = jQuery(divUsed).height();
        
        if(divHeight != "NaN")
        {
            if(divHeight > tallestCol)
            {
                tallestCol = divHeight;
            }
        }
    }
    jQuery($('.glChipRecommendationsBag')).css("height",tallestCol);
	
	// Recipes and Party equal heights
	var rpColumnCount = $('.RecipesPartyHeight').length;
    var rpTallestCol = 0;

    for(var i=0; i<rpColumnCount; i++)
    {
        var rpDivUsed =$('.RecipesPartyHeight')[i];
        var rpDivHeight = jQuery(rpDivUsed).height();
        
        if(rpDivHeight != "NaN")
        {
            if(rpDivHeight > rpTallestCol)
            {
                rpTallestCol = rpDivHeight;
            }
        }
    }
    jQuery($('.RecipesPartyHeight')).css("height",rpTallestCol);
	
	// Making some ULs LIs the same height
	var liCount = $('.equalLI').length;
    var tallestLI = 0;

    for(var i=0; i<liCount; i++)
    {
        var liUsed =$('.equalLI')[i];
        var liHeight = jQuery(liUsed).height();
        
        if(liHeight != "NaN")
        {
            if(liHeight > tallestLI)
            {
                tallestLI = liHeight;
            }
        }
    }
    jQuery($('.equalLI')).css("height",tallestLI);
	
	
	// Makes the Orangish Button
	$('.glButton').each(function(){
		var text = $(this).html();
		$(this).html("");
		$(this).html("<div class='btnLeft'></div><div class='btnMiddle'><span>" + text + "</span></div><div class='btnRight'></div>");
	});
	
	$('#glDropDownSelectorList a:first').css('border-top', 'solid 1px #cac8bc');
	$('#glDropDownSelectorList a:first').css('margin-top', '3px');

	$('.glDropDownSelector').click(function(){
		$('#glDropDownSelectorList').slideToggle();
	});
			
			
	if($('#glPartyRecipePager').html() == "")
	{
		$('.glPartyRecipeList li:last').css('background', 'none');
	}
	
	$('.searchBox').val("Search");
	$('.searchBox').click(function(){
		$(this).val("");
	});
	
	$('img').ifixpng();
	$('img').ifixashx();
	
	
});