<!--

var aURLParams = new Array();

function DisplayEditPopup(sForm, sTitle, sID, nHeight)
{
	var sName = sTitle; // popup name
	var nWidth = "700"; // popup width
	var nLeft = (screen.width - nWidth) / 2 ;
	var nTop = (screen.height - nHeight) / 2;
	var windowproperties = "fullscreen=0,scrollbars=0,toolbar=0,menubar=0,status=0,location=0,directories=0";
	var sURL = sForm + "?ID=" + sID;
	var newwin = window.open(sURL, sName, windowproperties);
	newwin.resizeTo(nWidth, nHeight);
	newwin.moveTo(nLeft, nTop);
}

function UploadFile(sType)
{
 	sCall = "upload.php?Type=" + sType;
    window.open(sCall,"upload","width=360,height=150,resizable=no,scrollbars=yes");
}

function AddEmoticon()
{
 	var sShortCut = "";
	var sURL = "http://";
	var sCall = "";
	
	sURL = prompt("Enter the URL for the Emoticon:", "http://fourfreedomsblog.com/emoticons/");
	if((sURL == '') || (sURL == null))
		return;

	sShortCut = prompt("Enter the text shortcut:", "");
	if((sShortCut == '') || (sShortCut == null))
		return;

	sCall = "AdminFunctions.php?Act=AddEmoticon&ShortCut=" + sShortCut + "&ImageURL=" +sURL;
	window.location.href=sCall;

}

function AddLink()
{
 	var sShortCut = "";
	var sURL = "http://";
	var tbl = document.getElementById('LinksTable');
	var iRowCount = document.getElementById('RowCount');
	
	sURL = prompt("Enter the URL for the link:", "http://");
	if((sURL == '') || (sURL == null))
		return;
			
	sLinkText = prompt("Enter the text for the link:", "");
	if((sLinkText == '') || (sLinkText == null))
		return;

	sCall = "AdminFunctions.php?Act=AddLink&LinkText=" + sLinkText + "&LinkURL=" +sURL;
	window.location.href=sCall;

}

function RequestEmoSort(sWhatToDo)
{
	sCall = "BlogAdmin.php?Act=Emoticons&ShowCounts=" + sWhatToDo;
	window.location.href=sCall;
}

function AddSound()
{
 	var sShortCut = "";
	var sURL = "http://";
	var sCall = "";
	var sMIMEType = "";
	
	sURL = prompt("Enter the URL for the sound:", "http://fourfreedomsblog.com/sounds/");
	if((sURL == '') || (sURL == null))
		return;
			
	sShortCut = prompt("Enter the text shortcut:", "");
	if((sShortCut == '') || (sShortCut == null))
		return;

	sCall = "AdminFunctions.php?Act=AddSound&ShortCut=" + sShortCut + "&URL=" +sURL;
	window.location.href=sCall;

}

function DeleteSoundBit(nSoundID, sSoundName)
{
 	var bDel = false;
	bDel = window.confirm("Are you sure you want to delete '" + sSoundName + "'?");
	if (bDel)
	{
	    sURL = "AdminFunctions.php?Act=DeleteSoundBit&SoundID=" + nSoundID;
		window.location.href=sURL;
	}

}

function DeleteKeyword(sKeyword)
{
 	var bDel = false;
	bDel = window.confirm("Are you sure you want to delete '" + sKeyword + "'?");
	if (bDel)
	{
		var sURL = 'AdminSubmit.php?Act=DeleteKeyword&ID=' + sKeyword;
		window.location.href=sURL;
	}
}

function AddNoiseWord()
{
	sNewNoiseWord = prompt("Specify new Noise word:", '');
	if((sNewNoiseWord == '') || (sNewNoiseWord == null))
		return;

 	var sSetNum = document.getElementById('SetNum').value;
 	var sSetRows = document.getElementById('SetRows').value;
 	
 	// get the SortBy And Desc values
	var sOrgURL = document.URL;
        GetURLParams(sOrgURL);
        aURLParams = aURLParams.slice(1);

	var sURL = 'AdminSubmit.php?Act=AddForbiddenKeyword&ID=' + sNewNoiseWord + "&SetNum=" + sSetNum + "&SetRows=" + sSetRows + aURLParams.splice();
	window.location.href=sURL;
}

function EditKeyword(sKeyword)
{
	sNewKeyword = prompt("Modify the Keyword:", sKeyword);
	if((sNewKeyword == '') || (sNewKeyword == null))
		return;

 	var sSetNum = document.getElementById('SetNum').value;
 	var sSetRows = document.getElementById('SetRows').value;
 	
 	// get the SortBy And Desc values
	var sOrgURL = document.URL;
        GetURLParams(sOrgURL);
        aURLParams = aURLParams.slice(1);

	var sURL = 'AdminSubmit.php?Act=EditKeyword&ID=' + sKeyword + '&NewKeyword=' + sNewKeyword + "&SetNum=" + sSetNum + "&SetRows=" + sSetRows + aURLParams.splice();
	window.location.href=sURL;
}

function DeleteKeywords()
{
 	var bDel = false;
	bDel = window.confirm("Are you sure you want to delete all of the marked Keywords??");
	if (bDel)
	{
	 	var oAction = document.getElementById('DeleteAction');
		oAction.value="Delete";
		document.KeywordList.submit();
	}
}

function NoiseKeywords()
{
 	var bDel = false;
	bDel = window.confirm("Are you sure you want to move all of the marked Keywords to the Noise Words list??");
	if (bDel)
	{
	 	var oAction = document.getElementById('DeleteAction');
		oAction.value="Noise";
		document.KeywordList.submit();
	}
}

function GetURLParams(sURL)
{
	var nPos = 0;

	// get the param section
	nPos = sURL.indexOf('?',0);
	if(nPos == -1)
		return;
	nPos++;
	sURL = sURL.substring(nPos);

	// now split
	aURLParams = sURL.split('&');
	return;
}


function ChangeBlogID()
{
	var sSelectedBlogID = document.getElementById('BlogTitle').value;
        document.getElementById('LogBlogID').value = sSelectedBlogID;
}

//-->

