function addPost(){
	$('#newpostform').toggleClass('visible');
	var currentText=$('#addcancelpostlink').html();
	var newText=(currentText=='Add Post')?'Close':'Add Post';
	$('#addcancelpostlink').html(newText);
}
var noOfFiles=0;
function addAttachment(){
	$('#uploadfields').append('<div class="onefile" id="file'+noOfFiles+'"><input type="file" name="data[files][]"><a href="#" onclick="javascript:removeAttachment('+noOfFiles+'); return false;">Remove</a></div>');
	noOfFiles++;
}
function removeAttachment(filenumber){
	$('#uploadfields #file'+filenumber).remove();
}
function changedclientdd(){
	var clientid=$('#clientdd option:selected').val();
	if(clientid!=''){
		window.location=webroot+'clientarea/setclient/'+clientid;
	}
}