$(document).ready(function(){
	$(window).mousemove(function(event){
								 
				var target = $(event.target);
				
				window.cursorPosX = event.pageX;
				window.cursorPosY = event.pageY;
				
				if($('#cursorSatellite').length > 0)
				{
					$('#cursorSatellite').css('top', window.cursorPosY);
					$('#cursorSatellite').css('left', window.cursorPosX+15);	
				}
				
				if(SmWinCurElem != null && !target.parents().is('.UCmenu') && SmWinPermanent != true)
				{
					closeSmWin();
				} 
    });
            
	$(document).click(function(event) {
						var target = $(event.target);

					    if(!target.is("#search_block") && !target.parents().is('#search_block') && (typeof(wl_opened)!='undefined' && wl_opened)){
				       		wClick($("#wBox"));
					    }
					    else if(!target.is("#search_block") && !target.parents().is('#search_block') && !target.is("#search_img"))
					    {
							if($("#search_block").css('display') == 'block')
							{
								showSB();
							}
					    }
					    
					    //close SwWin if opened
					    if(SmWinCurElem != null && !target.is("#SmWin") && !target.parents().is('#SmWin'))
					    {
							closeSmWin();
					    } 
					});
});