function rating(ratingid) {
	if(ratingid == "NC17" || ratingid=="X") {
		
				return confirm("This story contains mature content not suitable for readers under the age of 17. Click 'OK' ONLY IF you are at least 17 years old.");	
				}
	else return true;
	
}


function WhichClicked(ww) {
	window.document.formbody.mode.value = ww;
	
}

function submitonce(theform) {
	// if IE 4+ or NS 6+
	if (document.all || document.getElementById) {
		// hunt down "submit" and "reset"
		for (i=0;i<theform.length;i++) {
			var tempobj=theform.elements[i];
			if(tempobj.type.toLowerCase()=="submit"||tempobj.type.toLowerCase()=="reset") {
				//disable it
				tempobj.disabled=true;
			}
		}
	}
	theform.Submit=true;
}



function storeCaret(text) { 
	if (text.createTextRange) {
		text.caretPos = document.selection.createRange().duplicate();
	}
}

function AddText(text) {
	if (document.formbody.txtBody.createTextRange && document.formbody.txtBody.caretPos) {      
		var caretPos = document.formbody.txtBody.caretPos;      
		caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ?
		text + ' ' : text;
	}
	else document.formbody.txtBody.value += text;  
}



function emai1() {
	AddTxt="[email][/email]";
	AddText(AddTxt);
}

function bold() {
	AddTxt="[b][/b]";
	AddText(AddTxt);
}

function italicize() {
	AddTxt="[i][/i]";
	AddText(AddTxt);
}

function quote() {
	AddTxt="[quote][/quote]";
	AddText(AddTxt);
}


function hyperlink() {
	AddTxt="[url][/url]";
	AddText(AddTxt);
}

function smile() {
	AddTxt=" :)";
	AddText(AddTxt);
}

function underline() {
	AddTxt="[u][/u]";
	AddText(AddTxt);
}

function blush() {
	AddTxt=" :blush:";
	AddText(AddTxt);
}

function wink() {
	AddTxt=" ;)";
	AddText(AddTxt);
}

function grin() {
	AddTxt=" ;D";
	AddText(AddTxt);
}

function angry() {
	AddTxt=" >:(";
	AddText(AddTxt);
}

function sad() {
	AddTxt=" :(";
	AddText(AddTxt);
}

function shocked() {
	AddTxt=" :o";
	AddText(AddTxt);
}

function cool() {
	AddTxt=" 8)";
	AddText(AddTxt);
}

function huh() {
	AddTxt=" ???";
	AddText(AddTxt);
}

function rolleyes() {
	AddTxt=" :roll:";
	AddText(AddTxt);
}

function tongue() {
	AddTxt=" :P";
	AddText(AddTxt);
}

function cry() {
	AddTxt=" ;(";
	AddText(AddTxt);
}

