// JavaScript Document
// toggle function that switches between two different layers
function toggle(id1,id2) {
    if (document.getElementById(id2).style.display == 'none') {
        document.getElementById(id2).style.display = 'block';
        document.getElementById(id1).style.display = 'none';
    } else {
        document.getElementById(id2).style.display = 'none';
        document.getElementById(id1).style.display = 'block';
    }
}
// submits a form to itself
function submitForm(form, action) {
	form.action = action;
	form.submit();
}
// shows or hides an div element depending on its current status
function showHide(element) {
	if (document.getElementById(element).style.display == 'none') {
        document.getElementById(element).style.display = 'block';
	} else {
        document.getElementById(element).style.display = 'none';
	}
}
// Reloads the window if Nav4 resized
function MM_reloadPage(init) {
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
// ask whether they want to delete the specific record or not. If so, it sends them to the specified fuseaction.
function deleteRecord(deleteItem,setgoto) {
	answer = confirm('Are you sure you want to delete ' + deleteItem + '?');
	if (answer == true) {
		window.location.href = setgoto;
	}
}
function confirmConvert(setgoto) {
	answer = confirm('Are you sure you want to convert this prospect to a client?');
	if (answer == true) {
		window.location.href = setgoto;
	}
}
function switchDiv(id) {
	previousDiv = 'div' + previousID;
	currentDiv = 'div' + id;
	document.getElementById(previousDiv).style.display = 'none';
	document.getElementById(currentDiv).style.display = 'block';
	previousID = id;
}
var previousID = 0;