function ajaxJoinLeaveBlog(obj,idBlog) {   
	obj=$(obj);
	JsHttpRequest.query(
    	DIR_WEB_ROOT+'/include/ajax/joinLeaveBlog.php',                       
        { idBlog: idBlog },
        function(result, errors) {  
        	if (!result) {
                msgErrorBox.alert('Error','Please try again later');           
        	}
            if (result.bStateError) {
            	msgErrorBox.alert(result.sMsgTitle,result.sMsg);
            } else {            	
            	msgNoticeBox.alert(result.sMsgTitle,result.sMsg);
            	if (obj)
            	{   
            	    var member_of_blog = result.bState || false;

            		if (member_of_blog)
            		{            			
            		    obj.removeClass('unsubscribed');
            			obj.addClass('subscribed');            		    
            		}
            		else
            		{
            			obj.removeClass('subscribed');
            			obj.addClass('unsubscribed');
            		}
            		divCount=$('blog_user_count_'+idBlog);
            		if (divCount) {
            			divCount.set('html','<span class="digit">'+result.iCountUser+'</span>');
                        joinAsker = $('joinasker');
                        if(joinAsker) 
                        {
                        	joinAsker.removeClass('active');
                        	if (result.bState) 
                        	{
                        		joinAsker.addClass('active');
                        	}
                        }


            		}
            	}
            }                               
        },
        true
    );
}


function ajaxBlogInfo(idBlog) { 	
	JsHttpRequest.query(
    	DIR_WEB_ROOT+'/include/ajax/blogInfo.php',                       
        { idBlog: idBlog },
        function(result, errors) {  
        	if (!result) {
                msgErrorBox.alert('Error','Please try again later');           
        	}
            if (result.bStateError) {
            	
            } else {            	
            	if ($('block_blog_info')) {
            		$('block_blog_info').set('html',result.sText);            		
            	}
            }                               
        },
        true
    );
}
