var countries = [];
countries["UnitedStates"] = 0;
countries["Canada"] = 1;
countries["Ecuador"] = 2;
countries["Peru"] = 3;
countries["Dominican"] = 4;			
countries["Mexico"] = 5;
countries["Brazil"] = 6;
countries["Nicaragua"] = 7;

var data = new Array();
data.push({country:"UnitedStates", carrier:"Sprint", product:"SprintTV Xtra", channels:[0,0,0,0,0,0,1,0,0,0,0,0,0,1,1,0,1,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,1,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,1,1,0,0,1,1,1,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0]});

data.push({country:"UnitedStates", carrier:"Sprint", product:"MobiTV", channels:[1,0,1,1,1,0,1,0,1,1,0,0,1,1,1,0,1,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,1,1,0,1,0,0,0,1,0,0,0,0,0,1,0,0,1,0,1,1,0,0,0,1,0,0,0,0,0,0,0,1,1,0,1,1,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,1,1,0,1,0,1,0,0,0,0,0,1,0,0,1,0,1,1,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,1,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,0,1,0,0,1,1,1,1,1,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,1]});

data.push({country:"UnitedStates", carrier:"Sprint", product:"SprintTV en Vivo", channels:[0,0,0,0,0,0,0,0,1,0,1,0,0,1,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,0]});



data.push({country:"UnitedStates", carrier:"AT&T", product:"MobiVJ", channels:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0]});



data.push({country:"UnitedStates", carrier:"AT&T", product:"MobiTV en Espanol", channels:[0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,1,0,0,0,1,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,1,1,0,0,1,0,0,0,0]});


//data.push({country:"UnitedStates", carrier:"AT&T PCTV", product:"ATT Broadband PCTV", channels:[0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,1,0,0,1,0,0,1,0,1,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,1,1,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,1,0,0,0,0,1,1,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0]});


data.push({country:"UnitedStates", carrier:"Alltel", product:"Alltel TV", channels:[1,0,1,1,1,0,0,0,1,1,0,1,1,1,1,0,1,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,1,0,0,0,1,0,0,0,0,0,1,0,0,1,0,1,1,0,0,0,1,0,0,1,0,0,0,0,1,1,0,1,1,0,0,0,0,1,0,1,1,0,0,0,0,0,0,0,0,1,1,0,1,0,1,0,0,0,0,0,0,0,0,1,0,1,1,0,0,0,0,0,0,0,0,0,1,1,1,0,1,1,1,0,1,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,0,0,1,1,1,1,1,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,1]});

data.push({country:"UnitedStates", carrier:"Alltel", product:"Alltel TV en Espanol", channels:[0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,1,0,0,0,1,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,1,1,0,0,1,0,0,0,0]});


data.push({country:"UnitedStates", carrier:"US Cellular", product:"MobiTV", channels:[1,0,1,1,1,0,0,0,1,1,0,0,1,1,1,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,1,0,0,0,1,0,0,0,0,0,1,0,0,1,0,1,1,0,0,0,1,0,0,1,0,0,0,0,1,1,0,1,1,0,0,0,0,1,0,1,1,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,1,1,0,0,0,0,0,0,0,0,0,1,1,1,0,1,1,1,0,1,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,0,0,1,1,1,1,1,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,1]});

data.push({country:"UnitedStates", carrier:"Cellular South", product:"MobiTV", channels:[1,0,1,1,1,0,0,0,1,1,0,0,1,1,1,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,1,0,0,0,1,0,0,0,0,0,1,0,0,1,0,1,1,0,0,0,1,0,0,1,0,0,0,0,1,1,0,1,1,0,0,0,0,1,0,1,1,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,1,1,0,0,0,0,0,0,0,0,0,1,1,1,0,1,1,1,0,1,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,0,0,1,1,1,1,1,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,1]});

data.push({country:"UnitedStates", carrier:"nTelos", product:"MobiTV", channels:[1,0,1,1,1,0,0,0,1,1,0,0,1,1,1,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,1,0,0,0,1,0,0,0,0,0,1,0,0,1,0,1,1,0,0,0,1,0,0,1,0,0,0,0,1,1,0,1,1,0,0,0,0,1,0,1,1,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,1,1,0,0,0,0,0,0,0,0,0,1,1,1,0,1,1,1,0,1,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,0,0,1,1,1,1,1,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,1]});

