jQuery.noConflict();

document.createElement('header');
document.createElement('nav');
document.createElement('aside');
document.createElement('footer');

jQuery(document).ready(function($) {
	var agent = navigator.userAgent.toLowerCase(); 
   	if (agent.indexOf('msie')==-1) {
		$('#mainnav li a').each(function() {
			$(this).append('<a class="hoverlayer">'+$(this).html()+'</a>');
		});
		
		$('#mainnav li a.mainmenuitem').hover(
			function() {
				if(!$(this).hasClass('current')) {
					if($(this).css('backgroundPosition')) {
						var backpos = $(this).css('backgroundPosition').split(" ");
						backpos[1] = backpos[1].replace('px','').replace('%','');
						if(backpos[1]!="0" && backpos[1]!="-159" && backpos[1]!="-318") {
							var newpos = parseInt(backpos[1])+53;
							$(this).css('backgroundPosition',backpos[0]+' '+newpos+'px');
						}
					}
				}
			},
			function() {}
		);
		
		$('#mainnav li a.mainmenuitem').bind('mouseenter',function() {
			if(!$(this).hasClass('current')) {
				$(this).children('.hoverlayer').fadeIn('slow');
			}
		});
		$('#mainnav li a.mainmenuitem').bind('mouseleave',function() {
			if(!$(this).hasClass('current')) {
				$(this).children('.hoverlayer').fadeOut('slow');
			}
		});
   	}
});
