var c = {
	defaultProduct:"",
	defaultSchoolName:"",
	defaultWebsiteAddress:"",
	pid: "",
	pidClasses: "",
	updatePID: function(pid) {
		this.pid = pid;		
		this.populateReasons();
		this.showRows(pid);
	},
	showRows: function(pid) {
		$("tr.hide").hide();
		$("tr."+this.pid +":not(.reasons)").show();
		$("#hover_httpOver").hide();
		$("#hover_isbnOver").hide();
	},
	populateReasons: function() {
		$("#reasons").html($("#REASONS_TPL").val());
		$("#reasons > :not(option."+this.pid+")").remove();
		this.bindChangeOnReasons();
		//upadate the description text
		if(typeof pd[this.pid] != "undefined") {
			$("#desctext").html(pd[this.pid]);
		}
	},
	bindChangeOnProduct: function() {
		$("#product").bind('change', function() {
			c.onchangeProduct($(this));		
		});
	},
	onchangeProduct: function(el) {
		/***********************************************/
		// reset all the radios and select to unselected scenario
		$("tr.hide").find(":radio").attr("checked", false);
		$("tr.hide select").attr("selectedIndex",0).trigger('change');
		$("tr.hide").find(":text").val("");
		$(".method").hide();
		$("#supportInfo").hide();
		$("#unableToProcess").show();
		if(c.defaultSchoolName != "") {
			$("#form_school, #form_school_internal").val(c.defaultSchoolName);			
		}
		if(c.defaultWebsiteAddress!="") {
			$("#website").val(c.defaultWebsiteAddress);			
		}
		/*************************************/
		var oi = $(el).attr('selectedIndex');
		var option = $(el).find('option:eq('+oi+')');
		var ref = $(option).attr('ref');
		c.updatePID($(el).find('option:eq('+oi+')').attr('pid'));
		if(c.pid == "P7") {
			c.bindChangeOnDiscipline();
		}else {
			$("#discipline").unbind('change');
		}
		if(ref != "undefined" && ref != "") {
			if($("[name='"+ref+"']").attr('nodeName')=="INPUT") {
				$("[name='"+ref+"']").unbind('click').bind('click', function() {
				// for cd/online and catalyst version and connect discipline
					$(".reasons").hide();
					c.createSubProduct($(this));
				});				
			}else {
				$("[name='"+ref+"']").unbind('change').bind('change', function() {
				// for cd/online and catalyst version and connect discipline
					$(".reasons").hide();
					c.createSubProduct($(this));
				});				
			}
		}		
	},
	createSubProduct: function(elem) {
		var elemVal = $(elem).val();
		if(elemVal=="") {
			$("#reasons").parents("tr").hide();
			return;
		}
		var type = $(elem).attr("nodeName");
		var newPID = "";
		switch(type) {
			case 'INPUT':
				var map = {cd:"A",online:"B"};
				//$(elem).attr("checked",false);
				this.pid = this.pid.replace(/(P[0-9]+)(.*)/,"$1") + map[elemVal];
				if(map[elemVal] == "B") {
					$("#row5").show(); //show the website only when online is chosen
				}else {
					$("#row5").hide(); //don't show the website when cd is chosen
				}				
				break;
			case 'SELECT':
				//$(elem).attr("selectedIndex",0);				
				this.pid = this.pid.replace(/(P[0-9]+)(.*)/,"$1") + "V"+parseInt(elemVal);
				break;
			default:
				c.log("Error occured in switching between different element types")
		}
		$("#reasons").parents("tr").show();
		c.populateReasons();
	},
	bindChangeOnReasons: function() {
		$("#reasons").unbind('change').bind('change', function() {
			var oi = $(this).attr('selectedIndex');
			var option = $(this).find('option:eq('+oi+')');
			var rid = new RegExp($(option).attr('rid')+"\\b","i");
			$("tr.reasons").hide();
			if(typeof pe[c.pid] !="undefined" && typeof pe[c.pid][$(option).attr('rid')] != "undefined") {
				$("#"+pe[c.pid][$(option).attr('rid')].join(",#")).show()				
			}
			$(this).val() == "Refund" ? $("input.Submit").hide(): $("input.Submit").show();
			//hide submit when reason is refund
		});
	},
	log:function(o) {
		if(window.console && console.log) {
			console.log(o);
		}else {
			alert(o);
		}
	},
	selectDefaultProduct: function() {
		c.bindChangeOnProduct();
		$("#product").attr("selectedIndex", 0);
		$("#product option").each(function() {
			if($(this).text().replace(/\s|&/g,"").toLowerCase() == c.defaultProduct.replace(/\s/g, "").toLowerCase()) {
				$("#product").attr('selectedIndex',($(this).attr('index')));
				$("#product").trigger('change');
			}
		});
	},
	selectDefaultSchoolName: function() {
		$("#form_school, #form_school_internal").val(this.defaultSchoolName);
	},
	selectDefaultWebsiteAddress: function() {
		$("#website").val(c.defaultWebsiteAddress);		
	},
	bindChangeOnDiscipline: function() {
		var discipline = {
			"Composition":"For support on Connect Composition please use the following information:<br />Email: <a href='mailto:support@mhconnectcomposition.com'>support@mhconnectcomposition.com</a><br />Phone: (800) 593-1851",
			"Literature":"For support on Connect Literature please use the following information:<br />Email: <a href='mailto:support@mhconnectliterature.com'>support@mhconnectliterature.com</a><br />Phone: (800) 593-1851",
			"Writing":"For support on Connect Writing please use the following information:<br />Email: <a href='mailto:support@mhconnectwriting.com'>support@mhconnectwriting.com</a><br />Phone: (800) 593-1851",
			"Public Speaking":"For support on Public Speaking (Lucas) please use the following information:<br />Phone: 1-888-843-1655<br />Email: <a href='mailto:support@connectlucas.com' target='_blank'>support@connectlucas.com</a>"
		};
		$("#discipline").unbind('change').bind('change', function() {
			if(typeof discipline[$(this).val()] != "undefined") {
				$("tr.hide").hide();
				$("#supportInfo").html(discipline[$(this).val()]).show();
				$("#unableToProcess").hide();
				$("tr#row25, #row3").show();
				$("input.Submit").hide();
			}else {
				c.showRows();
				$("input.Submit").show();
			}
		});
	},
	validateAll: function() {
		$(".mandatory").parents("tr").find("label:first").removeClass('error');
		/*
		 * algo:
		 * 1. 	validate for datatypes, if you want
		 * 1.5 	apply error to all labels which are mandatory after checking they were not filled
		 * 2. 	remove error from the labels which are not visible
		 * 3. 	count the labels with error. if length > 0, there is an error on the form.
		 */
		$(".mandatory").each(function() {
			// step 1:
			var type = $(this).attr('nodeName') + "-" + $(this).attr('type');
			switch(type) {
				case 'INPUT-radio':
				case 'INPUT-checkbox':
					if($("[name='"+$(this).attr('name')+"']:checked").length==0) {
						$(this).parents("tr").find("label:first").addClass('error');
					}
					break;
				default:
					if($.trim($(this).val())=="") {
						$(this).parents("tr:first").find("label:first").addClass('error');						
					}else {
						$(this).parents("tr").find("label:first").removeClass('error');						
					}
			}
		});
		$("[dataType]").each(function() {
			// check for the data types step 1.5
			if(!c.isAllowed($(this).attr('dataType'), $(this))) {
				$(this).parents("tr").find("label:first").addClass('error');
			}else if($(this).hasClass('mandatory') != true) {
				$(this).parents("tr").find("label:first").removeClass('error');
			}
		});
		$(".mandatory").parents("tr").each(function() {
			if($(this).css('display') == 'none') {
				$(this).find('label.error').removeClass('error');
			}
		});
		if($("label.error").length > 0) {
			return false;
		}else {
			var reasonSelect = $("#reasons").val();
			var buildDescription = '';
			var buildSubject = '';
			var version = '';
			buildDescription = 'Name: ' + $("#form_firstName").val() + ' ' + $("#form_lastName").val() + '\n' +
			'Phone: ' + $('#form_phone').val() + '\n' +
			'School: ' + $('#form_school').val() + '\n' /*+
			'Browser: ' + $('#form_browser').val() + '\n'*/;
			reasonSelect = reasonSelect == null ? '' : reasonSelect;
			$('#form_incident').val(reasonSelect.toLowerCase() == 'other' ? '' : reasonSelect);			
			switch(reasonSelect) {
				case 'Other':
					buildSubject = $("#form_subject").val();
					break;
				case 'Assignment Issues':
					buildSubject = reasonSelect + " - " + $("#form_assignmentName").val();
					break;
				case 'Refund':
					return false;
				default:
					buildSubject = reasonSelect;
			}
			$("tr, .method").each(function() {
				if($(this).css('display')!='none') {
					var elem = $(this).find(":text,select,:radio:checked,textarea");
					var labelName = $(elem).attr('labelName');
					if(typeof labelName != "undefined" && labelName.length > 0) {
						buildDescription += labelName + ":" + $(elem).val()+"\n";								
					}
				}
			});
			buildDescription += "\n";
			
			switch($("#product").val()) {
				case 'APR':
				case 'NutriCalc':
					version = $("[name='variant']:checked").val();
					break;
				case 'Connect':
					version = $("#discipline").val();
					break;
				case 'Catalyst':
					version = $("[name='prodVersion']").val();
					break;
        case 'Peachtree':
					$("#product").val('Other Product');
					$("[name='00N70000001gde3']").val('Peachtree');
					break;
				default:
					// nothing to do.
			}
			var products = document.getElementById("product");
			var pidx = products.selectedIndex;
			
			if (products[pidx].text=="Understanding Business Online") {
         document.getElementById("enhanced").value="1";
          $("[name='00N70000001gde3']").val('UBO');
          buildSubject += " - " + document.getElementById("carttype").value;
      } 
			
			$('#form_subject_real').val(buildSubject);
			$('#form_description_real').val(buildDescription);
			$('#form_version_real').val(version);
			$("#form").submit();
		}
	},
	isAllowed: function(allowed, elem) {
		var allow = true;
		var value = $.trim($(elem).val());
		if(typeof allowed != "undefined" && value != "") {			
			switch(allowed) {
				case 'phonenumber':
					allow = value.match(/[^0-9-() ]/) == null ? true : false;
					break;
				case 'number':
					allow = value.match(/[^0-9-() ]/) == null ? true : false;
					break;
				case 'emailconfirm':
					if($("#"+$(elem).attr('confirm')).val() != value) {
						$("#"+$(elem).attr('confirm')).parents("tr").find("label:first").addClass('error');
						allow = false;
						break;
					}
				case 'email':
					allow = value.match(/(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])/) != null ? true : false;
					break;
			}
		}
		return allow;
	},
	_GET: function(str, param) {
		if(str && param) {
			var match = "";
			var regex = new RegExp(param+"=([^&]+)","i");			
			if(regex) {
				var matches = str.match(regex);
				match = matches != null ? matches[1] : "";
			}
			return unescape(match);
		}
	}
}

