 
function cancelStatusEdit()
{
	document.statusfrm.statusvalue.value=document.getElementById("topic").innerHTML;
	document.getElementById("statusshow").style.display="block";
	document.getElementById("statusupdate").style.display="none";
}

function afterStatusEdit()
{
	var newVal=document.statusfrm.statusvalue.value
	if(newVal == "")
		newVal = document.statusfrm.notext.value;
	
	document.getElementById("topic").innerHTML = newVal;
	document.getElementById("statusshow").style.display="block";
	document.getElementById("statusupdate").style.display="none";
}

function goStatusEdit()
{
	document.statusfrm.statusvalue.value=document.getElementById("topic").innerHTML;
	document.getElementById("statusupdate").style.display="block";
	document.getElementById("statusshow").style.display="none";
}
 
function goCommentPost(thisComment)
{ 
	document.getElementById("comm_postbox_"+thisComment).style.display="block"; 
	document.getElementById("comm_postdiv_"+thisComment).style.display="none"; 
    document.getElementById("comm_text_"+thisComment).focus();  
}

function resetCommentDefault(thisComment, val)
{ 
	if(val == "")
	{
		document.getElementById("comm_postbox_"+thisComment).style.display="none";  
		document.getElementById("comm_postdiv_"+thisComment).style.display="block";  
	}
}
 
function resetCommentOnSubmit(thisComment)
{  
	document.getElementById("comm_postbox_"+thisComment).style.display="none";  
	document.getElementById("comm_postdiv_"+thisComment).style.display="block";   
}

function dynamicStatusUpdate()
{
	
	if(document.forms["statusfrm"].elements["statusvalue_view"].checked) {
			document.forms["statusfrm"].elements["statusvalue_view"].value = '2' ;
		} else {
			document.forms["statusfrm"].elements["statusvalue_view"].value = '1' ;
		}
		
		var statusvalueview = document.forms["statusfrm"].elements["statusvalue_view"].value;
	var status=encodeURIComponent(document.getElementById('statusvalue').value);  
	var statusvaluepage=document.getElementById('statusvalue_page').value;  
	var statusvaluemode=document.getElementById('statusvalue_mode').value;  

	getHtmlData( 'tweet_block', 'member.php?show=tweet&action=update&status='+status+'&page='+statusvaluepage+'&bizblogMode='+statusvaluemode+'&bizblogView='+statusvalueview);
	//afterStatusEdit();
	return false;
}

function dynamicCommentUpdate(tweetid, iter)
{
	var comment=encodeURIComponent(document.getElementById('comm_text_'+iter).value); 
	document.getElementById('comm_text_'+iter).value=""; 
	
	resetCommentOnSubmit(iter);
  
	getHtmlData( 'comm_container_'+tweetid, 'member.php?show=tweet&action=addcomment&parent='+tweetid+'&comment='+comment+'&iter='+iter);
	
	//afterStatusEdit();
	return false;
}

function dynamicCommentRemove(tweetid, commid, iNumComments, iter)
{
	getHtmlData( 'comm_container_'+tweetid, 'member.php?show=tweet&action=remcomment&parent='+tweetid+'&id='+commid+'&iter='+iter);
	
	if(iNumComments==1){ 
		document.getElementById("comm_block_"+iter).style.display="none";  
	}
	 
	return false;
}
function dynamicPostRemove(tweetid)
{
	var statusvaluepage=document.getElementById('statusvalue_page').value; 
	var statusvaluemode=document.getElementById('statusvalue_mode').value;
	getHtmlData( 'tweet_block', 'member.php?show=tweet&action=rempost&rempostid='+tweetid+'&page='+statusvaluepage+'&bizblogMode='+statusvaluemode);
	
	

	 
	return false;
}

function dynamicFollowRemove(iFollowerID)
{
	
	var statusvaluepage=document.getElementById('statusvalue_page').value; 
	var statusvaluemode=document.getElementById('statusvalue_mode').value;
	getHtmlData( 'tweet_block', 'member.php?show=tweet&action=unfollow&followed='+iFollowerID+'&page='+statusvaluepage+'&bizblogMode='+statusvaluemode );
 
	return false;
}


function toggleClass(id, doWhat)
{ 
	if(doWhat == "showit"){ 
		document.getElementById(id).setAttribute("class", "hover_post");
	}else{ 
		document.getElementById(id).setAttribute("class", "nohover_post");
	}
	
}

function toggleCommBlock(iter, action, val)
{
 
	if(action=="hide"){ 
		document.getElementById("comm_block_"+iter).style.display="none";  
	}else{
		if(val == ''){
			document.getElementById("comm_block_"+iter).style.display="block";  
			document.getElementById("comm_postbox_"+iter).style.display="block";  
			document.getElementById("comm_postdiv_"+iter).style.display="none";
			document.getElementById("comm_text_"+iter).focus();  
		}
	}
	 
	return false;
}
 