// INTIALIZE VARIABLES THAT WILL BE USED FOR CONDITIONALS.  USE NAMING CONVENTION FOR EASE OF READING.

// RATEPLANS

var ChkBoxRP_datamessaging = false;
var ChkBoxRP_whenever = false;
var ChkBoxRP_nightsweekends = false;
var ChkBoxRP_evenMoreUnlimitedMessaging = false;
var ChkBoxRP_evenMoreUnlimitedMessagingWithAddALine = false;
var ChkBoxRP_evenMorePlusUnlimitedMessaging = false;
var ChkBoxRP_evenMoreUnlimitedTalk = false;
var ChkBoxRP_evenMoreWithAddALine = false;
var ChkBoxRP_evenMorePlusUnlimitedTalk = false;
var ChkBoxRP_evenMoreBoth = false;
var ChkBoxRP_evenMoreBothTalkTextWeb = false;
var ChkBoxRP_weekend = false;
var ChkBoxRP_TMOtoTMO = false;
var ChkBoxRP_myFaves = false;
var ChkBoxRP_FlexPay = false;
var ChkBoxRP_Prepaid = false;
var ChkBoxRP_FAMallow = false;
var ChkBoxRP_athome = false;
var ChkBoxRP_hotSpot = false;
var ChkBoxRP_data = false;

// HANDSETS

var ChkBoxHS_mailrebate = false;
var ChkBoxHS_instantrebate = false;		

// ADDON this is really additional offers on the page

var ChkBoxAO_cameo= false;
var ChkBoxAO_g1= false;
var ChkBoxAO_datastick= false;
var ChkBoxAO_thirdparty= false;
var ChkBoxAO_addaline= false;
var Ismailrebate = false;
var Isinstantrebate = false;
var ChkBoxAO_eip = false;


//**********************************************************************

