$(document).ready(function(){

	// if ie6 lets patch it up
	version = parseFloat(navigator.appVersion.split("MSIE")[1]);
	if(version < 7) {
		$.ie6fixes();
	}
	
	if(version == 7) {
		$.ie7fixes();
	}
	
	if(version == 8) {
		$.ie8fixes();
	}

	// fadeout flash messages on click
	$('.cancel').click(function(){
		$(this).parent().fadeOut();
		return false;
	});

	// fade out good flash messages after 3 seconds
	$('.flash_good').animate({opacity: 1.0}, 3000).fadeOut();
	
	//replace
	$('h1').addClass('logo');
	
	$('ul#subcats li a').hover(function()
	{ 
		/* mouseover */
		//$(this).find('img').css('opacity','100');		
		$(this).find('img').animate({'opacity': 1}, 500);
	}, function(){ 
		/* mouseout */ 
		//$(this).find('img').css('opacity','33');	
		$(this).find('img').animate({'opacity': 0.3}, 500);		
	});
	
	$('#contentcontainer.home ul li a').hover(function()
	{
		$(this).find('img').animate({'opacity': 0.5}, 500);
	}, function() {
		$(this).find('img').animate({'opacity': 1}, 500);		
	});
		
});


/*
	Jonesys ie6 fixes function
*/

jQuery.ie6fixes = function() {	
	
}

jQuery.ie7fixes = function() {	
	$('header').css('margin-top','-10px');
	$('#vatbtn').css('margin-top','40px');
	$('#contentcontainer').css('margin-top','30px');
	$('#contentcontainer.home ul').css('margin-top','120px');
	$('#footercontainer div').css('margin-top','40px');
	$('footer').css('margin-bottom','-10px');
	$('#boxbtnshop').css('top','100px');
	$('#boxbtnphone').css('top','100px');
}

jQuery.ie8fixes = function() {	
	$('header').css('margin-top','-10px');
	$('footer').css('margin-bottom','-10px');
}
