function showadd(){
	if(document.getElementById('addcmmt').style.display=='none'){
		document.getElementById('addcmmt').style.display='block';
	}else{
		document.getElementById('addcmmt').style.display='none';
	}
}


function add_comment(did){
	
	if(document.getElementById("doc_cmmnt").value=="")
	{	
		document.getElementById('colcomm').innerHTML="<img src='images/exl.jpg' border='0' alt='error' />&nbsp;<font class='Light12 Red2'>Please Enter Comment</font>";
		document.getElementById("doc_cmmnt").focus();
		return false;
	
	}else{
		
		var comment	= document.getElementById("doc_cmmnt").value;
		CommentOnDoc(did,comment);
	}
}

function chk(did){
	document.getElementById(did).innerHTML="";
}

function favorite(did){
	
	
	var fav =	window.confirm("Do you really want to add this document as favorites?");
	if(fav){
		make_favorite(did,'add_docfavorites','document'); 
	}
	else {
	return false; 
	}
}

function joingroup(gid){
	var jn =	window.confirm("Do you really want to join this group?");
	if(jn){
		join_group(gid,'join_group'); 
	}
	else {
	return false; 
	}
}

function delete_audio_comment(comm_id){
	var com =	window.confirm("Do you really want to delete this comment?");
	if(com){
		
		delete_audiocomment(comm_id,'delete_audio_comments'); 
	}
	else {
	return false; 
	}
}

function showshareaudio(){
		if(document.getElementById('shareaudio').style.display=='none'){
			document.getElementById('shareaudio').style.display='block';
		}else{
			document.getElementById('shareaudio').style.display='none';
		}
	}

function charCount(textField, displayArea, maxChars )
{	
		displayArea.innerHTML = textField.value.length+" characters (maximum of "+maxChars+")";
		
		if( textField.value.length > maxChars )
		{
			textField.value = textField.value.slice(0, maxChars);
			displayArea.innerHTML = "Your charcters limit has been completed!!";
			//alert("Your charcters limit has been completed!!");
		}

}

function inappropriate(did){
	
	
	var fav =	window.confirm("Do you really want to mark this document as inappropriate?");
	if(fav){
		make_inappropriate(did,'add_docinappropriate','document'); 
	}
	else {
	return false; 
	}
}
