// JavaScript Document
function process_manage() {
		theForm = document.getElementById('UserBlockForm');
		theStr = '';
		for (i=0; i < theForm.elements.length; i++) {
		ele = theForm.elements[i];
		theStr += ele.name + ' = ' + ele.value + "&";
	 	}
		//WriteDiv('debugdiv',theStr);
		$.post('manage.php',  theStr , function(data) {
			//WriteDiv('debugdiv',data);
			$("#NotifyDivSaving").show("5000",function () {
					$(this).hide("5000");
					}
			);
			$("#NotifyDivSaving2").show("8000",function () {
					$(this).hide("8000");
					}
			);			
			$(function() {
				$( function() {
					$('#container ul').tabsLoad(3);;
					return true;
					});
			});
		});
}
function process_boxarrange(value) {
		$.post('order.php?save=1&'+ value , function(data) {
			//WriteDiv('debugdivv',data);
			$("#NotifyDivSaving").show("8000",function () {
					$(this).hide("8000");
					}
			);
			$("#NotifyDivSaving2").show("8000",function () {
					$(this).hide("8000");
					}
			);
			$(function() {
				$( function() {
					$('#container ul').tabsLoad(4);
					return true;
					});
			});
	});
}

// Set the "outer" HTML of an element.
function setOuterHTML(element, toValue)
{
	if (typeof(element.outerHTML) != 'undefined')
		element.outerHTML = toValue;
	else
	{
		var range = document.createRange();
		range.setStartBefore(element);
		element.parentNode.replaceChild(range.createContextualFragment(toValue), element);
	}
}


var RSSOptionNum = 0;

function addRSSOption()
{
	if (RSSOptionNum == 0)
	{
		for (var i = 0; i < document.forms.UserBlockForm.elements.length; i++)
			if (document.forms.UserBlockForm.elements[i].id.substr(0, 8) == "options[")
				pollOptionNum++;
	}
	RSSOptionNum++

	setOuterHTML(document.getElementById("RSSMoreOptions"), '<br /><fieldset><Legend>New RSS Feed - ' + RSSOptionNum + '</legend>URL<br><input type="text" name="rss[' + (RSSOptionNum - 1) + ']" id="rss-' + (RSSOptionNum - 1) + '" value="" size="60" /> <input type="hidden" name="rss_new[' + (RSSOptionNum - 1) + ']" id="rss-' + (RSSOptionNum - 1) + '" value="' + (RSSOptionNum - 1) + '" size="20" /></fieldset><span id="RSSMoreOptions"></span>');
}
