// globals for what the user selects
var dateRangeStr = "", productStr = "", manufacturerStr = "", manufacturerRebateStr = "", covadRebateStr = "";
var selectedDateRangeIndex, selectedProductIndex, selectedManufacturerIndex, rebateSectionNumberImgPath;
var noRebatesAvailable = 0;

// ******** BEGIN USER-DEFINED VARS ********* //

// first, some formatting options
var selectedLinkColor = "#336699";					// when the user clicks an option, it will become this color
var unselectedLinkColor = "#808080";				// when the user clicks an option, the other options will become this color
var selectedLinkIsBold = 1;							// when the user clicks an option, it will become bold if this is true
var selectedLinkAnnotation = "&raquo; ";					// "marker" on the left of a clicked link
var selectedLinkClass = "selected_rebate_link";		// class definition for the link selected
var unselectedLinkClass = "unselected_rebate_link";	// class definition for the links not selected

// define the text in the "no rebates" section
var noRebatesStr = "<b>Unfortunately there are no rebates available for the product/order date combination you selected.</b>";

// add a new date range here, or replace an old one, but don't forget to update the corresponding arrays:
// 		rebatesShowCovad		rebatesShowEquip
var rebateDateRanges = [
	"On or after October 1, 2006",
	"On or after January 1, 2007"
];


// if it's necessary to update/remove a product here, be sure to update these arrays also:
// 		rebatesShowCovad		rebatesShowEquip
var rebateProducts = [
	"TeleSoho ADSL", 
	"TeleSoho Dedicated ADSL", 
	"TeleSpeed Professional/TeleSpeed Enterprise SDSL", 
	"T1 TeleXtend"
];

// flags for showing equip and covad rebate box depending on product selected
// 
// this is a matrix (date range indices x product indices), defining the flags for showing a particular 
// rebate offer link per the date range and product selected
//
// format: rebateArray[date range index][product index]
//
// example: To show a Covad rebate for 1st selected date range for TeleSoho Dedicated, look to the first
// 			"sub" array of rebatesShowCovad (rebatesShowCovad[0]) and look at the second element of said subarray
// 			(rebatesShowCovad[0][1]) -- if the value = 1 then show it, if 0 then don't

var rebatesShowCovad = [
	[1, 1, 0, 1],	// flags for 1st rebate date range per product 
	[1, 1, 0, 0],	// flags for 2nd rebate date range per product 
];

var rebatesShowEquip = [
	[0, 0, 0, 1],	// flags for 1st rebate date range per product 
	[0, 0, 0, 0],	// flags for 2nd rebate date range per product 
];

// rebate form links for equipment rebates
//
// note: same matrix format as the above equip/covad rebate display flags, only this time with URLs!  Oh joy!
// also, this time around, there is a 3rd dimension, so it's a bit more insane.
//
// there is one matrix total, housing all equipment links for each manufacturer in rebateEquipManufs[]. 
// it goes like this:
//
// format: rebatesManufacturers[date range index][product index][manufacturer index]
// matrix: date range indices x product indices x manufacturer indices
//
// there MUST be a date range matrix defined here for EACH date range in rebateDateRanges[]
// if there is no manufacturer rebate for a particular product in a particular date range, make it an empty string ("")

var rebatesManufacturers = [
	[	// 1st date range index
		[	// 1st product index
			"",		// 1st manufacturer index
			""		// 2nd manufacturer index
		],
		[	// 2nd product index
			"",		// 1st manufacturer index
			""
		],
		[	// 3rd product index
			"http://www.web-rebates.com/siemens/5104",		// 1st manufacturer index
			"http://www.netopia.com/equipment/promo/rebate/covad_4652t/"
		],
		[	// 4th product index
			"https://www.web-rebates.com/siemens/5123",		// 1st manufacturer index
			"http://www.netopia.com/equipment/promo/rebate/covad_4622XL/"
		]
	], 
	[	// 2nd date range index
		[	// 1st product index
			"",		// 1st manufacturer index
			""		// 2nd manufacturer index
		],
		[	// 2nd product index
			"",		// 1st manufacturer index
			""
		],
		[	// 3rd product index
			"http://www.web-rebates.com/siemens/5104",		// 1st manufacturer index
			"http://www.netopia.com/equipment/promo/rebate/covad_4652t/"
		],
		[	// 4th product index
			"https://www.web-rebates.com/siemens/5123",		// 1st manufacturer index
			"http://www.netopia.com/equipment/promo/rebate/covad_4622XL/"
		]
	], 
];

// manufacturer rebate names
var rebateEquipManufs = [
	"Efficient Network/Siemens", 
	"Netopia"
];

// must be one for each date in rebateDateRanges, respectively, even if they are the same
var rebateCovadLinks = [
	// Covad rebate links
	"http://www.web-rebates.com/covad/8685",	// 1st rebate date range
	"http://www.web-rebates.com/covad/8889"	// 2nd rebate date range
];

// ******** END USER-DEFINED VARS ********* //