function totalpriceppm() {
        var ppmonthly = document.payment.PayMonthly.value;
        var ppsetup = document.payment.ppsetup.value;
        var totalpayment = (ppmonthly * 1) + (ppsetup * 1);
        document.payment.total_price.value = totalpayment;
        document.payment.PayYearly.checked = false;
}

function totalpriceppy() {
        var ppyearly = document.payment.PayYearly.value;
        var ppsetup = document.payment.ppsetup.value;
        var totalpayment = (ppyearly * 1) + (ppsetup * 1);
        document.payment.total_price.value = totalpayment;
        document.payment.PayMonthly.checked = false;
}


function updatePrice(value) {
        if (value == 'D') {
                document.getElementById('desc').innerHTML = '';
                document.getElementById('desc').style.display = 'none';
                document.order.monthly.value='0.00';
		document.order.setup.value='0.00';
        }
        else if (value == 'C') {
		var basicListing = "<div class='desc'><h4>$11 per month</h4><ul style='line-height: 0.5em;'><ul><b><li>Listed in 1 Categories<li>Business Name<li>Address<li>Phone, Fax, Mobile and Toll Free Number<li>Contact Person<li>Contact Form<li>Website Link<li>Location Map<li>Description of 200 Characters</b></ul></div>";
                document.getElementById('desc').innerHTML = basicListing;
		document.getElementById('desc').style.display = 'block';
                document.order.monthly.value='11.00';
		document.order.setup.value='0.00';
        }
        else if (value == 'B') {
		var enhancedListing = "<div class='desc'><h4>$21 per month</h4><ul style='line-height: 0.5em;'><ul><li>Listed in <b>3</b> Categories<li>Business Name<li>Address<li>Phone, Fax, Mobile and Toll Free Number<li>Contact Person<li>Contact Form<li>Website Link<li>Location Map<li>Description of <b>2,000</b> Characters<b><li>Company Logo<li>Standard Banner (340x60)<li>Products (10)<li>Image Gallery (10)</b></ul><br /><b><input type='checkbox' name='enhancedBanner' value='50.00' onClick='add_services()'> Design a Standard Banner for me ($50.00)</b><br /><br /><br /></div>";
		document.getElementById('desc').innerHTML = enhancedListing;
		document.getElementById('desc').style.display = 'block';
                document.order.monthly.value='21.00';
		document.order.setup.value='0.00';
        }
        else if (value == 'A') {
		var premiumListing = "<div class='desc'><h4>$50 per month</h4><ul style='line-height: 0.5em;'><ul><li>Listed in <b>5</b> Categories<li>Business Name<li>Address<li>Phone, Fax, Mobile and Toll Free Number<li>Contact Person<li>Contact Form<li>Website Link<li>Location Map<li>Description of 2,000 Characters<li>Company Logo<li>Standard Banner (340x60)<li><b>Premium Banner (100x60) More Exposures!</b><li>Products <b>(50)</b><li>Image Gallery <b>(50)</b></ul><br /><b><input type='checkbox' name='enhancedBanner' value='50.00' onClick='add_services()'> Design a Standard Banner for me ($50.00)<br /><input type='checkbox' name='premiumBanner' value='50.00' onClick='add_services()'> Design a Premium Banner for me ($50.00)</b><br /><br /><br /></div>";
		document.getElementById('desc').innerHTML = premiumListing;
		document.getElementById('desc').style.display = 'block';
                document.order.monthly.value='50.00';
		document.order.setup.value='0.00';
        }
	get_total();
}

function add_services() {
	var setup = 0;
	if(document.order.enhancedBanner.checked == true) { setup += parseFloat(document.order.enhancedBanner.value); }
	if(document.order.plans.value == 'A'){
		if(document.order.premiumBanner.checked == true) { setup += parseFloat(document.order.premiumBanner.value); }
	}
	var vSetup = new String(setup);
	if(vSetup.indexOf('.') < 0) { vSetup += '.00'; }
	if(vSetup.indexOf('.') == (vSetup.length - 2)) { vSetup += '0'; }
	document.order.setup.value = vSetup;
	get_total();
}

function get_total() {
	var total;
	var sSetup = document.order.monthly.value;
	var sMonthly = document.order.setup.value;
	total = parseFloat(sSetup) + parseFloat(sMonthly);
	var sTotal = new String(total);
	if(sTotal.indexOf('.') < 0) { sTotal += '.00'; }
        if(sTotal.indexOf('.') == (sTotal.length - 2)) { sTotal += '0'; }	
	document.order.total.value = sTotal;
}

