$(document).ready(function(){
	
	
	// Makes the columns in the footer the same height
	var columnCount = $('.osFooterLinks').length;
    var tallestCol = 0;

    for(var i=0; i<columnCount; i++)
    {
        var divUsed =$('.osFooterLinks')[i];
        var divHeight = jQuery(divUsed).height();
        
        if(divHeight != "NaN")
        {
            if(divHeight > tallestCol)
            {
                tallestCol = divHeight;
            }
        }
    }
    jQuery($('.osFooterLinks')).css("height",tallestCol);
	
	// Makes the columns in the footer the same height
	var columnCount = $('.productContainer').length;
    var tallestCol = 0;

    for(var i=0; i<columnCount; i++)
    {
        var divUsed =$('.productContainer')[i];
        var divHeight = jQuery(divUsed).height();
        
        if(divHeight != "NaN")
        {
            if(divHeight > tallestCol)
            {
                tallestCol = divHeight;
            }
        }
    }
    jQuery($('.productContainer')).css("height",tallestCol);
	
	
	// Every forth product, remove the padding-right.
	x = 3;
	
	$('.productPadding').each(function(){
		$('.productPadding').eq(x).css('padding-right', '0');
		
		x = x+4;
	});
	
	
	// Toolbox
	$('#osRightColumnTop').click(function(){
		$('#osRightColumnPadding a:visible').each(function(){
			$('#osRightColumnPadding a').fadeOut();
		});
		
		$('#osRightColumnPadding a:hidden').each(function(){
			$('#osRightColumnPadding a').fadeIn();
		});
		
		$('#osRightColumnPadding').slideToggle();
		
		if($('#osRightColumnTop .ClickToExpand').html() == "Click To Expand +")
		{
			$('#osRightColumnTop .ClickToExpand').html("Click To Collapse -");
			$('.osImgHeader').removeClass('osImgHeaderBorder');
		}
		else
		{
			$('#osRightColumnTop .ClickToExpand').html("Click To Expand +");
			$('.osImgHeader').addClass('osImgHeaderBorder');
		}
	});


	$('#osRightColumnPadding img').each(function(){
		$(this).css('width', '27px'); 
	});

	$('.osRightColumnPadding:last').css('background', 'none');
	
	$('.orderHistoryList tr:odd').each(function(){
		$(this).css('background', '#f3f4f4');
		$('.whiteBG').css('background', 'none');
	});
});