function BuildDisclaimer()
{
	var strDisclaimer = "";
	var rateplanarray = document.frmDisclaimer.ratePlan;
	var handsetarray = document.frmDisclaimer.HandSet;
	var addonarray = document.frmDisclaimer.Addon;
	SortratePlan(rateplanarray);
	SortHandSet(handsetarray);
	SortAddon(addonarray)
	
	// if g1 is in ad							
	if(ChkBoxAO_g1 == true){
		strDisclaimer += " Google, the Google logo, Google Maps, YouTube, Android and Gmail are trademarks of Google Inc. Screen and device images are simulated. Tele Atlas&#169; Map Data &#169;2010. All Rights Reserved.<br><br>";
	}
	
	// if "$5 add a line" is in ad							
	/*if(ChkBoxAO_addaline == true){
		strDisclaimer += " $5 Add a Line price applies to 750/1500 minute family plans.<br /><br /> ";
	}*/
	
	// Even More plans with $5 add a line
	/*if(ChkBoxRP_evenMoreWithAddALine == true || ChkBoxRP_evenMoreUnlimitedMessagingWithAddALine == true) {
		strDisclaimer += " $5 Add a Line price applies to 750/1500 minute family plans.<br /><br />";
	}*/
	
	// if unlimited voice and/or unlimited messaging feature is included in ad this includes @home and hotspot calling		
	if(ChkBoxRP_whenever == true || ChkBoxRP_evenMoreUnlimitedTalk == true || ChkBoxRP_evenMorePlusUnlimitedTalk == true || ChkBoxRP_evenMoreBoth == true || ChkBoxRP_evenMoreBothTalkTextWeb == true || ChkBoxRP_nightsweekends == true || ChkBoxRP_weekend == true || ChkBoxRP_TMOtoTMO == true || ChkBoxRP_myFaves == true || ChkBoxRP_athome == true|| ChkBoxRP_hotSpot == true || ChkBoxRP_evenMoreUnlimitedMessaging == true || ChkBoxRP_evenMorePlusUnlimitedMessaging == true){
		strDisclaimer += " <strong>Unlimited features for direct US communications between 2 people.</strong> ";
	}

	// This will be displayed on all advertising
	// Gets Date from Server
		var d = new Date();
		//var curr_date = d.getDate();
		var curr_month = d.getMonth();
		var curr_year = d.getFullYear();
		switch (curr_month)
		{
		case 0: end_day = 31; break; //Jan
		case 1: end_day = (curr_year%4) ? 28 : 29; break; //Feb.  Not divible by 4 its 28 (not leap year) else its 29 (leap year)
		case 2: end_day = 31; break; //March
		case 3: end_day = 30; break; //April
		case 4: end_day = 31; break; //May
		case 5: end_day = 30; break; //June
		case 6: end_day = 31; break; //July
		case 7: end_day = 31; break; //August
		case 8: end_day = 30; break; //Sept
		case 9: end_day = 31; break; //Oct
		case 10: end_day = 30; break; //Nov
		case 11: end_day = 31; break; //Dec
		default: end_day = 30;  // in case of error
		}
		
	strDisclaimer += " Limited time offer subject to change. <strong>Offer expires ";
	strDisclaimer += curr_month+1;
	strDisclaimer +="/";
	strDisclaimer +=end_day;
	strDisclaimer +="/";
	strDisclaimer +=curr_year;
	strDisclaimer +=".</strong> Taxes, fees, and other charges may apply. ";
	
	// if rate plan is included in ad
	// [show these general terms ONLY when one of the Even More rate plans is NOT checked]
	if((ChkBoxRP_datamessaging == true || ChkBoxRP_whenever == true || ChkBoxRP_FAMallow == true || ChkBoxRP_athome == true || ChkBoxRP_hotSpot == true || ChkBoxAO_eip == true || ChkBoxAO_addaline == true || ChkBoxHS_mailrebate == true || ChkBoxHS_instantrebate == true || ChkBoxAO_cameo == true || ChkBoxAO_g1 == true || ChkBoxAO_datastick == true || ChkBoxAO_thirdparty == true || ChkBoxRP_myFaves == true || ChkBoxRP_FlexPay == true || ChkBoxRP_Prepaid == true || ChkBoxRP_TMOtoTMO == true || ChkBoxRP_nightsweekends == true || ChkBoxRP_weekend == true || ChkBoxRP_data == true) && (ChkBoxRP_evenMoreUnlimitedTalk != true && ChkBoxRP_evenMoreUnlimitedMessaging != true && ChkBoxRP_evenMoreUnlimitedMessagingWithAddALine != true && ChkBoxRP_evenMorePlusUnlimitedTalk != true && ChkBoxRP_evenMorePlusUnlimitedMessaging != true && ChkBoxRP_evenMoreBoth != true && ChkBoxRP_evenMoreBothTalkTextWeb != true && ChkBoxRP_evenMoreWithAddALine != true)){
		strDisclaimer += " <strong>GENERAL TERMS:</strong> Credit approval, activation on a qualifying rate plan, $35 per line activation fee and 2- year agreement with up to $200/line early cancellation fee may be required (ask Sales Associate for details and other options). Regulatory Programs Fee (not a tax or government-mandated charge) of $1.41 per line/month applies. Taxes approx. 6-28% of bill. Overage extra; partial minutes rounded up. ";
	}
	
	// Even More Unlimited Talk
	if(ChkBoxRP_evenMoreUnlimitedTalk == true || ChkBoxRP_evenMoreUnlimitedMessaging == true || ChkBoxRP_evenMoreWithAddALine == true || ChkBoxRP_evenMoreUnlimitedMessagingWithAddALine == true) {
		strDisclaimer += " <strong>EVEN MORE GENERAL TERMS:</strong> At participating locations. Credit approval, $35 per line activation fee and 2-year agreement with up to $200/line early cancellation fee may be required. (ask Sales Associate for details and other options). If you switch plans you may be bound by existing contract term (and $200/line early cancellation fee) and $35/line Even More Plus plan activation fee. You may be unable to switch to some plans. Additional requirements may apply to business customers. Premier and other business/association discounts may not be available. Regulatory Programs Fee (not a tax or government-mandated charge) of $1.41 per line/month applies. Taxes approx. 6-28% of bill. Per month, per line $4.99 Control Charge applies (unless enrolled in Easy Pay) to FlexPay. Overage extra; partial minutes/data rounded up. ";
	}
	
	// Even More Plus Unlimited Talk
	if(ChkBoxRP_evenMorePlusUnlimitedTalk == true || ChkBoxRP_evenMorePlusUnlimitedMessaging == true) {
		strDisclaimer += " <strong>EVEN MORE PLUS GENERAL TERMS:</strong> At participating locations. Credit approval and $35 per line activation fee may be required. If you switch plans you may be bound by existing contract term (and $200/line early cancellation fee) and $35/line Even More Plus plan activation fee. You may be unable to switch to some plans. Additional requirements may apply to business customers; Premier and other business/association discounts not available. Regulatory Programs Fee (not a tax or government-mandated charge) of $1.41 per line/month applies. Taxes approx. 6-28% of bill. Per month, per line $4.99 Control Charge applies (unless enrolled in Easy Pay) to FlexPay. Overage extra; partial minutes/data rounded up. ";
	}
	
	// BOTH Even More Plans
	if(ChkBoxRP_evenMoreBoth == true || ChkBoxRP_evenMoreBothTalkTextWeb == true) {
		strDisclaimer += " <strong>GENERAL TERMS:</strong> At participating locations. Credit approval, $35 per line activation fee and 2-year agreement with up to $200/line early cancellation fee may be required (ask Sales Associate for details and other options). If you switch plans you may be bound by existing contract term (and $200/line early cancellation fee) and $35/line Even More Plus plan activation fee. You may be unable to switch to some plans. Additional requirements may apply to business customers; Premier and other business/association discounts may not be available. Regulatory Programs Fee (not a tax or government-mandated charge) of $1.41 per line/month applies. Taxes approx. 6-28% of bill. Per month, per line $4.99 Control Charge applies (unless enrolled in Easy Pay) to FlexPay. Overage extra; partial minutes/data rounded up. ";
	}
	
	// Even More plans with $5 add a line
	if(ChkBoxRP_evenMoreWithAddALine == true || ChkBoxRP_evenMoreUnlimitedMessagingWithAddALine == true || ChkBoxAO_addaline == true) {
		//strDisclaimer += " <strong>Add a Line:</strong> New 2-year agreement required on all lines of family plan.  Valid on select Even More family plans only. All lines of service must be activated in the same market with same billing address &amp; area code; limit five lines. <strong>EVEN MORE GENERAL TERMS:</strong> At participating locations. Credit approval, $35 per line activation fee and 2-year agreement with up to $200/line early cancellation fee may be required. (ask Sales Associate for details and other options). If you switch plans you may be bound by existing contract term (and $200/line early cancellation fee) and $35/line Even More Plus plan activation fee. You may be unable to switch to some plans. Additional requirements may apply to business customers. Premier and other business/association discounts may not be available. Regulatory Programs Fee (not a tax or government-mandated charge) of $1.41 per line/month applies. Taxes approx. 6-28% of bill. Per month, per line $4.99 Control Charge applies (unless enrolled in Easy Pay) to FlexPay. Overage extra; partial minutes/data rounded up. ";
		strDisclaimer += " <strong>Free Add a Line:</strong> Expires 11/2/2010; subject to change; participating locations only.  Free added lines:  No monthly recurring charges until after 12/31/2011 for voice and messaging services on new lines added to qualifying 2-line family plans. Taxes, fees and charges for other services additional, including Regulatory Programs Fee of $1.41 per line/month. After 12/31/2011, regular monthly service pricing will apply to all added lines.  Max three added lines. ";
	}
	
	// Disclaimer section for the Cameo picture frame
	if(ChkBoxAO_cameo == true){
		strDisclaimer += " <strong>Cameo:</strong> Qualifying voice plan with min. 1-year agreement required.  Cameo does not work on our 850 MHZ roaming partners' networks.  If your service is cancelled (for any reason), after 60 days, you will not be able to resume service.  If you are a FlexPay customer and do not pay your Cameo service charge, each message may incur a FlexAccount deduction.  Cameo only works with SIM card that came with it, will not work if SIM card is removed (even if replaced), and will not work on other carriers' networks.  SIM card will not work in any other device.  Cameo is not voice-capable and is not capable of sending messages. If memory card is full, Cameo will not receive messages. ";
	}

	//G1 specific disclaimer
	if(ChkBoxRP_datamessaging == true || ChkBoxAO_g1 == true || ChkBoxRP_data == true || ChkBoxRP_evenMoreUnlimitedMessaging == true || ChkBoxRP_evenMoreUnlimitedMessagingWithAddALine == true || ChkBoxRP_evenMorePlusUnlimitedMessaging == true || ChkBoxAO_cameo == true || ChkBoxRP_evenMoreBothTalkTextWeb == true){
		strDisclaimer += " <strong>Data/Messaging Plans:</strong> You will be charged for all data sent by or to you through the network, regardless of whether received. Character length/file size of messages/attachments may be limited. Your data session, plan, or service may be slowed, suspended, terminated, or restricted if you use your service in a way that interferes with or impacts our network or ability to provide quality service to other users, if you roam for a significant portion of your usage, or if you use a disproportionate amount of bandwidth during a billing cycle.  Some devices require specific data plans. You may not use your plan or device for prohibited uses.  Domestic use only.  Some devices may transmit and receive data without any user action, which may result in unexpected charges when you travel internationally. If you access the T-Mobile HotSpot network, your use is also subject to the T-Mobile HotSpot Terms and Conditions, available at <a href=\"http://hotspot.t-mobile.com\">hotspot.t-mobile.com</a>. ";
	}
		
	// if myFaves is in ad
	if(ChkBoxRP_myFaves == true){
		strDisclaimer += " <strong>MYFAVES:</strong> Capable handset required.  myFaves only applies to calls directly between two people and allows unlimited nationwide calling to 5 U.S. numbers. You can change myFaves numbers once/month. ";
	}
	// if at home is in ad
	if(ChkBoxRP_athome == true){
		strDisclaimer += " <strong>T-Mobile @Home:</strong> 2-year service agreement, qualifying rate plan, T-Mobile @Home plan, HiPort router, compatible phone, and broadband Internet connection required. Nationwide voice-only plan; all data, messaging, and other services billed according to your regular rate plan and other pricing. See T-Mobile @Home Supplemental Terms and Conditions for more information, including <strong>important limitations on availability and reliability of 9-1-1 emergency service.</strong> ";
	}			
	// if unlimited hotspot calling is in ad
	if(ChkBoxRP_hotSpot == true){
		strDisclaimer += " <strong>Unlimited HotSpot Calling:</strong>  HotSpot-enabled phone, Unlimited HotSpot Calling feature, router, broadband internet connection, and qualifying rate plan required. Regular rate plan minutes are used when call does not <strong>originate</strong> on Wi-Fi network. <strong>When using HotSpot Calling, 9-1-1 service may not be available</strong> and your ability to receive emergency services may be impeded. ";
	}
	// if Family Allowances in ad
	if(ChkBoxRP_FAMallow == true){ 
		strDisclaimer += " <strong>Family Allowances:</strong> Qualifying post-paid multi-line plan required.  Calls and messages sent or received while roaming on another carrier's network, and not on the T-Mobile USA network (&#8220;roaming&#8221;), may not count towards allowance limits. Even if a number is on your Never Allowed List or otherwise blocked, you may still be able to send and receive calls and messages to and from that number while roaming. Your Never Allowed list cannot include international numbers. Always Allowed numbers must be domestic ten-digit phone numbers; toll-free T-Mobile numbers are excluded. Family Allowances is for domestic use only and will not work while roaming internationally. ";
	}			
	// if FlexPay in ad
	if(ChkBoxRP_FlexPay == true){
		strDisclaimer += " <strong>FlexPay:</strong> FlexAccount balance required to use additional voice minutes, messages, and any other services not included in your monthly rate plan and features (such as international dialing, messaging and roaming, downloads, 411 and internet services). Day/time of call rated and billed on a per minute basis. Promotional balances are non-refundable. ";
	}
	// if Prepaid in ad
	if(ChkBoxRP_Prepaid == true){
		strDisclaimer += " <strong>Prepaid Monthly Plans:</strong> Plan features available for 30 days; if sufficient accounts balance, plans automatically renew at the end of 30 days. If balance is insufficient to renew for 60 days, account will be converted to Pay As You Go and Pay As You Go terms, including service availability, will apply. <strong>Pay As You Go:</strong> Service available for 90 days (one year for Gold Rewards) after activation/refill. After that, your account will be suspended and no service will be available. Gold Rewards requires activation of $100 in refills; you must refill while on Pay As You Go plan to obtain full Gold Rewards benefits. <strong>General Terms:</strong> Sufficient balance required to use service. Calls rated on a per minute basis; partial minutes rounded up for billing. By using service, you accept T-Mobile's Terms and Conditions. ";
	}
	// if T-Mobile to T-Mobile in ad
	if(ChkBoxRP_TMOtoTMO == true || ChkBoxRP_whenever == true){
		strDisclaimer += " <strong>T-Mobile-to-T-Mobile</strong> calls are directly dialed between T-Mobile customer devices while on the T-Mobile USA network (and not roaming on any domestic or international network); calls to voicemail and other T-Mobile service numbers not included. ";
	} 
	// if Nights and weekends in ad			
	if(ChkBoxRP_nightsweekends == true || ChkBoxRP_whenever == true){
		 strDisclaimer += " <strong>NIGHTS AND WEEKENDS:</strong> Weekends are midnight Fri. to midnight Sun, and nights are 9:00 p.m. to 6:59 a.m. Mon.-Fri., based upon start time of call. If on FlexPay or kidConnect calls rated on a per-minute basis. Time of call usually based on location of equipment transmitting call; if location is not available, time of call based on time zone associated with your phone number. Different terms apply to Prepaid. ";
	} 				
	// if rate plan in ad only offers weekends
	if(ChkBoxRP_weekend == true) {
		strDisclaimer += " <strong>WEEKENDS:</strong> Weekends are midnight Fri. to midnight Sun, based upon start time of call.  If on FlexPay or kidConnect, calls rated on a per minute basis.  Time of call usually based on location of equipment transmitting call; if location is not available, time of call based on time zone associated with your phone number. Different terms apply to prepaid. ";
	}			
	// If mail in rebate and instore rebate is in ad
	if(ChkBoxHS_mailrebate == true && ChkBoxHS_instantrebate == true){ 
		strDisclaimer += " <strong>DISCOUNTED DEVICE / MAIL-IN AND IN-STORE REBATE CARD:</strong> Limited to specific model(s) shown. Supplies may be limited and offer may not be available at all locations. We reserve the right to substitute different models of equal or greater value. Allow up to 4 weeks for delivery. One device per eligible account. Must remain on a qualifying rate plan at the time rebate is processed. Allow up to 8 weeks for rebate. See rebate form for details. ";}
	// If mail in rebate but no instant rebate in ad			
	else
	if(ChkBoxHS_mailrebate == true && ChkBoxHS_instantrebate == false){ 
	strDisclaimer += " <strong>DISCOUNTED DEVICE / MAIL-IN REBATE CARD:</strong> Activation of qualifying voice and data plan may be required; must remain on account at time rebate is processed. Limited to specific model(s) shown; supplies may be limited. We may substitute different models of equal or greater value. One device per eligible account. Allow up to three billing cycles for rebate. See rebate form for details. "; }
	
	// If instant rebate but mail in rebate in ad
	
	else
	if(ChkBoxHS_mailrebate == false && ChkBoxHS_instantrebate == true){ strDisclaimer += " <strong>DISCOUNTED DEVICE / IN-STORE REBATE CARD:</strong> Limited to specific model(s) shown; Supplies may be limited and offer may not be available at all locations. We reserve the right to substitute different models of equal or greater value. See store for details. "; }
	
	if(ChkBoxAO_thirdparty == true){
		strDisclaimer += " <strong>Third Party Content:</strong> T-Mobile is not responsible for any third party content or websites you access using your device. T-Mobile is not responsible for third party applications, including download, installation, use, transmission failure, interruption or delay, third party advertisements you may encounter while using an application, alterations any application may make to the functionality of your device, including any changes that may affect your T-Mobile plan, service, or billing, or any content or website you may be able to access through an application. ";
	}
	
	// if Equipment Installment Plan is in ad							
	if(ChkBoxAO_eip == true){
		strDisclaimer += " <strong>Equipment Installment Plan:</strong> Availability &amp; amount of financing <strong>subject to credit approval.</strong> Down payment &amp; unfinanced portion required at purchase. Remaining balance paid in 3 (Even More plan) or 19 (Even More Plus plan) monthly payments. Qualifying plan required for duration of EIP agreement; account must be in good standing. Late/non-payment fees may apply. Example(s) shown reflects the down payment &amp; monthly payments of our most credit worthy customers; amounts for others will vary. Available only at T-Mobile-owned retail stores; see store for details. ";
	}
	
	//WebConnect Data Stick
	if(ChkBoxAO_datastick == true){
		strDisclaimer += " <strong>webConnect:</strong> Device for data only, speed variable and affected by network conditions and traffic. Data stick may not be shared, including use with a network or more than one computer or other device. Requires data plan; Service and 3G coverage not available everywhere; No Domestic roaming. See Coverage Maps for details. Roaming charges may apply to use via non-T-Mobile-owned Wi-Fi networks. International use requires international service activation; usage does not apply toward monthly data limit. <strong>International rates apply.</strong> "
	}
	
	// [This will be displayed regardless of any choices are made]
	strDisclaimer += " <strong>COVERAGE:</strong> Service and 3G coverage not available everywhere. <strong>ABNORMAL USAGE:</strong> Service may be limited or terminated for misuse, abnormal usage or significant roaming. See brochures and <strong>Terms and Conditions (including arbitration provision)</strong> at <a href=\"http://www.t-mobile.com\">www.T-Mobile.com</a> for additional information. T-Mobile and the magenta color are registered trademarks of Deutsche Telekom AG.";


//Disclaimer languages end here. All further coding pertains to the functions of the Disclaimer Builder and calling out variables for the form check boxes.

// Add Disclaimer string to DIV container
	DisclaimerResultContainer = document.getElementById("DisclaimerResult");
	DisclaimerResultContainer.innerHTML = strDisclaimer;			
}		

