if(!(document.all || document.getElementById))
	location.href="/browser.htm";
window.defaultStatus="SourceAid";
var popUp;
popUp=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(value) {
	if (confirm("Are you sure you want to delete this reference?")) {
		list(value);
	}
}

function ie() {
	alert("SourceAid Institutional Edition is customized with your school's resources.");
}

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 citation project?\nYou will lose any unsaved changes to your currect 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=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 expand(section){
	if (document.getElementById(section+"_bottom_left").style.display=="none"){
		document.getElementById(section).style.borderBottom="0";
		document.getElementById(section+"_head").style.margin="0 0 10px 0";
		document.getElementById(section+"_bottom_left").style.display="block";
		document.getElementById(section+"_min_max").src="/images/min.gif";
	} else{
		document.getElementById(section).style.borderBottom="1px solid #6699cc";
		document.getElementById(section+"_head").style.margin="0 0 0 0";
		document.getElementById(section+"_bottom_left").style.display="none";
		document.getElementById(section+"_min_max").src="/images/max.gif";
	}
}

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);
}

function toggle(image,list){
	var listElementStyle=document.getElementById(list).style;
	if (listElementStyle.display=="none"){
		listElementStyle.display="block";
		document.getElementById(image).src="/images/minus.gif";
	} else{
		listElementStyle.display="none";
		document.getElementById(image).src="/images/plus.gif";
	}
}