function swap_visible_blocks(div_to_hide, div_to_show)
{
hide_div = div_to_hide;
show_div = div_to_show;

var h = document.getElementById(hide_div);
var s = document.getElementById(show_div);

h.style.display = 'none';
s.style.display = 'block';
}


function login()
{
hide_div = "lw_login_box_container_inner_copy";
show_div = "lw_login_box_container_inner_login";

var h = document.getElementById(hide_div);
var s = document.getElementById(show_div);

h.style.display = 'none';
s.style.display = 'block';
}

function about()
{
hide_div = "lw_login_box_container_inner_login";
show_div = "lw_login_box_container_inner_copy";

var h = document.getElementById(hide_div);
var s = document.getElementById(show_div);

h.style.display = 'none';
s.style.display = 'block';
}


function hide_div(which_div)
{
var a = document.getElementById(which_div);
a.style.display = "none";
}


function show_div(which_div)
{
var a = document.getElementById(which_div);
a.style.display = "block";
}


function showImgInstructions()
{
var a = document.getElementById("add_img_instructions");
var b = document.getElementById("instructions_link");

if (a.style.display == "block")
	{
	a.style.display = "none";
	b.innerHTML = '<a href="javascript:showImgInstructions();">instructions</a>';
	}
else
	{
	a.style.display = "block";
	b.innerHTML = '<a href="javascript:showImgInstructions();">hide instructions</a>';
	}
}


function checkInputIn(which_form, which_input, should_be)
{
var a = eval("document.forms."+which_form+"."+which_input+".value");
if (a == should_be)
	{
	eval("document.forms."+which_form+"."+which_input+".value = '';");
	}
}

function checkInputOut(which_form, which_input, should_be)
{
var a = eval("document.forms."+which_form+"."+which_input+".value");
if (a == "")
	{
	eval("document.forms."+which_form+"."+which_input+".value = '"+should_be+"';");
	}
}


function ListOnOff(which_list)
{
var a = which_list
eval("var b = document.forms.settingsForm."+a+".value;");
var c = "tick_"+a
var d = document.getElementById(c);

if (b == "1")
	{
	eval("document.forms.settingsForm."+a+".value = '0';");
	d.src = "/_images/misc/tick_off.png";
	}
else
	{
	eval("document.forms.settingsForm."+a+".value = '1';");
	d.src = "/_images/misc/tick_on.png";
	}
}


function changePriorities(which_pri, which_direction, min_max)
{
var a = which_pri;
var d = which_direction;
da = "down_arrow_"+which_pri;
ua = "up_arrow_"+which_pri;
var down_arrow = document.getElementById(da);
var up_arrow = document.getElementById(ua);

eval("var b = document.forms.settingsForm."+a+".value;");

if (d == "up")
	{
	var max_priorities = min_max;
	if (parseInt(b) < max_priorities)
		{
		var c = parseInt(b)+1;
		if (c == max_priorities)
			{
			up_arrow.src = "/_images/misc/arrow_up_grey.png";
			}
		down_arrow.src = "/_images/misc/arrow_down.png";
		}
	else
		{
		var c = parseInt(b);
		}
	}
else
	{
	var min_priorities = min_max;
	if (parseInt(b) > min_priorities)
		{
		var c = parseInt(b)-1;
		if (c == min_priorities)
			{
			down_arrow.src = "/_images/misc/arrow_down_grey.png";
			}
		up_arrow.src = "/_images/misc/arrow_up.png";
		}
	else
		{
		var c = parseInt(b);
		}
	}

eval("document.forms.settingsForm."+a+".value = '"+c+"';");
}