function SortHandSet(HandSetObj)
{
	Ismailrebate = false;
	Isinstantrebate = false;

	for(var i=0; i < HandSetObj.length; i++)
	{
		if (HandSetObj[i].checked){
			var strHandSetObj = HandSetObj[i].value;
		
			if(strHandSetObj.substr(0,10) == "mailrebate"){
				Ismailrebate = true;
			}
			
			if(strHandSetObj.substr(0,13) == "instantrebate"){
				Isinstantrebate = true;
			}

			// SET ALL CHECKBOX VARIABLES TO TRUE IF CHECKBOX IS CHECK
			if(HandSetObj[i].value == "mailrebate") ChkBoxHS_mailrebate = true;
			if(HandSetObj[i].value == "instantrebate") ChkBoxHS_instantrebate = true;

		} else {
			// SET ALL CHECKBOX VARIABLES TO FALSE IF CHECKBOX IS NOT CHECK
			if(HandSetObj[i].value == "mailrebate") ChkBoxHS_mailrebate = false;
			if(HandSetObj[i].value == "instantrebate") ChkBoxHS_instantrebate = false;

		}
	} 
}


function SortAddon(AddonObj)
{
	for(var i=0; i < AddonObj.length; i++)
	{
		if (AddonObj[i].checked)
		{
			// SET ALL CHECKBOX VARIABLES TO TRUE IF CHECKBOX IS CHECK
			if(AddonObj[i].value == "g1") ChkBoxAO_g1 = true;
			if(AddonObj[i].value == "cameo") ChkBoxAO_cameo = true;	
			if(AddonObj[i].value == "datastick") ChkBoxAO_datastick = true;	
			if(AddonObj[i].value == "thirdparty") ChkBoxAO_thirdparty = true;
			if(AddonObj[i].value == "addaline") ChkBoxAO_addaline = true;
			if(AddonObj[i].value == "eip") ChkBoxAO_eip = true;

		} else 
		{
			// SET ALL CHECKBOX VARIABLES TO FALSE IF CHECKBOX IS NOT CHECK
			if(AddonObj[i].value == "g1") ChkBoxAO_g1 = false;
			if(AddonObj[i].value == "cameo") ChkBoxAO_cameo = false;
			if(AddonObj[i].value == "datastick") ChkBoxAO_datastick = false;
			if(AddonObj[i].value == "thirdparty") ChkBoxAO_thirdparty = false;
			if(AddonObj[i].value == "addaline") ChkBoxAO_addaline = false;
			if(AddonObj[i].value == "eip") ChkBoxAO_eip = false;
		}
	} 
}
		
