<!--

/**
Create the page for the image called e.g. sometimes_xyz.html
Update the "pageName" variable in this page so that it is the name of the story e.g. xyz

Add the new page name to the pages array at the index that you want it to appear
e.g. if page is called sometimes_xyz.html, add "xyz"

Add the path to the main title image to the images array at the same index as above

Create the page for the story with the same name as above e.g. call it xyz.html
Add the story text to the body of the page
Update the "pageName" variable in this page so that it is the name of the story e.g. xyz

Add the name of the story page to the stories array at the same index as above

If the new sometimes moment is the first one in the list (after the "share" page), update the link in moments/sometimes_share.html

Upload the two new pages, the new image, brains_sometimes.js and moments/sometimes_share.html (if changed)

**/

var pages = ["share", "travelled", "uni", "fine", "christmas", "salesman", "greatness", "montreal", "long", "part", "plan", "where", "wedding", "settledown", "scotland", "offering", "colourlife", "perfectday", "trip", "portrait", "true", "book", "busy", "day", "newyear", "tasmania", "england", "india", "buckingham", "wa", "carolina"];

var images = ["", "images/t_travelled.gif", "images/t_uni.gif", "images/t_fine.gif", "images/t_christmas.gif", "images/t_salesman.gif", "images/t_greatness.gif", "images/t_montreal.gif", "images/t_long.gif", "images/t_part.gif", "images/t_plan.gif", "images/t_where.gif", "images/t_wedding.gif", "images/t_settledown.gif", "images/t_scotland.gif", "images/t_offering.gif", "images/t_colourlife.gif", "images/t_perfectday.gif", "images/t_trip.gif", "images/t_portrait.gif", "images/t_true_romance.gif", "images/t_book.gif", "images/t_busy.gif", "images/t_day.gif", "images/t_nyear.gif", "images/t_tasmania.gif", "images/t_england.gif", "images/t_india.gif", "images/t_buckingham.gif", "images/t_wa.gif", "images/t_carolina.gif"];

var stories = ["", "travelled.html", "uni.html", "fine.html", "christmas.html", "salesman.html", "greatness.html", "montreal.html", "long.html", "part.html", "plan.html", "where.html", "wedding.html", "settledown.html", "scotland.html", "offering.html", "colourlife.html", "perfectday.html", "trip.html", "portrait.html", "true.html", "book.html", "busy.html", "day.html", "newyear.html", "tasmania.html", "england.html", "india.html", "buckingham.html", "wa.html", "carolina.html"];

function getImage(pageName){
	var s = getStory(pageName);
	var t;
	for (var i=0; i<pages.length; i++){
		if (pages[i]==pageName){
			t=images[i];
		}
	}
	document.write('<a href="' + s + '"><img src="' + t + '" width="442" height="282" border="0" alt="click here to read about this Oyster Bay moment"></a>');
}

function getStory(pageName){
	var s;
	for (var i=0; i<pages.length; i++){
		if (pages[i]==pageName){
			s=stories[i];
		}
	}
	return s;
}

function getHeadline(pageName){
	var h = "sometimes_" + pageName + ".html";
	return h;
}

function writeNext(pageName){
	var n = getNext(pageName);
	document.write('<a href="sometimes_' + n + '.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'next\',\'\',\'images/buttons/next.gif\',1)"><img src="images/buttons/_next.gif" alt="next moment" name="next" width="43" height="22" border="0"></a>');
	//document.write(pageName);
}

function writePrev(pageName){
	var p = getPrev(pageName);
	document.write('<a href="sometimes_' + p + '.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'prev\',\'\',\'images/buttons/prev.gif\',1)"><img src="images/buttons/_prev.gif" alt="previous moment" name="prev" width="64" height="22" border="0"></a>');
	//document.write(pageName);
}

function writeMore(pageName){
	var s = getStory(pageName);
	document.write('<a href="' + s + '" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'more\',\'\',\'images/buttons/read.gif\',1)"><img src="images/buttons/_read.gif" alt="read more" name="more" width="72" height="22" border="0"></a>');
}

function writeBack(pageName){
	var h = getHeadline(pageName);
	document.write('<a href="' + h + '" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'back\',\'\',\'images/buttons/back.gif\',1)"><img src="images/buttons/_back.gif" alt="back to headlines" name="back" width="43" height="22" border="0"></a>');
}

function getNext(pageName){
	var n;
	for (var i=0;i<pages.length; i++){
		if(pages[i]==pageName){
			if(pages[i+1]!=null){
				n=pages[i+1];
			}
			else{
				n=pages[0]
			}
		}
	}
	return n;
}

function getPrev(pageName){
	var p;
	for (var i=0;i<pages.length; i++){
		if(pages[i]==pageName){
			if(pages[i-1]!=null){
				p=pages[i-1];
			}
			else{
				p=pages[pages.length-1]
			}
		}
	}
	return p;
}

//-->