function ShowBought(which_option)
{
var a = document.getElementById("show_bought_list_zero");
var b = document.getElementById("show_bought_list_one");
var c = document.getElementById("show_bought_list_two");
var d = which_option;

if (d == "zero")
	{
	a.src = "/_images/misc/tick_on.png";
	b.src = "/_images/misc/tick_off.png";
	c.src = "/_images/misc/tick_off.png";
	document.forms.settingsForm.show_bought_list.value = "0";
	bought_cell_zero.className = "light_green_copy";
	bought_cell_one.className = "";
	bought_cell_two.className = "";
	}

else if (d == "one")
	{
	a.src = "/_images/misc/tick_off.png";
	b.src = "/_images/misc/tick_on.png";
	c.src = "/_images/misc/tick_off.png";
	document.forms.settingsForm.show_bought_list.value = "1";
	bought_cell_zero.className = "";
	bought_cell_one.className = "light_green_copy";
	bought_cell_two.className = "";
	}

else if (d == "two")
	{
	a.src = "/_images/misc/tick_off.png";
	b.src = "/_images/misc/tick_off.png";
	c.src = "/_images/misc/tick_on.png";
	document.forms.settingsForm.show_bought_list.value = "2";
	bought_cell_zero.className = "";
	bought_cell_one.className = "";
	bought_cell_two.className = "light_green_copy";
	}
}


function ShowAge(which_option)
{
var a = document.getElementById("show_age_no");
var b = document.getElementById("show_age_yes");
var c = which_option;

if (c == "y")
	{
	a.src = "/_images/misc/tick_off.png";
	b.src = "/_images/misc/tick_on.png";
	document.forms.settingsForm.show_age.value = "1";
	show_age_cell_yes.className = "light_green_copy";
	show_age_cell_no.className = "";
	}

else if (c == "n")
	{
	a.src = "/_images/misc/tick_on.png";
	b.src = "/_images/misc/tick_off.png";
	document.forms.settingsForm.show_age.value = "0";
	show_age_cell_no.className = "light_green_copy";
	show_age_cell_yes.className = "";
	}
}


function DefaultList(which_option)
{
var a = document.getElementById("default_general_list");
var b = document.getElementById("default_engagement_list");
var c = document.getElementById("default_wedding_list");
var d = document.getElementById("default_christening_list");
var e = which_option;

if (e == "general")
	{
	a.src = "/_images/misc/tick_on.png";
	b.src = "/_images/misc/tick_off.png";
	c.src = "/_images/misc/tick_off.png";
	d.src = "/_images/misc/tick_off.png";
	document.forms.settingsForm.default_list.value = "general";
	}

else if (e == "engagement")
	{
	a.src = "/_images/misc/tick_off.png";
	b.src = "/_images/misc/tick_on.png";
	c.src = "/_images/misc/tick_off.png";
	d.src = "/_images/misc/tick_off.png";
	document.forms.settingsForm.default_list.value = "engagement";
	}

else if (e == "wedding")
	{
	a.src = "/_images/misc/tick_off.png";
	b.src = "/_images/misc/tick_off.png";
	c.src = "/_images/misc/tick_on.png";
	d.src = "/_images/misc/tick_off.png";
	document.forms.settingsForm.default_list.value = "wedding";
	}

else if (e == "christening")
	{
	a.src = "/_images/misc/tick_off.png";
	b.src = "/_images/misc/tick_off.png";
	c.src = "/_images/misc/tick_off.png";
	d.src = "/_images/misc/tick_on.png";
	document.forms.settingsForm.default_list.value = "christening";
	}
}


function UpdateSettings()
{
document.forms.settingsForm.submit();
}