function SortratePlan(ratePlanObj)
{
	for(var i=0; i < ratePlanObj.length; i++)
	{
		if (ratePlanObj[i].checked){
			// SET ALL CHECKBOX VARIABLES TO TRUE IF CHECKBOX IS CHECK
			if(ratePlanObj[i].value == "datamessaging") ChkBoxRP_datamessaging = true;
			if(ratePlanObj[i].value == "whenever") ChkBoxRP_whenever = true;
			if(ratePlanObj[i].value == "nightsweekends") ChkBoxRP_nightsweekends = true;
			if(ratePlanObj[i].value == "weekend") ChkBoxRP_weekend = true;
			if(ratePlanObj[i].value == "TMOtoTMO") ChkBoxRP_TMOtoTMO = true;
			if(ratePlanObj[i].value == "evenMoreUnlimitedTalk") ChkBoxRP_evenMoreUnlimitedTalk = true;
			if(ratePlanObj[i].value == "evenMoreWithAddALine") ChkBoxRP_evenMoreWithAddALine = true;
			if(ratePlanObj[i].value == "evenMorePlusUnlimitedTalk") ChkBoxRP_evenMorePlusUnlimitedTalk = true;
			if(ratePlanObj[i].value == "evenMoreUnlimitedMessaging") ChkBoxRP_evenMoreUnlimitedMessaging = true;
			if(ratePlanObj[i].value == "evenMoreUnlimitedMessagingWithAddALine") ChkBoxRP_evenMoreUnlimitedMessagingWithAddALine = true;
			if(ratePlanObj[i].value == "evenMorePlusUnlimitedMessaging") ChkBoxRP_evenMorePlusUnlimitedMessaging = true;
			if(ratePlanObj[i].value == "evenMoreBoth") ChkBoxRP_evenMoreBoth = true;
			if(ratePlanObj[i].value == "evenMoreBothTalkTextWeb") ChkBoxRP_evenMoreBothTalkTextWeb = true;
			if(ratePlanObj[i].value == "myFaves") ChkBoxRP_myFaves = true;
			if(ratePlanObj[i].value == "FlexPay") ChkBoxRP_FlexPay = true;
			if(ratePlanObj[i].value == "Prepaid") ChkBoxRP_Prepaid = true;
			if(ratePlanObj[i].value == "FAMallow") ChkBoxRP_FAMallow = true;
			if(ratePlanObj[i].value == "athome") ChkBoxRP_athome = true;
			if(ratePlanObj[i].value == "hotSpot") ChkBoxRP_hotSpot = true;
			if(ratePlanObj[i].value == "data") ChkBoxRP_data = true;


		} else {
			// SET ALL CHECKBOX VARIABLES TO FALSE IF CHECKBOX IS NOT CHECK
			if(ratePlanObj[i].value == "datamessaging") ChkBoxRP_datamessaging = false;
			if(ratePlanObj[i].value == "whenever") ChkBoxRP_whenever = false;
			if(ratePlanObj[i].value == "nightsweekends") ChkBoxRP_nightsweekends = false;
			if(ratePlanObj[i].value == "weekend") ChkBoxRP_weekend = false;
			if(ratePlanObj[i].value == "TMOtoTMO") ChkBoxRP_TMOtoTMO = false;
			if(ratePlanObj[i].value == "evenMoreUnlimitedTalk") ChkBoxRP_evenMoreUnlimitedTalk = false;
			if(ratePlanObj[i].value == "evenMoreWithAddALine") ChkBoxRP_evenMoreWithAddALine = false;
			if(ratePlanObj[i].value == "evenMorePlusUnlimitedTalk") ChkBoxRP_evenMorePlusUnlimitedTalk = false;
			if(ratePlanObj[i].value == "evenMoreUnlimitedMessaging") ChkBoxRP_evenMoreUnlimitedMessaging = false;
			if(ratePlanObj[i].value == "evenMoreUnlimitedMessagingWithAddALine") ChkBoxRP_evenMoreUnlimitedMessagingWithAddALine = false;
			if(ratePlanObj[i].value == "evenMorePlusUnlimitedMessaging") ChkBoxRP_evenMorePlusUnlimitedMessaging = false;
			if(ratePlanObj[i].value == "evenMoreBoth") ChkBoxRP_evenMoreBoth = false;
			if(ratePlanObj[i].value == "evenMoreBothTalkTextWeb") ChkBoxRP_evenMoreBothTalkTextWeb = false;
			if(ratePlanObj[i].value == "myFaves") ChkBoxRP_myFaves = false;
			if(ratePlanObj[i].value == "FlexPay") ChkBoxRP_FlexPay = false;
			if(ratePlanObj[i].value == "Prepaid") ChkBoxRP_Prepaid = false;
			if(ratePlanObj[i].value == "FAMallow") ChkBoxRP_FAMallow = false;
			if(ratePlanObj[i].value == "athome") ChkBoxRP_athome = false;
			if(ratePlanObj[i].value == "hotSpot") ChkBoxRP_hotSpot = false;
			if(ratePlanObj[i].value == "data") ChkBoxRP_data = false;

		}
	}
}

function disableAddALine() {
	var objAddALine = document.getElementById('addaline');
	
	objAddALine.checked = false;
	
	if (objAddALine.disabled)
		objAddALine.disabled = false;
	else
		objAddALine.disabled = true;
}