data.push({country:"UnitedStates", carrier:"Midwest Wireless", product:"MobiTV", channels:[1,0,1,1,1,0,0,0,1,1,0,0,1,1,1,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,1,0,0,0,1,0,0,0,0,0,1,0,0,1,0,1,1,0,0,0,1,0,0,1,0,0,0,0,1,1,0,1,1,0,0,0,0,1,0,1,1,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,1,1,0,0,0,0,0,0,0,0,0,1,1,1,0,1,1,1,0,1,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,0,0,1,1,1,1,1,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,1]});

data.push({country:"UnitedStates", carrier:"Palm Wifi", product:"MobiTV", channels:[1,0,1,1,1,0,0,0,1,0,0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,1,0,0,1,0,1,1,0,0,0.0,0,0,0,0,0,0,0,0,1,1,0,1,1,0,0,0,0,1,0,1,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,0,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,0,0,1,0,1,1,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1]});

data.push({country:"UnitedStates", carrier:"Verizon Puerto Rico", product:"MobiTV", channels:[0,0,0,0,0,0,0,0,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1,1,1,1,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,0,0,1,1,1,1,1,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,1]});

data.push({country:"UnitedStates", carrier:"WindowsMobile", product:"MobiTV", channels:[1,0,1,1,1,0,0,0,1,1,0,0,1,1,1,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,1,0,0,0,1,0,0,0,0,0,1,0,0,1,0,1,1,0,0,0,1,1,0,1,0,0,0,0,1,1,0,1,1,0,0,0,0,1,0,1,1,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,1,1,1,0,1,1,1,0,1,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,0,0,1,1,1,1,1,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,1]});

//data.push({country:"Canada", carrier:"Bell Mobility", product:"MobiTV", channels:[0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,1,0,0,00,,0,0,0,0,1,1,1,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0]});

data.push({country:"Canada", carrier:" Rogers Wireless", product:"MobiTV", channels:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0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0,0,0,0,0,0,0,0]});
data.push({country:"Peru", carrier:"Movistar ", product:"IdeasTV", channels:[0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]});
data.push({country:"Dominican", carrier:"America Movil DR", product:"MobiTV", channels:[0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]});
//data.push({country:"Mexico", carrier:"Telcel Mexico", product:"MobiTV", channels:[0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0]});
//data.push({country:"Brazil", carrier:"Claro", product:"IdeiasTV", channels:[0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]});
data.push({country:"Nicaragua", carrier:"Claro", product:"IdeasTV", channels:[0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]});


