jQuery(document).ready(function($) {
	
	$('#Li_CatItem19 >ul').html($('#SubMenu >ul').html());
	
	$('.bodyPageIdkurv .button').each(function(index) {
			if (index == 1 || index == 2) {
				$(this).addClass('black');	
			} else if (index == 3) {
				$(this).addClass('blue');
			}
			
	});
		
	/* back function */	
	$('#back').click(function() {
		var url = location.href;
		var parts = url.split('/');
		var url = '/'+parts[3]+'/'+parts[4]+'/';
		window.location.href = url;
	});
	
	Cufon.replace('#PageContent h1');
	Cufon.replace('.FooterTitle');
	Cufon.replace('#FooterContent ul li a');
	Cufon.replace($('#LeftNavigation ul li a').not('#LeftNavigation ul li ul li a'));
	Cufon.replace('#LeftColumnContent h2');
	
	var content = $('#nice-to-know-content').html();

	if (content == '' || content == '!not found!') {
		$('#nice-to-know').hide();
	}
	
	$('#product-links a').each(function(i) {
		$(this).find('img').hide();

		if (i == 0) {
			
			$(this).html('forrige produkt');
			$(this).css('float', 'left');
		} else {
			$(this).html('n&aelig;ste produkt');
			$(this).css('float', 'left');
			$(this).css('margin-left', '5px');
		}
	});
	
	$('#product-links a').first().after('<div style="margin-left: 5px; float: left;">/</div>');
	
	//$("#facebook-box-content").html($("#fake-facebook").html());

	/* CSS hacks */	
	
	/* LeftNavigation */
	$('#LeftNavigation ul li').last().css('border', '0');
	$('#LeftNavigation ul li.current ul li').last().css('border', '0');
	$('#LeftNavigation ul li.current ul li ul li').last().css('border', '0');
	$('#LeftNavigation ul li.current ul li').first().css('padding-top', '10px');

	
	$('#LeftNavigation ul li').not('#LeftNavigation ul li ul li').each(function(index) {
			if ($(this).find('ul').length <= 0) {
				$(this).addClass('nosub');
			}
	});
	
	$('.your-account-usermenu').hover(function() {
		$(this).find('ul').show();	
	}, function() {
		$(this).find('ul').hide();
	});
    
    /*
    var heightA = $('#LeftColumn').height();
    var heightB = $('#MainContentWrapper').height();
    if (heightA > heightB) {
        $('#FooterWrapper').css('position', 'absolute');
        $('#FooterWrapper').css('left', '200px');
    }
    */
    
    $("#MainContentWrapper").css('marginBottom', ($("#FooterWrapper").height() + 60));
	
});
