	function registrationRedirect()
	{
		var second = confirm("Have you registered for a My Downhome account?\n\nClick OK for Yes, or Cancel for No.");
		if(second)
		{
			alert("Use your My Downhome web account e-mail address and password to access the Downhome Kitchen.");
		}
		else
		{
			var third = confirm("You need a My Downhome web account to access the Downhome Kitchen.\n\nPress OK to be sent to the My Downhome registration page, or Cancel to stay here.");
			if(third) window.location='http://www.downhomelife.com/register.php';
		}
	}

	function addTag(tagadd,questtext, type, questtext2)
	{
		if(!questtext) questtext = "What text would you like to insert?";
		if(!questtext2) questtext2 = "What text would you like to insert?";
		var me = document.getElementById("myentry");
		if(document.selection)
		{
			me.focus();
			if(document.selection.createRange().text) 
			{
				if(type=="n") document.selection.createRange().text = '['+tagadd+']'+document.selection.createRange().text+'[/'+tagadd+']';
				if(type=="c") 
				{
					response = prompt(questtext,'');
					if(response!=null && response!=""){ document.selection.createRange().text = '['+tagadd+'='+response+']'+document.selection.createRange().text+'[/'+tagadd+']'; }
				}
			}
			else 
			{
				if(type=="n") 
				{
					response = prompt(questtext,'');
					if(response!=null && response!=""){ document.selection.createRange().text = '['+tagadd+']'+response+'[/'+tagadd+']'; }
				}
				if(type=="c") 
				{
					resp1 = prompt(questtext,'');
					resp2 = prompt(questtext2,'');

					if(resp1!=null && resp2!=null && resp1!="" && resp2!=""){	document.selection.createRange().text = '['+tagadd+'='+resp+']'+resp+'[/'+tagadd+']'; }
				}
			}
		}
		else
		{
			var start = me.selectionStart;
			var end = me.selectionEnd;

			var beg = me.value.substring(0,start);
			var select = me.value.substring(start,end);
			var endt = me.value.substring(end,me.textLength);
			if(start!=end)
			{
				if(type=="n") me.value = beg + '['+tagadd+']'+select+'[/'+tagadd+']'+endt;
				if(type=="c") me.value = beg + '['+tagadd+'='+prompt(questtext,'')+']'+select+'[/'+tagadd+']'+endt;
			}
			else
			{
				if(type=="n") me.value = beg + '['+tagadd+']'+prompt(questtext,'')+'[/'+tagadd+']' + endt;
				if(type=="c") me.value = beg + '['+tagadd+'='+prompt(questtext,'')+']'+prompt(questtext2,'')+'[/'+tagadd+']' + endt;
			}
		}
	}

	function addSmiley(smiley)
	{
		var me = document.getElementById("myentry");
		var type="n";

		if(document.selection)
		{
			me.focus();
			document.selection.createRange().text=smiley;
		}
		else
		{
			var start = me.selectionStart;
			var end = me.selectionEnd;

			var beg = me.value.substring(0,start);
			var select = me.value.substring(start,end);
			var endt = me.value.substring(end,me.textLength);

			if(start!=end)
			{
				if(type=="n") me.value = beg + smiley+endt;
				if(type=="c") me.value = beg + smiley+endt;
			}
			else
			{
				if(type=="n") me.value = beg + smiley + endt;
				if(type=="c") me.value = beg + smiley + endt;
			}
		}	
	}