var channels = new Array();
channels.push("Parks and Recreation");
channels.push("Saterday Night LIve");
channels.push("Top Chef Las Vegas");
channels.push("NCIS: Los Angeles");
channels.push("ABC Mobile");
channels.push("A&E Brazil");
channels.push("A&E Mobile");
channels.push("A&E (Spanish)");
channels.push("ABC News");
channels.push("Access Hollywood");
channels.push("Accuweather");
channels.push("Alltel Racing Report");
channels.push("Accidentally on Purpose");
channels.push("Animal Planet");
channels.push("Anim8");
channels.push("As Not Seen on TV-gone");
channels.push("ATAKU");
channels.push("Atom Films");
channels.push("Azteca America");
channels.push("Back on Topps-gone");
channels.push("Barrio 305-gone");
channels.push("BBC World");
channels.push("BFF");
channels.push("Bite TV");
channels.push("Big Brother");
channels.push("Bloomberg Brazil");
channels.push("Bloomberg Latin America");
channels.push("Bloomberg Television-gone");
channels.push("Cartoon Nework LA");
channels.push("Bombones");
channels.push("Bravo");
channels.push("gone-old");
channels.push("Bravo's Top Chef Masters");
channels.push("Cartoon Network Brazil");
channels.push("Buzzwire-gone");
channels.push("CantoYo");
channels.push("CBC Newsworld");
channels.push("CBS Comedy");
channels.push("CBS News");
channels.push("CBS Sports");
channels.push("Channel12-The Alltel Racing");
channels.push("Chaos Extreme");
channels.push("CBS Mobile");
channels.push("Climatempo");
channels.push("Cine Mexicano");
channels.push("CNBC");
channels.push("CNET");
channels.push("CNN en Espa&ntilde;ol");
channels.push("CNN International Brazil");
channels.push("CNN International UK");
channels.push("Comedy Central");
channels.push("Comedy Time");
channels.push("Comedy Time Latino-gone");
channels.push("Comedy Time VOD");
channels.push("Commmunity");
channels.push("Crime and Investigation Network-gone");
channels.push("CSI:");
channels.push("CSI: Miami");
channels.push("C-SPAN-gone");
channels.push("C-SPAN2-gone");
channels.push("D40 Digital Camera-gone");
channels.push("Discovery");
channels.push("Discovery en Espa&ntilde;ol");
channels.push("Discovery Health-gone");
channels.push("Discovery Mobile");
channels.push("Discovery Movel-gone");
channels.push("Discovery Movil-gone");
channels.push("Discovery Science");
channels.push("Discovery Times");
channels.push("Disney Channel");
channels.push("Double Z Country");
channels.push("Ecuavisa");
channels.push("Entertainment Tonight");
channels.push("ESPN Mobile TV");
channels.push("ESPN Deportes");
channels.push("ESPN Movel-gone");
channels.push("ESPN Movil-gone");
channels.push("Extreme Sports");
channels.push("Fashion TV");
channels.push("Flashpoint-gone");
channels.push("FOX Business");
channels.push("FOX News");
channels.push("FOX Speed");
channels.push("Green Day");
channels.push("Harper's Island-gone");
channels.push("Friday Night Lights-gone");
channels.push("Fuel-gone");
channels.push("gone");
channels.push("G4TechTV-gone");
channels.push("Here!");
channels.push("Heroes");
channels.push("Holiday Classics");
channels.push("GameTrailers");
channels.push("Holiday Music Videos");
channels.push("iFilm Viral Videos-gone");
channels.push("Keri Hilson");
channels.push("ITN Headline News");
channels.push("ITN Weather");
channels.push("LOL-gone");
channels.push("Masters 2008-gone");
channels.push("MavTV");
channels.push("MAXX Look");
channels.push("MAXX Sports");
channels.push("M&eacute;t&eacute;o M&eacute;dia");
channels.push("Mobile by Bravo");
channels.push("Military Channel");
channels.push("MobiTV Promo");
channels.push("MSNBC");
channels.push("MTV");
channels.push("MTV Tr3s");
channels.push("Much More Retro");
channels.push("Much Music");
channels.push("Much Vibe");
channels.push("Mun2");
channels.push("MyOutdoorTV.com");
channels.push("NBC Comedy");
channels.push("NBC Mobile");
channels.push("NBC Mobile (Entertainment)");
channels.push("NBC News Mobile (MobiTV)");
channels.push("NBC Sports Mobile");
channels.push("NFL Network");
channels.push("NCIS");
channels.push("Oxygen (Oh!)");
channels.push("Pachanga Urbana");
channels.push("Pussycat Dolls");
channels.push("R&B Jamz");
channels.push("RDI");
channels.push("RetroVision Retro Comedy");
channels.push("RetroVision Vintage Kids");
channels.push("Ritmo Caliente");
channels.push("Syfy");
channels.push("Shake it");
channels.push("ShortBrain TV");
channels.push("Shopping Channel");
channels.push("ShortsTV Corto-gone");
channels.push("&iexcl;Sorpresa!");
channels.push("Sportsnet-gone");
channels.push("Showtime-gone");
channels.push("Sur");
channels.push("Telemundo");
channels.push("Telemundo Novelas");
channels.push("TELETOON");
channels.push("T&eacute;L&eacute;TOON");
channels.push("TELETOON (preschool)");
channels.push("T&eacute;L&eacute;TOON (pr&eacute;scolaire)");
channels.push("History Channel en espa&ntilde;ol-gone");
channels.push("History Channel LA");
channels.push("History");
channels.push("The Mic");
channels.push("The Mic Hip Hop");
channels.push("The Office");
channels.push("The Price is Right-gone");
channels.push("The Weather Channel");
channels.push("The Science Channel");
channels.push("The Weather Network");
channels.push("The Young and the Restless");
channels.push("TLC");
channels.push("ToonWorld TV Classics");
channels.push("Top Ten");
channels.push("Totally 80s-90s");
channels.push("Transformers Channel-gone");
channels.push("Treehouse-gone");
channels.push("Tutorial");
channels.push("Union");
channels.push("USA Mobile");
channels.push("USA Network");
channels.push("V40");
channels.push("V40 Top Hits");
channels.push("Ventaneando America");
channels.push("Bloomberg-gone");
channels.push("VH1");
channels.push("Video Rola");
channels.push("WWE Mobile Channel-gone");
channels.push("CNBC");
channels.push("Fox Business");
channels.push("Eco-pinion");
channels.push("The Street");
channels.push("30 Rock");


