

function doComment() {
jQuery('#comment1').submit();
 
 }
 function doComment_() {
jQuery('#comment1').submit();
 
 }
 
 function deleteArticle(intID,newUrl){
	if(confirm('Are you sure you want to delete the selected article?')){
jQuery.post("admin/code/includes/news_delete.asp?_r="+Math.random(), {id: intID}, function(data){

if(data.length >0) {	
window.location = newUrl;
}});
}
}
function deleteComment(intID,newUrl){
	if(confirm('Are you sure you want to delete the selected comment?')){
jQuery.post("admin/code/includes/decline_life_comment.asp?_r="+Math.random(), {intID: intID}, function(data){

if(data.length >0) {	
window.location = newUrl;
}});
}
}

function saveComment(intID,newUrl){
var textmsg = jQuery('#edit-comment'+intID).val();
var ed =tinyMCE.get('edit-comment'+intID);
ed.setProgressState(1); // Show progress



textmsg = ed.getContent();

jQuery.post("code/includes/updatecomment1.asp?_r="+Math.random(), {intID: intID, msg:textmsg, newUrl:newUrl}, function(data){

if(data.length >0) {	
window.location = newUrl;
}});
}
var edit_html='<textarea id="%id%" name="%id%" class="edit-comment-textarea">%text%</textarea>';
function editComment(btn,intID,newUrl){
 var p=jQuery(btn).parent().find('div.comment-text');
 var id='edit-comment'+intID;
	
	pth=p.html();
	pth=pth.replace(/<\/p>/g,'');
	pth=pth.replace(/<(p|br)( \/)?>/g,"\n");
 
	p.before(edit_html.replace(/%id%/g,id).replace(/%text%/g,pth));
	jQuery('#'+id).css({height:p.height()+20});
	p.hide();
	
	jQuery(btn).hide();
	jQuery(btn).parent().find('.save-comment').show();
tinyMCE.init({
		theme : "advanced",
		mode : "textareas",
		plugins : "emotions,paste,style,iespell,insertdatetime,preview,xhtmlxtras",
		
		doctype : '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">',
		theme_advanced_toolbar_align : "left",
		theme_advanced_toolbar_location : "top",
		skin : "o2k7",
		skin_variant : "black",
		theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,cut,copy,paste,pastetext,pasteword,|,justifyleft,justifycenter,justifyright,justifyfull",
		theme_advanced_buttons2 : "emotions,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
		theme_advanced_buttons3 : "formatselect,fontselect,fontsizeselect",
		
		
	force_br_newlines : true,
        forced_root_block : '', // Needed for 3.x

		debug : false
	});
	
}