// JavaScript Document

// saves the form instead of validating & going to the next page
// used on the application forms
function SaveForm(form) {
form.validateForm.value = 'false';
document.application.submit();
}

function PrevPage(form) {
form.prevPage.value = 'true';
form.validateForm.value = 'false';
document.application.submit();
}


// google toolbar reformatting
// use : runs onload; don't call

if(window.attachEvent)
    window.attachEvent("onload",restoreStyles);

function restoreStyles(){
    inputList = document.getElementsByTagName("INPUT");
    for(i=0;i<inputList.length;i++)
      inputList[i].style.backgroundColor = "";
    selectList = document.getElementsByTagName("SELECT");
    for(i=0;i<selectList.length;i++)
      selectList[i].style.backgroundColor = "";
}

function formatCurrency(num) {
num = num.toString().replace(/\$|\,/g,'');
if(isNaN(num))
num = "0";
sign = (num == (num = Math.abs(num)));
num = Math.floor(num*100+0.50000000001);
cents = num%100;
num = Math.floor(num/100).toString();
if(cents<10)
cents = "0" + cents;
return (num + '.' + cents);
}
