
function openWin(URL) {
aWindow = window.open(URL, "thewindow", "toolbar = no, width = 550, height = 220, status = no, scrollbars = no, resizable = no, menubar = no, left = 45, top = 15");

}

function newWin(URL) {
bWindow = window.open(URL, "newwindow", "toolbar = no, width = 800, height = 600, status = no, scrollbars = yes, resizable = yes, menubar = no, left = 15, top = 15");

}

function newWinPicture(URL) {
bWindow = window.open(URL, "newwindow", "toolbar = no, width = 715, height = 600, status = yes, scrollbars = yes, resize = yes, menubar = no, left = 15, top = 15");

}
function picWin(URL) {
bWindow = window.open(URL, "newwindow", "toolbar = no, width = 680, height = 510, status = no, scrollbars = yes, resize = no, menubar = no, left = 15, top = 15");

}

function conWin(URL) {
bWindow = window.open(URL, "newwindow", "toolbar = no, width = 450, height = 475, status = no, scrollbars = no, resize = no, menubar = no, left = 15, top = 15");

}

function ccWin(URL) {
bWindow = window.open(URL, "newwindow", "toolbar = no, width = 520, height = 170, status = no, scrollbars = yes, resize = no, menubar = no, left = 15, top = 15");

}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

    function checkForZero(field) {
        if (field.value == 0 || field.value.length == 0) {
            alert ("This field can't be 0!");
            field.focus(); }
        else
	    calculatePayment(field.form);
    }

    function cmdCalc_Click(form) {
        if (form.price.value == 0 || form.price.value.length == 0) {
            alert ("The Price field can't be 0!");
            form.price.focus(); }
        else if (form.ir.value == 0 || form.ir.value.length == 0) {
            alert ("The Interest Rate field can't be 0!");
            form.ir.focus(); }
        else if (form.term.value == 0 || form.term.value.length == 0) {
            alert ("The Term field can't be 0!");
            form.term.focus(); }
        else
            calculatePayment(form);
    }

    function calculatePayment(form) {
        princ = form.price.value - form.dp.value;
        intRate = (form.ir.value/100) / 12;
        months = form.term.value * 12;
        form.pmt.value = Math.floor((princ*intRate)/(1-Math.pow(1+intRate,(-1*months)))*100)/100;
  	form.principle.value = princ;
	form.payments.value = months;
    }

function closeWindow() {
self.close();
}