$(document).ready(function(){
	$().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();
				}
				
				if(curDashMenuEl != 'undefined' && !target.parents().is('.dashMenu'))
				{
					closeDashMenu(curDashMenuEl);
				}
    });
            
	$(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();
					    } 
					});
});


$(window).bind("load",function(){
	if($.isFunction(window.resizeCommentImages))
	{
		window.resizeCommentImages();
	}
							   
			});