var competitors = new Array(); function Competitor(id , name , state_to_state , ld_monthly_fee , international_monthly_fee , monthly_minimum , canada , uk , ebill_required , autopay_required , optional_paperbill , additional_lines , calling_card_domestic , billing_increments) { this.id = id; this.name = name; this.state_to_state = state_to_state; this.ld_monthly_fee = ld_monthly_fee; this.international_monthly_fee = international_monthly_fee; this.monthly_minimum = monthly_minimum; this.canada = canada; this.uk = uk; this.ebill_required = ebill_required; this.autopay_required = autopay_required; this.optional_paperbill = optional_paperbill; this.additional_lines = additional_lines; this.calling_card_domestic = calling_card_domestic; this.billing_increments = billing_increments; } function findCompetitor(name) { var returnCompetitor = null; for ( i = 0; i < competitors.length ; i++ ) { if ( competitors[i].name == name) { returnCompetitor = competitors[i]; break; } } return returnCompetitor; } function fillLayers(competitor) { getLayer("state_to_state").innerHTML = competitor.state_to_state; getLayer("ld_monthly_fee").innerHTML = competitor.ld_monthly_fee; getLayer("international_monthly_fee").innerHTML = competitor.international_monthly_fee; getLayer("monthly_minimum").innerHTML = competitor.monthly_minimum; getLayer("canada").innerHTML = competitor.canada; getLayer("uk").innerHTML = competitor.uk; getLayer("ebill_required").innerHTML = competitor.ebill_required; getLayer("autopay_required").innerHTML = competitor.autopay_required; getLayer("optional_paperbill").innerHTML = competitor.optional_paperbill; getLayer("additional_lines").innerHTML = competitor.additional_lines; getLayer("calling_card_domestic").innerHTML = competitor.calling_card_domestic; getLayer("billing_increments").innerHTML = competitor.billing_increments; } function lookupCompetitor(name) { competitor = findCompetitor(name); fillLayers(competitor); } competitors[0] = new Competitor(1,'AT&T','7¢','N/A','$3.95','N/A','6¢','8¢','NO','NO','N/A','one line only','25¢ per minute with a $1.00 monthly fee','1 minute increments'); competitors[1] = new Competitor(6,'BELLSOUTH','5¢','N/A','$9.95 ','N/A','7¢','9¢','NO','NO','N/A','only 2 lines','35¢ per minute','1 minute increments'); competitors[2] = new Competitor(7,'IDT','4¢','N/A','$2.00','$15 ','5¢','7¢','NO','NO','N/A','As many as you have','10¢ per minute','1 minute increments'); competitors[3] = new Competitor(2,'MCI','4¢ (12 month contract required)','N/A','$4.00 ','N/A','5¢','7¢','NO','NO','99¢','Total of 3 lines, must be at same address, $2 for each additional line','30¢ per minute','1 minute increments'); competitors[4] = new Competitor(5,'SBC','7¢','N/A','$2.95 ','N/A','5¢','7¢','NO','NO','$0','N/A','35¢ per minute','1 minute increments'); competitors[5] = new Competitor(3,'SPRINT','7¢','N/A','$3.00 ','N/A','7¢','8¢','NO','NO','$1.50','only 4 lines','59¢ per minute with  99¢ per call charge','1 minute increments'); competitors[6] = new Competitor(4,'VERIZON','5¢','N/A','$4.00 ','N/A','5¢','8¢','NO','NO','$0','up to 4 lines','10¢ per minute','1 minute increments');