	function openloginwindow() {
		var name = document.forms[0].name.value;

		//if(name!="mike" && name!="derek") {
		//	alert('Sorry but you cannot login at the moment. The website is currently still under development and the editing system is not yet complete.');
		//	return;
		//}
		
		var pass = document.forms[0].pass.value;
		var x = (screen.width-410)/2;
		var y = (screen.height-600)/2;
		helpWindow = window.open('login.jsp?name='+name+'&pass='+pass,'login_window','height=300,width=400,resizable,screenX='+x+',screenY='+y);
		helpWindow.moveTo(x,y);
	}

	
//BEGIN:DELETE These when it is no longer needed!
	
	function opentimelinebookwindow() {
		var x = (screen.width-809)/2;
		var y = (screen.height-780)/2;
		helpWindow = window.open('misc/timelinebookcover.html','register_window','height=600,width=800,scrollbars=yes,screenX='+x+',screenY='+y);
		helpWindow.moveTo(x,y);
	}
	
	function compute() {
	var p = eval(document.orderform.price.value);
	var s = eval(document.orderform.shipping_selected.value);
	var q = eval(document.orderform.qty.value);
	subtotal = q*p;
	if (q > 1 && q < 5) {
	subtotal = q*p*.95;}
	else if (q >= 5 && q < 9) {
	subtotal = q*p*.925;}
	else if (q >= 9) {
	subtotal = q*p*.90;}
	subtotal = Math.round(subtotal *100)/100;
	var sq = 1 + (q-1)/2;
	shipping  = s*sq;
	var t = (subtotal + shipping)*100;
	t = Math.round(t);
	total = t/100;
	document.orderform.amount.value=subtotal;
	document.orderform.shipping.value=shipping;
	document.orderform.total.value=total;
	}	
	
	
	function openbudgetwindow() {
		var x = (screen.width-450)/2;
		var y = (screen.height-520)/2;
		budgetWindow = window.open('budget.htm','budget_window','height=510,width=450,scrollbars=yes,screenX='+x+',screenY='+y);
		budgetWindow.moveTo(x,y);
		budgetWindow.focus();
	}// END:DELETE

	function openregisterwindow() {
		var x = (screen.width-520)/2;
		var y = (screen.height-520)/2;
		helpWindow = window.open('register.jsp','register_window','height=510,width=510,resizable,scrollbars=yes,screenX='+x+',screenY='+y);
		helpWindow.moveTo(x,y);
	}
	function editusersettings(oid) {
		var x = (screen.width-520)/2;
		var y = (screen.height-520)/2;
		helpWindow = window.open('register.jsp?oid='+oid,'register_window','height=540,width=510,resizable,scrollbars=yes,screenX='+x+',screenY='+y);
		helpWindow.moveTo(x,y);
	}


	function openhelpwindow() {
		var x = (screen.width-520)/2;
		var y = (screen.height-520)/2;
		helpWindow = window.open('help.jsp','help_window','height=510,width=510,resizable,scrollbars=yes,screenX='+x+',screenY='+y);
		helpWindow.moveTo(x,y);
		helpWindow.focus();
	}

	function openedititemhelp(pos) {
		var x = (screen.width-520)/2;
		var y = (screen.height-520)/2;
		helpWindow = window.open('edititemhelp.jsp#'+pos,'edit_item_help','height=510,width=510,resizable,scrollbars=yes,screenX='+x+',screenY='+y);
		helpWindow.moveTo(x,y);
		helpWindow.focus();
	}
	function openmoveitemhelp(pos) {
		var x = (screen.width-520)/2;
		var y = (screen.height-520)/2;
		helpWindow = window.open('moveitemhelp.jsp#'+pos,'move_item_help','height=510,width=510,resizable,scrollbars=yes,screenX='+x+',screenY='+y);
		helpWindow.moveTo(x,y);
		helpWindow.focus();
	}

	function opentopichelp(pos) {
		var x = (screen.width-520)/2;
		var y = (screen.height-520)/2;
		helpWindow = window.open('topichelp.jsp#'+pos,'topic_help','height=510,width=510,resizable,scrollbars=yes,screenX='+x+',screenY='+y);
		helpWindow.moveTo(x,y);
		helpWindow.focus();
	}

	function submitApprovalOld(value, itemId) {
		var x = (screen.width-410)/2;
		var y = (screen.height-310)/2;
		helpWindow = window.open('approve.jsp?itemid='+itemId+'&approval='+value,'approve_window','height=300,width=400,scrollbars=no,resizable,screenX='+x+',screenY='+y);
		helpWindow.moveTo(x,y);
	}

	function submitApproval(value, itemid, timeline) {
		document.location.href = 'approveitem.jsp?timeline='+timeline+'&itemid='+itemid+'&approval='+value;
	}

	function removeitemwindow(timelineLink, itemId, position) {
		inputBox = confirm("Are you sure you with to delete this item from this timeline?");
		if (inputBox) {
			var x = (screen.width-410)/2;
			var y = (screen.height-310)/2;
			helpWindow = window.open('removeitem.jsp?timeline='+timelineLink+'&itemid='+itemId+'&position='+position,'remove_item_window','height=300,width=400,scrollbars=no,resizable,screenX='+x+',screenY='+y);
			helpWindow.moveTo(x,y);
		}
	}

	
	function movecopyitemwindow(subtopicLink, itemId, position) {
		var x = (screen.width-550)/2;
		var y = (screen.height-450)/2;
		helpWindow = window.open('moveitem.jsp?oldsubtopic='+subtopicLink+'&item='+itemId+'&position='+position,'move_item_window','height=440,width=540,scrollbars=yes,resizable,screenX='+x+',screenY='+y);
		helpWindow.moveTo(x,y);
	}

	function openedititemwindow(subtopicLink, itemId) {
		var x = (screen.width-700)/2;
		var y = (screen.height-580)/2;
		helpWindow = window.open('edititem.jsp?subtopic='+subtopicLink+'&item='+itemId,'edit_item_window','height=570,width=690,scrollbars=yes,resizable,screenX='+x+',screenY='+y);
		helpWindow.moveTo(x,y);
	}
	function editsubtopicwindow(topicLink, subtopicLink, task) {
		var x = (screen.width-530)/2;
		var y = (screen.height-450)/2;
		helpWindow = window.open('editsubtopic.jsp?topic='+topicLink+'&subtopic='+subtopicLink+'&task='+task,'edit_subtopic_window','height=440,width=520,scrollbars=yes,resizable,screenX='+x+',screenY='+y);
		helpWindow.moveTo(x,y);
	}
	
	
	// nice generic function - would be even nicer if didn't require oldvalue (TODO)
	function reloadwithchangedparameter(parameter, oldvalue, newvalue) {
		var href = document.location.href;
		
		var pos = href.indexOf(parameter);
		var qpos= href.indexOf('?');
		
		if(pos == -1) {
			if(qpos == -1) {
				document.location.href = href+'?'+parameter+'='+newvalue;
			}
			else {
				document.location.href = href+'&'+parameter+'='+newvalue;
			}
		}
		else {
			document.location.href = href.replace(parameter+'='+oldvalue, parameter+'='+newvalue);
		}
	}

	function openadditemwindow(subtopicLink, itemId) {
		var x = (screen.width-700)/2;
		var y = (screen.height-580)/2;
		helpWindow = window.open('edititem.jsp?subtopic='+subtopicLink+'&afteritem='+itemId,'edit_item_window','height=570,width=690,scrollbars=yes,resizable,screenX='+x+',screenY='+y);
		helpWindow.moveTo(x,y);
	}

	function opencommentswindow(itemId) {
		var x = (screen.width-520)/2;
		var y = (screen.height-520)/2;
		helpWindow = window.open('showcomments.jsp?item='+itemId,'comments_window','height=510,width=510,resizable,screenX='+x+',screenY='+y);
		helpWindow.moveTo(x,y);
	}
	
		
		function openemailtofriendwindow() {
		var x = (screen.width-520)/2;
		var y = (screen.height-350)/2;
		helpWindow = window.open('emailfriend.jsp?url=' + window.location.href + '&&title=' + document.title,'email_friend_window','height=375,width=510,resizable,screenX='+x+',screenY='+y);
		helpWindow.moveTo(x,y);
	}