function showMyWords(which_words)
{
var a = which_words;
var words_general = document.getElementById("showMyWords_general");
var words_romance = document.getElementById("showMyWords_romance");
var words_engagement = document.getElementById("showMyWords_engagement");
var words_wedding = document.getElementById("showMyWords_wedding");
var words_christening = document.getElementById("showMyWords_christening");

if (a == "general")
	{
	words_general.style.display = "block";
	words_romance.style.display = "none";
	words_engagement.style.display = "none";
	words_wedding.style.display = "none";
	words_christening.style.display = "none";
	}
else if (a == "romance")
	{
	words_general.style.display = "none";
	words_romance.style.display = "block";
	words_engagement.style.display = "none";
	words_wedding.style.display = "none";
	words_christening.style.display = "none";
	}
else if (a == "engagement")
	{
	words_general.style.display = "none";
	words_romance.style.display = "none";
	words_engagement.style.display = "block";
	words_wedding.style.display = "none";
	words_christening.style.display = "none";
	}
else if (a == "wedding")
	{
	words_general.style.display = "none";
	words_romance.style.display = "none";
	words_engagement.style.display = "none";
	words_wedding.style.display = "block";
	words_christening.style.display = "none";
	}
else if (a == "christening")
	{
	words_general.style.display = "none";
	words_romance.style.display = "none";
	words_engagement.style.display = "none";
	words_wedding.style.display = "none";
	words_christening.style.display = "block";
	}
else if (a == "hideAll")
	{
	words_general.style.display = "none";
	words_romance.style.display = "none";
	words_engagement.style.display = "none";
	words_wedding.style.display = "none";
	words_christening.style.display = "none";
	}
}


function changeStrap ()
{
var nextStrapNum = currentStrapNum+1;
if (nextStrapNum == 6)
	{
	nextStrapNum = 1;
	}

var currentStrap = "strap"+currentStrapNum;
var nextStrap = "strap"+nextStrapNum;

var currentImg = "strapImg"+currentStrapNum;
var nextImg = "strapImg"+nextStrapNum;

var currentStrapDiv = document.getElementById(currentStrap);
var nextStrapDiv = document.getElementById(nextStrap);

var currentImgDiv = document.getElementById(currentImg);
var nextImgDiv = document.getElementById(nextImg);

currentStrapDiv.style.display = "none";
nextStrapDiv.style.display = "block";

currentImgDiv.src = "/_images/misc/circle_small.gif";
nextImgDiv.src = "/_images/misc/circle_large.gif";

currentStrapNum = nextStrapNum;
}


function changeStrapL(which_strap)
{
clearInterval (ChangeStrapIntervalId);

var a = which_strap;

var StrapDiv = "strap"+a;
var ImgDiv = "strapImg"+a;

var StrapDivID = document.getElementById(StrapDiv);
var ImgDivID = document.getElementById(ImgDiv);


var StrapDivIDOne = document.getElementById("strap1");
var StrapDivIDTwo = document.getElementById("strap2");
var StrapDivIDThree = document.getElementById("strap3");
var StrapDivIDFour = document.getElementById("strap4");
var StrapDivIDFive = document.getElementById("strap5");

var ImgDivIDOne = document.getElementById("strapImg1");
var ImgDivIDTwo = document.getElementById("strapImg2");
var ImgDivIDThree = document.getElementById("strapImg3");
var ImgDivIDFour = document.getElementById("strapImg4");
var ImgDivIDFive = document.getElementById("strapImg5");

StrapDivIDOne.style.display = "none";
StrapDivIDTwo.style.display = "none";
StrapDivIDThree.style.display = "none";
StrapDivIDFour.style.display = "none";
StrapDivIDFive.style.display = "none";

ImgDivIDOne.src = "/_images/misc/circle_small.gif";
ImgDivIDTwo.src = "/_images/misc/circle_small.gif";
ImgDivIDThree.src = "/_images/misc/circle_small.gif";
ImgDivIDFour.src = "/_images/misc/circle_small.gif";
ImgDivIDFive.src = "/_images/misc/circle_small.gif";

StrapDivID.style.display = "block";
ImgDivID.src = "/_images/misc/circle_large.gif";
}


function showHelp()
{
var a = document.getElementById("list_help");

if (a.style.display == "block")
	{
	a.style.display = "none";
	}
else
	{
	a.style.display = "block";
	}
}