(function($){
	$(function(){
		
		if( $.browser.safari ) {
			$('html').addClass('safari');
		}
		
		
		if( $.browser.msie) {
			$('html').addClass('ie').addClass('ie'+ parseInt($.browser.version));
		}
		
		if( $.browser.msie && parseInt($.browser.version) <= 6 ) {
			var bgs = {
				'#page-background': 'content',
				'#header-bg': 'header',
				'#footer-top': 'footer-top',
				'.has-blue-content-footer #footer-top': 'footer-top-blue',
				'#footer-bottom': 'footer-bottom',
				'#footer-background': 'footer'
				};
			for(var i in bgs) {
				$(i).css({
					'background': 'none',
					'filter': 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' + wp_template_directory + '/images/backgrounds/'+ bgs[i] +'.png",sizingMethod="scale")'
				});
			}
			$('#page-background').height($('#content').height());
			$('#footer-background').height($('#footer-content').height());
			
			
		}
		
		$('#main-menu li').each(function(){
			var $this = $(this);
			var ul = $this.children('ul:first');
			if( ul.length ) {
				$this.hover(
					function(){ $(this).children('ul').fadeIn('fast'); },
					function(){ $(this).children('ul').fadeOut('fast'); }
				);
			}
		
		});
		
		
		$('.products li').click(function(){
			window.location = $('h2 a:first', this).attr('href');
			return false;
		}).css('cursor', 'pointer');
		
		$('.blog.post .post-entry table').each(function(){
			$(this).css({
				'position': 'relative',
				'width': $(this).outerWidth() + 40 + 'px',
				'margin-left': '-20px'
			});
			$('tr:last', this).addClass('last');
			
		});
		
		
		
	});
})(jQuery);