
<!--

function calculateMonthly(dvrTotal) { // evaluates user selection to return cost total			
	
var monthlyTotal;
	//dvrTotal = eval(dvrTotal);
	//var monthlyBreakdown;
	
	//premiumCost = new Array(12,11,10,8,7);
	if(document.getElementById('baseSelect')) {
		selection = document.getElementById('baseSelect').selectedIndex;
		baseChoice = document.getElementById('baseSelect').options[selection].value;
	} else {
		baseChoice = document.getElementById('base').value;
	}
	
	//alert(baseChoice);
	switch(eval(baseChoice)) {
	
		case 1: 
			baseName = 'Americas Top 60';
			baseCost = 29.99;
			//premiumIncluded = false;
			dvrIncluded = false;	
		break;
		
		case 2:
			baseName = 'Americas Top 60 Plus';
			baseCost = 36.99;
			//premiumIncluded = false;
			dvrIncluded = false;	
		break;
		
		case 3:
			baseName = 'Americas Top 120';
			baseCost = 39.99;
			//premiumIncluded = false;		
			dvrIncluded = false;	
		break;
		
		case 4:
			baseName = 'Americas Top 180';
			baseCost = 49.99;
			//premiumIncluded = true;			
			dvrIncluded = true;
		break;

		case 5:
			baseName = 'Americas Everything Pack';
			baseCost = 84.99;
			//premiumIncluded = false;	
			dvrIncluded = false;	
		break;
		
		case 6:
			baseName = 'Dish Latino';
			baseCost = 29.99;
			//premiumIncluded = false;
			dvrIncluded = false;
		break;
		
		case 7:
			baseName = 'Dish Latino Dos';
			baseCost = 39.99;
			//premiumIncluded = true;
			dvrIncluded = true;
		break;		

		case 8:
			baseName = 'Dish Latino Max';
			baseCost = 49.99;
			//premiumIncluded = true;
			dvrIncluded = true;
		break;		

		case 9:
			baseName = 'Dish Latino Everything';
			baseCost = 79.99;
			//premiumIncluded = true;
			dvrIncluded = true;
		break;		
						
		default:
			baseName = 'Americas Top 60';
			baseCost = 29.99;
			//premiumIncluded = false;
			dvrIncluded = false;	
		break;
	}
		
	premiumOptions = new Array('hbo', 'showtime', 'cinemax', 'starz', 'sports'); // these are the field names of the premium services
	premiumNames = new Array('HBO', 'Showtime', 'Cinemax', 'STARZ!', 'Sports Package'); // these are the names of the premium services
	premiumCost = new Array(12,11,10,8,7); // this is the sliding price scale as customer purchases more premium services
	dvrCost = 5.99 * Math.min(dvrTotal,1);
	
	premiumTotal = 0; // number of premium packages selected
	premiumTotalCost = 0; // cost of premium packages selected
	premiumPackages = "PREMIUM PACKAGES"; // names of selected packages
	premiumSelections = false;
	
 	premiumHTML = "";
	
	for(j=0;j<premiumOptions.length;j++) { // start loop of array of options

	field = premiumOptions[j];
		
		//if(premiumIncluded == true) { // if premium channels are included we show all premium options
			//checked = true;
			//document.getElementById(field).checked = false;
			
		//}	else { 
			
//			if(document.getElementById(field).type == "checkbox") {
				//checked = document.getElementById(field).checked;
			//} else {
			//	checked = document.getElementById(field).value;
			//}
		//}
		
		//if(checked) {
			//premiumTotalCost = premiumTotalCost + premiumCost[premiumTotal];
			//premiumSelections = true;
			//premiumTotal += 1;
			//premiumPackages += "<br>&nbsp;&nbsp;&nbsp;&nbsp;" + premiumNames[j] + "";
		//}
		
	} // end for loop
		
	//if(premiumIncluded == true) { // if premium channels are part of a package we remove the cost
		//premiumTotalCost = 0;
	//}
	
	//if(dvrIncluded == true) { // if dvr subscription is part of the package we remove the cost
		dvrCost = 0;
	//}
	
	//if(premiumTotal > 0) { // if any premium packages are selected we need to display them
		//premiumHTML = "<tr><td>" + premiumPackages + "</td><td align='right' valign='top'>$" + premiumTotalCost.toFixed(2) + "</td></tr>";		
	//}
	
	dvrHTML = "";
	
	//if(dvrTotal > 0) { // if any dvr recievers are selected add in the dvr monthly cost
		//dvrHTML = "<tr><td>DIRECTV<sup>&reg;</sup> DVR subscription</td><td align='right'>$" + dvrCost.toFixed(2) + "</td></tr>";
	//}
	
		

monthlyTotal = baseCost + premiumTotalCost + dvrCost;

		
	HTML = "<table class='style18' width='100%' cellpadding='3' cellspacing='0' border='0'>";
	HTML += "<tr><td width='200'>" + baseName + "<br><br></td><td align='right'>$" + baseCost + "<br><br></td></tr>";
	HTML += dvrHTML;
	HTML += premiumHTML;
	HTML+= "<tr><td colspan='2'  bgcolor='#000000' style='padding-top:0px; padding-bottom:0px;'><img src='images/spacer.gif' width='1' height='1'></td></tr>";
	HTML += "<tr><td width='200'><strong>Monthly Programming Total</strong></td><td align='right'>$" + monthlyTotal.toFixed(2) + "</td></tr>";		
	HTML += "</table>";
	

	document.getElementById('monthlyBreakdown').innerHTML = HTML;
	document.getElementById('monthlyTotal').value = monthlyTotal.toFixed(2);


}			



// -->