$(document).ready(function() {
	/*
	 *	reset all on load
	 */
	$(":text, textarea.Text").val('');
	$(":radio:checked").attr("checked", false);
	$(".method").hide();
	$("[name='textbook']").bind('click', function() {
		$(".method").hide();
		$("."+$(this).attr('id')+"Method").show();
	});
	$("#custType").bind('change', function() {
		$("tr.instr").hide();
		if(c.defaultSchoolName!="") {
			$("tr.instr :text:not(#form_school_internal, #form_school)").val('');
		}
		else{
			$("tr.instr :text").val('');
		}
		$("tr.instr select").attr('selectedIndex', 0);
		$("tr."+$(this).val()).show();
		$("#form_country").trigger('change');
	});
	$("#custType").attr("selectedIndex", 0);
	$("#form_country").attr("selectedIndex", 0);
	$("#schoolStateDrp").attr("selectedIndex", 0);
	$("#custType").trigger('change');
	c.selectDefaultProduct();
	c.selectDefaultSchoolName();
	c.selectDefaultWebsiteAddress();	
	$("input.Submit").click(function() {
		return c.validateAll();
	});
	//Hover of links
	$("#hover_httpOver").hide();
	$("#hover_isbnOver").hide();
    $("#httpOver").hover(
      function () {
        $("#hover_httpOver").show();
      }, 
      function () {
        $("#hover_httpOver").hide();
      }
    );
    $("#isbnOver").hover(
      function () {
        $("#hover_isbnOver").show();
      }, 
      function () {
        $("#hover_isbnOver").hide();
      }
    );
	$("#form_country").bind('change', function() {
		var cName = $("#custType").val();
		if(cName != "") {
			if($(this).val() == "USA") {
				$("."+cName+"#schoolStateDrp").show();
				$("."+cName+"#schoolStateTxt").hide();
			}else {
				$("."+cName+"#schoolStateTxt").show();
				$("."+cName+"#schoolStateDrp").hide();
			}
			/* c.log(("."+cName+"#schoolStateDrp"));
			c.log($("."+cName+"#schoolStateDrp")); */
		}
	});
});

