// JavaScript Document

function isNumeric(value) {
  if (value == null || !value.toString().match(/^[-]?\d*\.?\d*$/)) return false;
  return true;
}


function bbmCalculate(){
var duration;
var recurringamount;
var total;
var bName = navigator.appName;
var donationTotal;

duration = null;
recurringamount = 0;
total = 0;
donationTotal = null;

if (document.getElementById){
  duration = document.getElementById("duration").value;
  recurringamount = document.getElementById("recurringamount").value;
  donationTotal = document.getElementById("donationTotal");
}else if (document.layers){
  duration = eval("document." + "duration.value");
  recurringamount = eval("document." + "recurringamount.value");
  donationTotal = eval("document." + "donationTotal");
 }else if (document.all){
  duration = eval("document.all." + "duration.value");
  recurringamount = eval("document.all." + "recurringamount.value");
  donationTotal = eval("document.all." + "donationTotal");
 }else{
  duration = document.getElementById("duration").value;
  recurringamount = document.getElementById("recurringamount").value;
  donationTotal = document.getElementById("donationTotal");
 }

if (duration == "1 Year"){
	total = recurringamount * 12;
}
if (duration == "2 Years"){
	total = recurringamount * 24;
}
if (duration == "3 Years"){
	total = recurringamount * 36;
}

if(isNumeric(recurringamount)){

 if(bName == "Netscape"){	
    donationTotal.innerHTML = total;
 }else{
	donationTotal.innerHTML = total;
 }

}else{
 
 if(bName == "Netscape"){	
    donationTotal.innerHTML = 0;
 }else{
	donationTotal.innerHTML = 0;
 }	

}

}
