



function toggle(area){

	 document.getElementById(area).style.display = (document.getElementById(area).style.display == "none") ? "" : "none";

	

}



	

		// dropdown jump

	function MM_jumpMenu(targ,selObj,restore)

	{

		if (selObj.value.substring(0,6) == "prompt") {

			prompt('Permalink',selObj.value.substring(7));

			return false;

		}

		else {

			eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");

			if (restore) selObj.selectedIndex=0;

		}

	}

	

	

	function toolExpand()

	{

		messagebox = document.getElementById('mainTextArea');

		if (messagebox.style.height == '50em');

		else if (messagebox.style.height)

			messagebox.style.height = (10+parseInt(messagebox.style.height)) + 'em';

		else

			messagebox.style.height = '20em';

	}



	function toolDexpand()

	{

		messagebox = document.getElementById('mainTextArea')

		if (messagebox.style.height == '10em');

		else if (messagebox.style.height)

			messagebox.style.height = (-10+parseInt(messagebox.style.height)) + 'em';

	}



	function insertAtCaret(prepend, append)

	{

		messagebox = document.getElementById('mainTextArea')

		messagebox.focus()

		

		if (document.selection)

		{

			var range = document.selection.createRange();

			

			if (range.parentElement() != messagebox)

				return;

			

			range.text = prepend + range.text + append;

			range.select();

		}

		else if (typeof messagebox.selectionStart !== 'undefined')

		{

			var start = messagebox.selectionStart;

			var end = messagebox.selectionEnd;

			

			var x = messagebox.value.substring(0, start)

				  + prepend + messagebox.value.substring(start, end) + append

				  + messagebox.value.substring(end, messagebox.value.length);

			messagebox.value = x

			start += prepend.length;

			end += prepend.length;

			messagebox.setSelectionRange(start, end)

		}

		else

			messagebox.value += prepend + append;

		

		messagebox.focus();

		messagebox.scrollTop = messagebox.scrollHeight;

	}



	function insertPrompt(tag, promptext, attribute)

	{

		messagebox = document.getElementById('mainTextArea')

		if (typeof messagebox.selectionStart !== 'undefined' && messagebox.selectionEnd - messagebox.selectionStart)

			insertAtCaret('['+tag+']', '[/'+tag+']');

		else

		{

			href = prompt(promptext, 'http://');

			if (href)

				if (attribute)

				{

					insertAtCaret('['+tag+'=' + href + ']', '[/'+tag+']');

				}

				else

				{

					insertAtCaret('['+tag+']' + href + '[/'+tag+']', '');

				}

		}

	}

	

	function WordCount(){

		var y=document.getElementById('mainTextArea').value;

		var r = 0;

		a=y.replace(/\s/g,' ');

		a=a.split(' ');

		for (z=0; z<a.length; z++) {if (a[z].length > 0) r++;}

		document.getElementById('wordcount').innerHTML = document.getElementById('mainTextArea').value.length + ' Characters, ' + r + ' Words.';

	}

	







	function del(msg, link) {

		var answer = confirm(msg);

		if (answer){

			window.location = link;

		}

	}





function spoil(n) {

	n=n.nextSibling;

	if(n.style.display=='none')

		n.style.display = 'inline';

	else

		n.style.display = 'none';

}



function ob(thiss,valuee,pwd){

	if(thiss.value==''){

		thiss.value=valuee;

		thiss.style.color='#777';

		if(pwd == 1){thiss.type='text';}

	}



}



function of(thiss,valuee,pwd){

	if(thiss.value==valuee){

		thiss.value='';

		if(pwd == 1){thiss.type='password';}

	}

	thiss.style.color='#000';

}



/*



function fragHandr(thiss){



	if(thiss.value.length <= 139 & thiss.value.length >= 120){

		document.getElementById('fragcount').style.color = "#dd7700";

	}

	else if(thiss.value.length >= 140){

		document.getElementById('fragcount').style.color = "#f00";

		//document.getElementById('fragupdate').style.display = 'none';

	}else{

		document.getElementById('fragcount').style.color = "#000";

		

	}

	

	//if(thiss.value.length >= 1){

		document.getElementById('fragcount').innerHTML=thiss.value.length

	//}





}



function fragBlur(thiss){	

	thiss.style.height ="15px" ;

}



function fragFocus(thiss){	

	thiss.style.height ="100px" ;

}

*/


