function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function checkAddons(){
	var gx = 1;
	if(document.getElementById('addon_total').value == "0"){
	var answer = confirm ("You haven't selected any addons. FOR A LIMITED TIME you can save 15% to 20% on your ENTIRE ORDER when you purchase two or more addons! Click OK to continue or CANCEL to select more addons and SAVE MONEY!")
	if (!answer)
	return false;
	}
}

var price = '';
var description = ''
function countTotal2() {
	//If bulk ebook is selected then unselect individual ebook checkboxes
	//if (document.getElementById('bulkebook').checked == true){ 
	//	document.getElementById('ebook1').checked = false;
	//	document.getElementById('ebook2').checked = false;
	//	document.getElementById('ebook3').checked = false;
	//	document.getElementById('ebook4').checked = false;
	//}
	document.getElementById('plimus_pro').value = "1";
	var total = 99;
	if (document.getElementById('base1').checked == true){
		document.getElementById('plimus_pro').value = "0";
		document.getElementById('plimus_standard').value = "1";
		total = 67;
		payment_total = 67;
	}else{
		document.getElementById('plimus_pro').value = "1";
		document.getElementById('plimus_standard').value = "0";
		total = 99;
		payment_total = 99;
	}
	addons = 0;
	ebook_total = 0;
	other_total = 0;
	if (document.getElementById('addon4').checked == true){ addons++; total=total + 99; document.getElementById('plimus_repost').value = "1"; } else { document.getElementById('plimus_repost').value = "0"; }
	if (document.getElementById('addon5').checked == true){ addons++; total=total + 99; document.getElementById('plimus_scheduler').value = "1"; } else { document.getElementById('plimus_scheduler').value = "0"; }
	if (document.getElementById('addon6').checked == true){ addons++; total=total + 99; document.getElementById('plimus_myspace').value = "1"; } else { document.getElementById('plimus_myspace').value = "0"; }
	if (document.getElementById('addon7').checked == true){ addons++; total=total + 99; document.getElementById('plimus_yahoo').value = "1"; } else { document.getElementById('plimus_yahoo').value = "0"; }
	if (document.getElementById('addon8').checked == true){ addons++; total=total + 99; document.getElementById('plimus_emailer').value = "1"; } else { document.getElementById('plimus_emailer').value = "0"; }
	if (document.getElementById('addon9').checked == true){ addons++; total=total + 99; document.getElementById('plimus_backpage').value = "1"; } else { document.getElementById('plimus_backpage').value = "0"; }
	if (document.getElementById('addon10').checked == true){ addons++; total=total + 99; document.getElementById('plimus_proxy').value = "1"; } else { document.getElementById('plimus_proxy').value = "0"; }
	if (document.getElementById('addon12').checked == true){ addons++; total=total + 99; document.getElementById('plimus_dialer').value = "1"; } else { document.getElementById('plimus_dialer').value = "0"; }
	if (document.getElementById('addon13').checked == true){ other_total = 49; total=total + 49; document.getElementById('plimus_bpcaptcha').value = "1"; } else { document.getElementById('plimus_bpcaptcha').value = "0"; }
	//if (document.getElementById('ebook1').checked == true){ ebook_total+= 14; total=total + 14; document.getElementById('plimus_ebook1').value = "1"; } else { document.getElementById('plimus_ebook1').value = "0"; }
	//if (document.getElementById('ebook2').checked == true){ ebook_total+= 24; total=total + 24; document.getElementById('plimus_ebook2').value = "1"; } else { document.getElementById('plimus_ebook2').value = "0"; }
	//if (document.getElementById('ebook3').checked == true){ ebook_total+= 29; total=total + 29; document.getElementById('plimus_ebook3').value = "1"; } else { document.getElementById('plimus_ebook3').value = "0"; }
	//if (document.getElementById('ebook4').checked == true){ ebook_total+= 49; total=total + 49; document.getElementById('plimus_ebook4').value = "1"; } else { document.getElementById('plimus_ebook4').value = "0"; }
	//if (document.getElementById('bulkebook').checked == true){ ebook_total = 89; total=total + 89; document.getElementById('plimus_bulkebooks').value = "1"; } else { document.getElementById('plimus_bulkebooks').value = "0"; }
	if (document.getElementById('other1').checked == true){ other_total = 47; total=total + 47; document.getElementById('plimus_software1').value = "1"; } else { document.getElementById('plimus_software1').value = "0"; }
	if (document.getElementById('other2').checked == true){ other_total = 79; total=total + 79; document.getElementById('plimus_software2').value = "1"; } else { document.getElementById('plimus_software2').value = "0"; }
	if (document.getElementById('jiffy').checked == true){ other_total = other_total+97; total=total + 97; document.getElementById('plimus_jiffycreator').value = "1"; } else { document.getElementById('plimus_jiffycreator').value = "0"; }
	total_price = "Total Price: $" + total;
	if (addons < 2){ payment_total = total; payment_total; document.getElementById('coupon').value = "";document.getElementById('addon_total').value = "0";}
	if (addons == 2){ payment_total = (total - (Math.round((total-ebook_total-other_total)*.15))); total_price += " - 15% Discount($" + Math.round((total-ebook_total-other_total)*.15) +") = $" + payment_total; document.getElementById('coupon').value = "15-45";document.getElementById('addon_total').value = "1";}
	if (addons == 3){ payment_total = (total - (Math.round((total-ebook_total-other_total)*.2))); total_price += " - 20% Discount($" + Math.round((total-ebook_total-other_total)*.2) +") = $" + payment_total; document.getElementById('coupon').value = "20-79";document.getElementById('addon_total').value = "1";}
	if (addons == 4){ payment_total = (total - (Math.round((total-ebook_total-other_total)*.2))); total_price += " - 20% Discount($" + Math.round((total-ebook_total-other_total)*.2) +") = $" + payment_total; document.getElementById('coupon').value = "20-99";document.getElementById('addon_total').value = "1";}
	if (addons >= 5){ payment_total = (total - (Math.round((total-ebook_total-other_total)*.2))); total_price += " - 20% Discount($" + Math.round((total-ebook_total-other_total)*.2) +") = $" + payment_total; document.getElementById('coupon').value = "20-119";document.getElementById('addon_total').value = "1";}
	document.getElementById('total').innerHTML = total_price;
	price = payment_total;
	document.getElementById('p').value = payment_total;
}

function forceBP(){
	//make sure BP addon is checked when clicking BPCaptcha
	if(!document.getElementById('addon9').checked && document.getElementById('addon13').checked == true){
		document.getElementById('addon9').checked = true
	}
}