function makeMaxWin(url)
{
	var vwidth = screen.width - 100;
	var vheight = screen.height - 150;
	
	makeWin(url, vheight, vwidth)
}

function makeWin(url, vheight, vwidth)
{
	agent = navigator.userAgent;
	windowName = "DefinitionWindow";
	
	var vtop = ((screen.height - vheight)/2);
	var vleft = ((screen.width - vwidth)/2); 

	params  = "";
	params += "toolbar=1,";
	params += "location=1,";
	params += "directories=0,";
	params += "status=1,";
	params += "menubar=1,";
	params += "scrollbars=1,";
	params += "resizable=1,";
	params += "width=" + vwidth + ",";
	params += "height=" + vheight + ",";
	params += "top=" + vtop + ",";
	params += "left=" + vleft;
	
	win = window.open(url, windowName, params);
	if (agent.indexOf("Mozilla/2") != -1 && agent.indexOf("Win") == -1) {
	    win = window.open(url, windowName , params);
	}
	if (!win.opener) {
	    win.opener = window;
	}
}

function openHelp(url)
{
	makeWin(url, 400, 400)
}

function showStatusMessage(status)
{
    var url = 'StatusPopUp.aspx?status=' + status;
    var vheight = 150;
    var vwidth = 300;

	agent = navigator.userAgent;
	windowName = "DefinitionWindow";
	
	var vtop = ((screen.height - vheight)/2);
	var vleft = ((screen.width - vwidth)/2); 

	params  = "";
	params += "toolbar=0,";
	params += "location=0,";
	params += "directories=0,";
	params += "status=0,";
	params += "menubar=0,";
	params += "scrollbars=0,";
	params += "resizable=0,";
	params += "width=" + vwidth + ",";
	params += "height=" + vheight + ",";
	params += "top=" + vtop + ",";
	params += "left=" + vleft;
	
	win = window.open(url, windowName, params);
	if (agent.indexOf("Mozilla/2") != -1 && agent.indexOf("Win") == -1) {
	    win = window.open(url, windowName , params);
	}
	if (!win.opener) {
	    win.opener = window;
	}
}

function headerColorSet(rowName, statusControlName) {
	recstatus = document.getElementById(statusControlName).value;
	var velement = document.getElementById(rowName);
	
	if (recstatus == '249') {
		velement.setAttribute("className", "hProspect");
	} else if (recstatus == '251')  {
		velement.setAttribute("className", "hSuspended");
	} else if (recstatus == '250')  {
		velement.setAttribute("className", "hActive");
	} else if (recstatus == '253' || recstatus == '252')  {
		velement.setAttribute("className", "hClosed");
	} else if (recstatus == '254')  {
		velement.setAttribute("className", "hClosed");
	} else {
		velement.setAttribute("className", "hBlank");
	}
}

function confirm_delete(objectType)
{
    return confirm("Are you sure you want to delete this " + objectType + "?");
}

// Show/Hide Divs Function
function showHideDiv(Layer)
{
    if (document.getElementById(Layer) != null)
    {
        if (document.getElementById(Layer).style.display == "block")
    	    document.getElementById(Layer).style.display = "none"
        else
	        document.getElementById(Layer).style.display = "block"
	}
}

var disabledButtonReference;
var disabledButtonReferenceTwo;
function changeTextAndDisableTwoButtons(button, strtext, buttonTwoId, strtext2)
{
    disabledButtonReference = button; 
    //console.debug(buttonTwoId);  firebug console
    disabledButtonReferenceTwo = document.getElementById(buttonTwoId);
    setTimeout("disableTwoButtons('" + strtext + "','" + strtext2 +"');", 1);  //disable after 1 millisecond, some browsers wont submit click without pause
}

function disableTwoButtons(strtext, strtext2) 
{
    disabledButtonReference.value = strtext;
    disabledButtonReference.disabled = true;
    if (disabledButtonReferenceTwo != null)  //when button is hidden it doesn't exist on page
    {
        disabledButtonReferenceTwo.disabled = true;
    }
}
