/************************************************************
 * functions.js --> v.1.0.3, 03/21/09
 ************************************************************/
/**
 * clearUN
 */
function clearUN(val){
        if(val.value=='Email'){
                document.forms[0].email.value='';
        }
}
/**
 * calcMP()
 */
function calcMP() {
	var f = document.forms["myform"];
	var newprice = 0.00;
	var term = f.elements["term"].value;
	//alert((isNAN(term));
	var amount = f.elements["amount"].value;
	newprice = amount / term;
	document.getElementById("mp").innerHTML = newprice.toFixed(2);
}
/**
 * calcPIFprice()
 */
function calcPIFprice() {
	var f = document.forms["myform"];
	var newpct = 0.00;
	var pct = f.elements["PIF_discount"].value;
	var amount = f.elements["amount"].value;
	newpct = amount - (amount * pct / 100);
	document.getElementById("pifprice").innerHTML = newpct.toFixed(2);
}
/**
 * roundNumber()
 */
function roundNumber(num, dec) {
	var result = Math.round(num*Math.pow(10,dec))/Math.pow(10,dec);
	return result;
}
/**
 * popUp()
 */
function popUp(nm, URL, w, h, t, l){
	OpenWin = this.open(URL, nm, "toolbar=0,menubar=0,location=0,scrollbars=0,resizable=0, width="+w+", height="+h+", top="+t+", left="+l);
}
/**
 * msg()
 */
function msg(message, url) {
	if (confirm(message)){
		if(url){
			top.location=url;
		}
		return true;
	} else {
		return false;
	}
}
function toggleCash(yn){
	if(yn.checked){
		document.forms[0].cc_type.disabled = true;
		document.forms[0].cc_num.disabled = true;
		document.forms[0].cc_exp_m.disabled = true;
		document.forms[0].cc_exp_y.disabled = true;
	} else {
		document.forms[0].cc_type.disabled = false;
		document.forms[0].cc_num.disabled = false;
		document.forms[0].cc_exp_m.disabled = false;
		document.forms[0].cc_exp_y.disabled = false;
	}
}

