function citation(id, titleIntro, bodyIntro){
	var bodyItem = document.getElementById('comment_body');
	var titleItem = document.getElementById('comment_title');

	var bodySource = document.getElementById('posting_body_'+id).innerHTML;
	var titleSource = document.getElementById('posting_title_'+id).value;

	var newBody = bodyIntro + '\n' + bodySource + '\n[/quote]';
	var newTitle = titleIntro + titleSource;

	bodyItem.innerHTML = newBody;
	titleItem.value = newTitle;

	bodyItem.focus();
}

function editpost(id){
	var body = document.getElementById('posting_body_'+id);
	var title = document.getElementById('posting_title_'+id);

	var oldbody = document.getElementById('txtposting_body_'+id);

	oldbody.style.display = 'none';

	body.style.display = '';
	title.style.display = '';

	body.readOnly = false;
	title.readOnly = false;

	body.style.border = '1px #d10000 solid';
	title.style.border = '1px #d10000 solid';

	document.getElementById('posting_submit_'+id).style.display = 'inline';
	body.focus();
}

 function changeNews(id){
 	$('topnews').getElements('.newsimage').each(function(el){
 		el.setStyle('display','none');
 	});
 	$('topnews').getElements('.news_preview_item').each(function(el){
 		el.setStyle('display','none');
 	});
 	$('topnews').getElements('.news_tag_item').each(function(el){
 		el.setStyle('display','none');
 	});

 	$$('.news_subnav_item').each(function(el){
  			str = el.getAttribute('class');

  			if(str == null){
  				str = 'none';
  			}

  			if(str.indexOf(' selected') != -1){
  				str = str.substring(0,str.indexOf(' selected'));
  			}
  			el.setAttribute('class', str);
  	});

  	$('newssubnav_'+id).setAttribute('class',$('newssubnav_'+id).getAttribute('class')+' selected');

 	$('newsimage_'+id).setStyle('display','block');
 	$('newspreview_'+id).setStyle('display','block');
 	$('newstags_'+id).setStyle('display','block');
 }