window.defaultStatus="SourceAid";
var popUp, popUpScroll;
popUp=null;
popUpScroll=null;

function change(value) {
	document.form1.paper.value=value;
	document.form1.submit();
}

function list(value) {
	document.form1.action.value=value;
	document.form1.submit();
}

function remove(reference,value) {
	if (confirm("Are you sure you want to delete this " + reference + " entry?")) {
		list(value);
	}
}

function deleteProject(value) {
	if (confirm("Are you sure you want to delete this project?")) {
		list(value);
	}
}

function mergeProject(value) {
	if (confirm("Would you like to merge this project with the open references?")) {
		list("mergeProject="+value);
	}
	else if (confirm("Any unsaved work will be lost. Would you like to continue?")) {
		list("loadProject="+value);
	}
}

function restart() {
	if (confirm("Are you sure you want to start a new project? You will\nlose all references you have added to your project.")) {
		list("restart");
	}
}

function help(topic) {
	if(topic=="" || topic=="undefined" || topic==null) { topic="index.htm"; }
	topic="/help/frame.asp?topic="+topic;
	openIt(topic,700,500);
}

function openIt(location,w,h) {
	var properties="toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,left=" + (screen.availWidth-w-62) + ",top=40,width=" + w + ",height=" + h;
	if (popUp && !popUp.closed) { popUp.close(); }
	popUp=window.open(location,"openIt",properties);
	if (window.focus) { popUp.focus(); }
}

function openItScroll(location,w,h) {
	var properties="toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=1,resizable=no,left=" + (screen.availWidth-w-62) + ",top=40,width=" + w + ",height=" + h;
	if (popUp && !popUp.closed) { popUp.close(); }
	popUp=window.open(location,"openIt",properties);
	if (window.focus) { popUp.focus(); }
}

function openItScroll(location,w,h) {
	var properties="toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=1,resizable=no,left=" + (screen.availWidth-w-62) + ",top=40,width=" + w + ",height=" + h;
	if (popUpScroll && !popUpScroll.closed) { popUpScroll.close(); }
	popUpScroll=window.open(location,"openItScroll",properties);
	if (window.focus) { popUpScroll.focus(); }
}

function replace(item,OldChar,NewChar)
{
	var _ret="";
	var _item=item.split("");
	for(var i=0;i<_item.length;i++)
	{
		if(_item[i]==OldChar)
		{
			_item[i]=NewChar;
		}
		_ret+=_item[i];
	}
	return(_ret);
}