// now defined and set in the index.php container of this script
//var country = "UnitedStates";


function dataByCountry(c)
{
	var a = new Array();
	
	for ( var i=0; i<data.length; ++i )
	{
		if ( data[i].country == c )
		{
			a.push(data[i]);
		}
	}
	return a;
}

// helper to append items to an option list
function appendOption( option, data )
{
	option.options.length += 1;
	option.options[option.options.length-1].value = data;
	option.options[option.options.length-1].text = data;
}

function initData()
{
	var dataSet = dataByCountry(country);
	var products = new Array();
	var cs = document.forms['theForm'].carrier;
	// only add unique items to the list
	var ulist = [];
	// is this item already in the list
	var uf = function(key)
	{
		var exists = false;
		
		if ( ulist[key] )
		{
			exists = true;
		}
		else
		{
			ulist[key] = true;						
		}
		return exists;
	};
					
	cs.options.length = 0;
	
	// fill out the carrier select box
	for (var i = 0; i < dataSet.length; ++i) 
	{
		if (!uf(dataSet[i].carrier)) 
		{
			appendOption(cs, dataSet[i].carrier);
		}
	}
	
	var carrier = cs.options[0].value;
	cs = document.forms['theForm'].product;
	cs.options.length = 0;
	
	// fill out the products box
	for ( var i=0; i<dataSet.length; ++i )				
	{
		if ( dataSet[i].carrier == carrier )
		{
			appendOption(cs, dataSet[i].product);
		}
	}
	
	getChannels();
}

function getProducts(who)
{
	var dataSet = dataByCountry(country);
	var carrier = document.forms['theForm'].carrier.options[document.forms['theForm'].carrier.selectedIndex].value;
	
	var cs = document.forms['theForm'].product;
	cs.options.length = 0;
	
	// fill out the products box
	for ( var i=0; i<dataSet.length; ++i )				
	{
		if ( dataSet[i].carrier == carrier )
		{
			appendOption(cs, dataSet[i].product);
		}
	}
	
	getChannels();
}

function getChannels(who)
{
	//alert(who.options[who.selectedIndex].value);
	var dataSet = dataByCountry(country);
	var carrier = document.forms['theForm'].carrier.options[document.forms['theForm'].carrier.selectedIndex].value;
	var product = document.forms['theForm'].product.options[document.forms['theForm'].product.selectedIndex].value;
					
	for ( var i=0; i<dataSet.length; ++i )
	{
		if ( dataSet[i].carrier == carrier && dataSet[i].product == product )
		{
			//alert("channels: " + dataSet[i].channels);
			displayChannels(dataSet[i].channels);
		}
	}
}

function displayChannels(list)
{
	var output = document.getElementById("output");
	output.innerHTML = "";
	
	//alert(list.length == channels.length);
	for (var i=0; i<list.length; ++i)
	{
		if ( list[i] == 1 )
		{
			output.innerHTML += " <span class=channel>" + channels[i] + "</span> | ";
		}
		//output.innerHTML += " <span class=channel>" + channels[i] + "</span><br />";
	}
}

if (window.addEventListener) //DOM method for binding an event
{
	window.addEventListener("load", initData, false)
}
else if (window.attachEvent) //IE exclusive method for binding an event
{
	window.attachEvent("onload", initData)
}
else if (document.getElementById) //support older modern browsers
{
	window.onload = initData;
}