function textCounter( field, maxlimit ) {
  if ( field.value.length > maxlimit )
  {
    field.value = field.value.substring( 0, maxlimit );
    return false;
  }
}

/******************	 CONFIGURATION BELOW THIS LINE	**********************/
var pe = {
/*
 * Rows not to be shown in exceptional case.
 */	
	P1A: {//product=APR cd
		R8:["row2","row13","row24"],
		R15:["row2","row19","row24"], 
		R18:["row2","row25"], 
		R22:["row2","row12","row24"], 
		R23:["row2","row24"]
	},
	P1B: {//product=APR online 
		R2:["row2","row5","row12","row24"], 
		R8:["row2","row5","row13","row24"], 
		R14:["row2","row5","row13","row23"], 
		R15:["row2","row5","row19","row24"], 
		R18:["row2","row5","row25"], 
		R19:["row2","row5","row12","row24"], 
		R23:["row2","row5","row24"]
	},
	P2: {//product=Angel
	 	R2:["row6","row7","row8","row12","row17","row18","row24"],
		R4:["row6","row7","row8","row17","row18","row24"],
		R5:["row6","row7","row8","row17","row18","row24"],
		R11:["row6","row7","row8","row17","row18","row24"],
		R15:["row6","row7","row8","row17","row18","row19","row24"],
		R22:["row6","row7","row8","row17","row18","row24"],
		R23:["row6","row7","row8","row17","row18","row24"]
	},
	P3: {//product=ARIS
	 	R1:["row5","row6","row7","row8","row14","row15","row16","row24"],
		R2:["row5","row6","row7","row8","row12","row24"],
		R6:["row5","row6","row7","row8","row14","row15","row16","row24"],
		R8:["row5","row6","row7","row8","row13","row24"],
		R14:["row5","row6","row7","row8","row13","row23"],
		R15:["row5","row6","row7","row8","row19","row24"],
		R18:["row5","row6","row7","row8","row25"],
		R19:["row5","row6","row7","row8","row12","row21","row24"]
	},
	P4: {//product=Blackboard
	 	R2:["row6","row7","row8","row12","row17","row18","row24"],
		R3:["row6","row7","row8","row17","row18","row24"],
		R4:["row6","row7","row8","row17","row18","row24"],
		R8:["row6","row7","row8","row13","row17","row18","row24"],
		R11:["row6","row7","row8","row17","row18","row24"],
		R12:["row6","row7","row8","row17","row18","row24"],
		R15:["row6","row7","row8","row17","row18","row19","row24"],
		R19:["row6","row7","row8","row12","row17","row18","row24"]
	},
	P5V2: {//product=Catalyst v2.0
		R1:["row1","row5","row14","row16","row24"], 
		R2:["row1","row5","row12","row24"], 
		R14:["row1","row5","row13","row23"], 
		R15:["row1","row5","row19","row24"], 
		R16:["row1","row5","row19","row24"], 
		R19:["row1","row5","row12","row24"]
	},
	P5V3: {//product=Catalyst v3.0
		R1:["row1","row5","row14","row16","row24"], 
		R2:["row1","row5","row12","row24"], 
		R14:["row1","row5","row13","row23"], 
		R15:["row1","row5","row19","row24"], 
		R18:["row1","row5","row25"], 
		R19:["row1","row5","row12","row22","row24"]
	},
	P6: {//product=CD/DVD
	 	R4:["row6","row7","row8","row24"],
		R8:["row6","row7","row8","row13","row24"],
		R11:["row6","row7","row8","row24"],
		R15:["row6","row7","row8","row19","row24"],
		R18:["row6","row7","row8","row25"],
		R22:["row6","row7","row8","row24"],
		R23:["row6","row7","row8","row24"]
	},
	P7: {//product=Connect
		R1:["row3","row5","row6","row7","row8","row14","row15","row16","row24"],
		R2:["row3","row5","row6","row7","row8","row12","row24"],
		R6:["row3","row5","row6","row7","row8","row14","row15","row16","row24"],
		R8:["row3","row5","row6","row7","row8","row13","row24"],
		R14:["row3","row5","row6","row7","row8","row13","row23"],
		R15:["row3","row5","row6","row7","row8","row19","row24"],
		R18:["row3","row5","row6","row7","row8","row25"],
		R19:["row3","row5","row6","row7","row8","row12","row24"]
	},
	P8: {//product=Keyboarding(GDP), Cortez Peters 4e, Skillbuilding 3e 
		R1:["row7","row8","row17","row24"],
		R4:["row7","row8","row17","row24"],
		R15:["row7","row8","row17","row19","row24"],
		R22:["row7","row8","row17","row24"],
		R23:["row7","row8","row17","row24"],
		R24:["row7","row8","row17","row24"]
	},
	P9: {//product=D2L
		R2:["row6","row7","row8","row12","row17","row18","row24"],
		R4:["row6","row7","row8","row17","row18","row24"],
		R5:["row6","row7","row8","row17","row18","row24"],
		R11:["row6","row7","row8","row17","row18","row24"],
		R15:["row6","row7","row8","row17","row18","row19","row24"],
		R22:["row6","row7","row8","row17","row18","row24"],
		R23:["row6","row7","row8","row17","row18","row24"]
	},
	P10: {//product=eCollege
		R2:["row6","row7","row8","row12","row17","row18","row24"],
		R4:["row6","row7","row8","row17","row18","row24"],
		R5:["row6","row7","row8","row17","row18","row24"],
		R11:["row6","row7","row8","row17","row18","row24"],
		R15:["row6","row7","row8","row17","row18","row19","row24"],
		R22:["row6","row7","row8","row17","row18","row24"],
		R23:["row6","row7","row8","row17","row18","row24"]
	},
	P11: {//product=EZ Test
		R11:["row6","row24"],
		R12:["row6","row24"],
		R14:["row6","row24"],
		R15:["row6","row19","row24"],
		R22:["row6","row24"],
		R23:["row6","row24"]
	},
	P12: {//product=EZ Test Online
		R4:["row6","row7","row8","row24"],
		R9:["row6","row7","row8","row24"],
		R10:["row6","row7","row8","row24"],
		R11:["row6","row7","row8","row24"],
		R14:["row6","row7","row8","row13","row23"],
		R15:["row6","row7","row8","row19","row24"],
		R17:["row6","row7","row8","row24"],
		R19:["row6","row7","row8","row24"],
		R23:["row6","row7","row8","row24"]
	},
	P14: {//product=Homework Manager
		R1:["row6","row7","row8","row14","row15","row16","row24"],
		R2:["row6","row7","row8","row12","row24"],
		R6:["row6","row7","row8","row14","row15","row16","row24"],
		R8:["row6","row7","row8","row13","row24"],
		R14:["row6","row7","row8","row13","row23"],
		R15:["row6","row7","row8","row19","row24"],
		R18:["row6","row7","row8","row25"],
		R19:["row6","row7","row8","row12","row24"]
	},
	P15: {//product=MathZone
		R1:["row5","row6","row7","row8","row14","row15","row16","row24"],
		R2:["row5","row6","row7","row8","row12","row24"],
		R6:["row5","row6","row7","row8","row14","row15","row16","row24"],
		R8:["row5","row6","row7","row8","row13","row24"],
		R14:["row5","row6","row7","row8","row13","row23"],
		R15:["row5","row6","row7","row8","row19","row24"],
		R18:["row5","row6","row7","row8","row25"],
		R19:["row5","row6","row7","row8","row12","row21","row24"]
	},
	P16: {//product=MHGO
		R1:["row5","row7","row8","row14","row16","row24"],
		R2:["row5","row7","row8","row12","row24"],
		R14:["row5","row7","row8","row13","row23"],
		R15:["row5","row7","row8","row19","row24"],
		R18:["row5","row7","row8","row25"],
		R19:["row5","row7","row8","row12","row22","row24"]
	},
	P17: {//product=Medisoft
		R4:["row6","row8","row24"],
		R11:["row6","row8","row24"],
		R15:["row6","row8","row19","row24"],
		R22:["row6","row8","row24"],
		R23:["row6","row8","row24"]
	},
	P18: {//product=MHHE.com
		R11:["row6","row24"],
		R14:["row6","row13","row23"],
		R15:["row6","row19","row24"],
		R19:["row6","row12","row24"],
		R21:["row6","row24"]
	},
	P19: {//product=Moodle, Sakai
		R2:["row6","row7","row8","row12","row17","row18","row24"],
		R4:["row6","row7","row8","row17","row18","row24"],
		R5:["row6","row7","row8","row17","row18","row24"],
		R11:["row6","row7","row8","row17","row18","row24"],
		R15:["row6","row7","row8","row17","row18","row19","row24"],
		R22:["row6","row7","row8","row17","row18","row24"],
		R23:["row6","row7","row8","row17","row18","row24"]
	},
	P20A: { //product=NutriCalc cd
		R11:["row2","row24"], 
		R15:["row2","row19","row24"], 
		R18:["row2","row25"], 
		R22:["row2","row24"], 
		R23:["row2","row24"]
	},
	P20B: {//product=NutriCalc online
		R2:["row2","row5","row12","row24"], 
		R4:["row2","row5","row24"], 
		R8:["row2","row5","row13","row24"], 
		R11:["row2","row5","row24"], 
		R14:["row2","row5","row13","row24"], 
		R15:["row2","row5","row19","row24"], 
		R18:["row2","row5","row25"], 
		R19:["row2","row5","row12","row24"], 
		R23:["row2","row5","row24"]
	},
	P21: {//product=OLC
		R2:["row5","row6","row8","row12","row24"],
		R4:["row5","row6","row8","row24"],
		R8:["row5","row6","row8","row13","row24"],
		R11:["row5","row6","row8","row19","row24"],
		R14:["row5","row6","row8","row13","row23"],
		R15:["row5","row6","row8","row19","row24"],
		R18:["row5","row6","row8","row25"],
		R19:["row5","row6","row8","row12","row24"],
		R23:["row5","row6","row8","row24"]
	},
	P22: {//product=Passport to Reading
		R1:["row5","row7","row8","row14","row16","row24"],
		R2:["row5","row7","row8","row12","row24"],
		R14:["row5","row7","row8","row13","row23"],
		R15:["row5","row7","row8","row19","row24"],
		R18:["row5","row7","row8","row25"],
		R19:["row5","row7","row8","row12","row22","row24"]
	},
	P23: {//product=Presentation Center
		R4:["row5","row6","row7","row8","row24"],
		R11:["row5","row6","row7","row8","row24"],
		R14:["row5","row6","row7","row8","row24"],
		R15:["row5","row6","row7","row8","row19","row24"],
		R19:["row5","row6","row7","row8","row12","row24"],
		R23:["row5","row6","row7","row8","row24"]
	},
	P24: {//product=Primis
		R2:["row5","row6","row7","row8","row12","row24"],
		R4:["row5","row6","row7","row8","row24"],
		R7:["row5","row6","row7","row8","row24"],
		R8:["row5","row6","row7","row8","row13","row24"],
		R14:["row5","row6","row7","row8","row13","row23"],
		R15:["row5","row6","row7","row8","row19","row24"],
		R18:["row5","row6","row7","row8","row25"],
		R19:["row5","row6","row7","row8","row12","row24"],
		R23:["row5","row6","row7","row8","row24"]
	},
	P25: {//product=Quantum Tutor
		R4:["row5","row6","row24"],
		R8:["row5","row6","row13","row24"],
		R14:["row5","row6","row13","row24"],
		R15:["row5","row6","row19","row24"],
		R19:["row5","row6","row12","row24"]
	},
	P26: {//product=Respondus
		R2:["row6","row7","row8","row12","row17","row18","row24"],
		R4:["row6","row7","row8","row17","row18","row24"],
		R5:["row6","row7","row8","row17","row18","row24"],
		R11:["row6","row7","row8","row17","row18","row24"],
		R15:["row6","row7","row8","row17","row18","row19","row24"],
		R22:["row6","row7","row8","row17","row18","row24"],
		R23:["row6","row7","row8","row17","row18","row24"]
	},
	P27: {//product=SimNet
		R1:["row5","row7","row8","row9","row10","row11","row14","row16","row20","row24"],
		R2:["row5","row7","row8","row9","row10","row11","row12","row24"],
		R6:["row5","row7","row8","row9","row10","row11","row14","row16","row24"],
		R8:["row5","row7","row8","row9","row10","row11","row13","row24"],
		R14:["row5","row7","row8","row9","row10","row11","row13","row23"],
		R15:["row5","row7","row8","row9","row10","row11","row19","row24"],
		R18:["row5","row7","row8","row9","row10","row11","row25"],
		R19:["row5","row7","row8","row9","row10","row11","row12","row24"]
	},	
	P29: {//product=Tegrity
		R11:["row6","row17","row19","row24"],
		R14:["row6","row13","row17","row24"],
		R15:["row6","row17","row19","row24"],
		R19:["row6","row12","row13","row17","row24"],
		R23:["row6","row17","row24"]
	},
	P30: {//product=WebCT
		R2:["row6","row7","row8","row12","row17","row18","row24"],
		R3:["row6","row7","row8","row17","row18","row24"],
		R4:["row6","row7","row8","row17","row18","row24"],
		R11:["row6","row7","row8","row17","row18","row24"],
		R12:["row6","row7","row8","row17","row18","row24"],
		R15:["row6","row7","row8","row17","row18","row19","row24"],
		R19:["row6","row7","row8","row12","row17","row18","row24"],
		R22:["row6","row7","row8","row17","row18","row24"]
	},
	P31: {//product=Other Product
		R1:["row4","row5","row6","row7","row14","row15","row16","row24"],
		R2:["row4","row5","row6","row7","row12","row24"],
		R14:["row4","row5","row6","row7","row13","row24"],
		R15:["row4","row5","row6","row7","row19","row24"]
	},
	P32: {//product=Peachtree
		R15:["row6","row8","row19","row24"],
		R18:["row6","row8","row25"],
		R22:["row6","row8","row24"],
		R23:["row6","row8","row24"]
	},
	P34: {//product=ActivSIM
		R11:["row6","row7","row8","row17","row19","row24"],
		R14:["row6","row7","row8","row13","row17","row23"],
		R15:["row6","row7","row8","row17","row19","row24"],
		R19:["row6","row7","row8","row12","row17","row23"]
	},
	P35: {//product=Interactive Electronic Book
		R2:["row6","row7","row8","row12","row24"],
		R8:["row6","row7","row8","row13","row24"],
		R15:["row6","row7","row8","row19","row24"],
		R18:["row6","row7","row8","row25"],
		R19:["row6","row7","row8","row12","row13","row23"],
		R23:["row6","row7","row8","row24"]
	},
	P36: {//product=LearnSmart
		R2:["row6","row7","row8","row12","row24"],
		R14:["row6","row7","row8","row13","row24"],
		R15:["row6","row7","row8","row19","row24"],
		R19:["row6","row7","row8","row13","row24"]
	},
	P37: {//product=SpringCharts
		R11:["row5","row6","row24"],
		R14:["row5","row6","row13","row24"],
		R15:["row5","row6","row19","row24"],
		R19:["row5","row6","row12","row24"],
		R25:["row5","row6","row24"]
	},
	P38: {//product=Interactions e-Course
		R8:["row5","row6","row8","row13","row24"],
		R14:["row5","row6","row8","row13","row24"],
		R19:["row5","row6","row8","row12","row24"],
		R23:["row5","row6","row8","row24"]
	},
	P39: {//product=UBO
		R2:["row","row6","row8","row12","row24"],
		R9:["row5","row6","row8","row24"],
		R11:["row5","row6","row8","row24"],
		R12:["row5","row6","row8","row24"],
		R19:["row5","row6","row8","row12","row24"],
		R23:["row5","row6","row8","row24"]
	}
}
var pd = {
	// product description text
	P1 : 'To reset your password, <a href="http://www.mhhe.com/aprevealed" target="_blank">click here</a>',
	P7 : 'To reset your password, <form id="passreset" action="http://connect.mcgraw-hill.com/paris/forgotpasswordview.do" target="_blank" name="forgotPasswordForm" method="post"> <input type="hidden" name="productid" value="sparkbe"/> <input type="hidden" name="gotourl" value="/connect/parisCallback.do?event=forgotpassword"/> <input type="hidden" name="cancelurl" value="/connect/shortUrl.do?accessUrl="/></form><a href="javascript:;" onclick="$(\'#passreset\').submit();return false;">click here</a>',
	P14 : 'To reset your password, go to your instructor\'s HM Website URL, click "View My Grades", and then click "Forgot Your Password, Click here.',
	P3 : 'To reset your password, click "Forgot Password" on the ARIS login page.',
	P15 : 'To reset your password, <a href="http://www.mhhe.com/math/mathzone/forgotPassword.html" target="_blank">click here</a>',
	P27 : 'To reset your password, click "Forgot your password?" on your school\'s Simnet Online website.',
	P5V2 : 'To reset your password, <a href="http://highered.mcgraw-hill.com/webintegration/WebIntegrationServlet?call=RetrieveCredentialsWeblet&external=1&isbn=0073259381&chrome=/sites/0073259381/chrome.vm" target="_blank">click here</a>',
	P5V3 : 'To reset your password, <a href="http://mhcatalyst3.com/index.cfm?event=forgotLogIn" target="_blank">click here</a>',
	P16 : 'To reset your password, <a href="http://www.mhguideonline.com/index.cfm?event=forgotLogIn" target="_blank">click here</a>',
	P22 : 'To reset your password, <a href="http://www.passporttocollegereading.com/index.cfm?event=forgotLogIn" target="_blank">click here</a>',
	P21: 'To reset your password, refer back to the homepage of your textbook website.',
	P34: 'To reset your password, <a href="http://www.mhhe.com/aprevealed" target="_blank">click here</a>',
	P12: 'To reset your password, <a href="http://www.mhhe.com" target="_blank">click here</a>',
	P35: 'To reset your password, <a href="http://ieb.mcgraw-hill.com/ieb/ " target="_blank">click here</a>',
	P18: 'To reset your password, <a href="http://www.mhhe.com " target="_blank">click here</a>',
	P24: 'To reset your password, <a href="http://ebooks.primisonline.com/eBookstore/index.jsp " target="_blank">click here</a>'
}