//this function allows html input tags for addresses
function html(){//0
	var word = prompt("Enter the description","");
	if(word==null){return;}
	var add = prompt("Enter the url your wrapping the word around","http://");
	if(add==null){return;}
	document.form1.r_news.value += "[a]"+word+"|"+add+"[/a]";
	document.form1.r_news.focus();
}//0

//this function bolds text
function btext(){//0
	var word = prompt("Enter the text","");
	if(word==null){return;}
	document.form1.r_news.value += "[b]"+word+"[/b]";
	document.form1.r_news.focus();
}//0

//this function adds italics
function itext(){//0
	var word = prompt("Enter the text","");
	if(word==null){return;}
	document.form1.r_news.value += "[i]"+word+"[/i]";
	document.form1.r_news.focus();
}//0

//this adds an image
function image(){//0
	var value = document.form1.img.options[document.form1.img.selectedIndex].value;

	outside:
	for(i=0;i<document.form1.post.length;i++){//1
		if(document.form1.post[i].checked){//2
			post=document.form1.post[i].value;
			break outside;
		}//2
	}//1
	
	if(value!=""){//1
		document.form1.r_news.value+= "[img]"+post+"|"+value+"[/img]"
	}//1
	else{//1
		alert("You must select an image to insert");
		document.form1.img.focus();
	}//1
}//0

//this adds a link to an image
function imagelink(){//0
	var value = document.form1.img.options[document.form1.img.selectedIndex].value;
	if(value!=""){//1
		var word = prompt("Enter the description","");
		if(word==null){return;}
		
		document.form1.r_news.value += "[a]"+word+"|http://"+document.links[0].hostname+"/viewimage.php?bin_key="+value+"[/a]";
		document.form1.r_news.focus();
	}//1
	else{//1
		alert("You must select an image to link");
		document.form1.img.focus();
	}//1
}//0

function viewpic(pic){//0
	newwin = window.open("","","height=400,width=850,menubar=no,resizeable=no,scrollbars=yes");
	newwin.document.write("<html><head><title>Flatearth Comics</title></head><body bgcolor='white' leftmargin=0 topmargin=0 bottommargin=0><div align=center><img src='"+pic+"' border=0><br><br><a href=\"javascript:(window.close())\"><img src=http://flatearth.152.org/images/close.gif border=0></a></div></body></html>");
}//0