/*	Global variable, e.g. used in cookie code
	(looks up to DominoWiki config. document)
*/
var HOST = 'arlingtonhtschamber.com';
function editPage(frm)
{
	// Called by EditPage button in main form
	var subj = frm.Subject.value;
	document.location = "/web06.nsf/Pages/" + subj + "?Edit";
}
/**
* createBlankPage()
* 
* Triggered from link in site navigation. Prompts user for
* a page title & then creates blank page in edit mode with
* that title.
* 
* Changes:
* Julian Ward 26-Oct-2006: change to accommodate spaces
*
*/
function createBlankPage()
{
	var choice = prompt(LANG_JS_NEW_PG_PROMPT, "");
	if((choice=="") || (choice==null))
	{
		return;
	}
	else
	{
		var pg = trim(choice);
		if((pg=="") || (pg==null))
		{
			return;
		}
		else
		{
			pg = pg.replace(/ /g, "_");	// Julian's change
			document.location = "/web06.nsf/wiki?openform&page=" + pg;
		}
	}
}
function createBlankStoryPage()
{
	var choice = prompt(LANG_JS_NEW_PG_PROMPT, "");
	if((choice=="") || (choice==null))
	{
		return;
	}
	else
	{
		var pg = trim(choice);
		if((pg=="") || (pg==null))
		{
			return;
		}
		else
		{
			pg = pg.replace(/ /g, "_");	// Julian's change
			document.location = "/web06.nsf/storypage?openform&page=" + pg;
		}
	}
}
function rtrim(arg)
{
	while(1)
	{
		if(arg.substring(arg.length - 1, arg.length) != " ") break;
		arg = arg.substring(0, arg.length - 1);
	}
	
	return arg;
}
function ltrim(arg)
{
	while(1)
	{
		if(arg.substring(0, 1) != " ") break;
		arg = arg.substring(1, arg.length);
	}
	return arg;
}
/**
* trim()
* 
* Trims leading spaces from a passed-in string
*
*/
function trim(arg)
{
	var tmpstr = ltrim(arg);
	return rtrim(tmpstr);
}

