jQuery.noConflict();

(function($) { 
$(document).ready(function(){
	$('.nav li:has(ul)').hover(
		function() {
			//jQuery.each(jQuery.browser, function(i) {
			//	if(!$.browser.msie || jQuery.browser.version != '7.0'){
					$('.nav li:has(ul)').removeClass('hover'); 
					$(this).addClass('hover');
					$('.nav li:has(ul) a').removeClass('hover'); 
					$(this).children('a').addClass('hover');
			//	}
			//});
			$('.content').addClass('fade');
			$('.sider').addClass('fade');
		},
		function() {
			//jQuery.each(jQuery.browser, function(i) {
			//	if(!$.browser.msie || jQuery.browser.version != '7.0'){
					$(this).removeClass('hover'); 
					$(this).children('a').removeClass('hover');
			//	}
			//});
			$('.content').removeClass('fade');
			$('.sider').removeClass('fade');
		}
	);	
});
})(jQuery); 

function loadContent(url) {
	(function($) { 
		deleteContent();
		var imgStr = '<img src="/fileadmin/templates/images/grid-loading.gif" border="0" alt="loading">';
		$("body").append('<div class="soulBox"><p>' + imgStr + '</p></div>');
		$.ajax({
			url: url,
			cache: true,
			success: function(html){
				$(".soulBox p").replaceWith(html);
				//$(".soulBox").append('<p id="db">db</p>');
			},
			beforeSend: function(){
				$(".soulBox").html('<p>' + imgStr + '</p>');
			},
		});
		$().mousemove(function(e){
			posY = e.pageY+10;
			posX = e.pageX+10;
			/*
			lowest = $('.soulBox').height() + posY + 20;
			if(lowest >= $(window).height()) {
				posY = $(window).height() - lowest + e.pageY+20;
			}
			$("#db").text($(window).height() + ' > ' + lowest);
			*/
			$('.soulBox').css('left', posX+'px');
			$('.soulBox').css('top', posY+'px');
			//$('body').css('overflow', 'hidden');
		}); 
	})(jQuery); 
}

function deleteContent() {
	(function($) { 
		$('div.soulBox').remove();
		//$('body').css('overflow', 'auto');
		//$('body').css('height', $("body").height());
	})(jQuery); 
}
