 
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()
{
	var status=document.getElementById('statusvalue').value;  
	getHtmlData( 'tweet_block', 'member.php?show=tweet&action=update&status='+status);
	//afterStatusEdit();
	return false;
}

function dynamicCommentUpdate(tweetid, iter)
{
	var comment=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 dynamicFollowRemove(iFollowerID)
{
	getHtmlData( 'tweet_block', 'member.php?show=tweet&action=unfollow&followed='+iFollowerID );
 
	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;
}
 