// JavaScript Document

$(function() {
	//set up background images
	var imagePath = 'http://localhost/';
	if ($.browser.msie && $.browser.version < 7) {
		$('.dd_lvl_1').css('background', "url('images/nav/sub_bg.png')");
		$('#dd_log_in').css('background', "url('images/nav/sub_log_in_bg.png')");
	} else {
		$('.dd_lvl_1').css('background', "url('images/nav/shadowed_bg.png') no-repeat bottom right");
		$('#dd_log_in').css('background', "url('images/nav/shadowed_log_in_bg.png') no-repeat bottom right");
	}
    
	//Add the hover class to hovered elements
	$('.lvl_1').hover(
		function() {
			$(this).addClass('hover');
			if ($('body').hasClass($(this).attr('id'))) {
				$(this).find('img').attr('src', $(this).find('img').attr('src').replace('_here.gif', '_over.gif'));
			} else {
				$(this).find('img').attr('src', $(this).find('img').attr('src').replace('.gif', '_over.gif'));
			}
		},
		function () {
			$(this).removeClass('hover');
			if ($('body').hasClass($(this).attr('id'))) {
				$(this).find('img').attr('src', $(this).find('img').attr('src').replace('_over.gif', '_here.gif'));
			} else {
				$(this).find('img').attr('src', $(this).find('img').attr('src').replace('_over.gif', '.gif'));
			}
		}
	);
	
	$('body').supersleight({shim:'images/x.gif', apply_positioning:false});
});
