
function change(page) {

	var loc = new String(document.location);
	var newLoc = loc.substring(0,loc.indexOf('board.php'));

	if(newLoc) {
		document.location.href = '/index.php?' + page;
	} else {


		if(page != 'thoughts') {

			var page1 = page + '.html';
			var page2 = page + '2' + '.html';

		} else {

			var page1 = page + '.php';
			var page2 = page + '2' + '.php';

		}

		top.frameleft.location.href = page1; 
		top.frameright.location.href = page2;

	}

}

function right(right) {
	top.frameright.location.href = right; 
}

function left(left) {
	top.frameleft.location.href = left; 
}

function doHash(page) {


	var temp = "#" + page;

	if (temp == document.location.hash) {

			// do nothing because we're already on that page
				
	} else {

		if(document.location.hash) {

			var loc = new String(document.location);
			var newLoc = loc.substring(0,loc.indexOf('#'));
			newLoc += "#";

		} else {
			var newLoc = document.location + "#";
		}

		newLoc += page;

		document.location.href = newLoc;
		change(page);
	}

}


function getHash() {

	if(document.location.hash) {
		var hash = document.location.hash.substring(1,document.location.hash.length);
		change(hash);
	}

}

