Combo box population

Hello,

I found two scripts on this forum that have grate functionally. The thing is that I need the functionally from both scripts in one script. The first script that I found links three combo boxes together, that is I mean the first cb populates the second and the second populates the third. The other script uses a php array to dynamically populate a combo box. Here is where I get stuck when trying to merge these two scripts. The first cb gets populate by the external php file. So how can the second cb be populated by the first cb, when an external php file populates the first cb? The two scripts to which I am referring to are below.

//In this script cb 2 is populated by cb1 and cb 3 is populated by cb 2///

Types = [“Type1”, “Type2”, “Type3”];

Type1 = [“Theme1”, “Theme2”];
Type2 = [“Theme3”, “Theme4”];
Type3 = [“Theme5”, “Theme6”];

Theme1 = [“Color1”, “Color2”];
Theme2 = [“Color3”, “Color4”];
Theme3 = [“Color5”, “Color6”];
Theme4 = [“Color7”, “Color8”];
Theme5 = [“Color9”, “Color10”];
Theme6 = [“Color11”, “Color12”];

myTypes.setDataProvider(Types);
myThemes.setDataProvider(Type1);
myColors.setDataProvider(Theme1);
listener = {};
listener.ref = this;
listener.change = function(evt) {
var choice = evt.target.selectedItem;
myThemes.setDataProvider(this.ref[choice]);
myThemes.dispatchEvent({type:“change”});
};
myTypes.addEventListener(“change”, listener);
listener = {};
listener.ref = this;
listener.change = function(evt) {
var choice = evt.target.selectedItem;
myColors.setDataProvider(this.ref[choice]);
};
myThemes.addEventListener(“change”, listener);

/////The script below populates a combo box from an external php file/////

var links = new LoadVars();
links.onLoad = function(success) {
if (success) {
var items = parseFloat(this.NumItems);
for (var i = 0; i<items; i++) {
dropDown.addItem(this[“Name”+i], this[“DataRow”+i]);
}
}
};
links.load(“http://file/ComboBox_PHP_Link.php”);
//
var listener = {};
listener.change = function(event_obj) {
var url = event_obj.target.selectedItem.data
getURL(url, “_blank”);
};
dropDown.addEventListener(“change”, listener);

////below is the php code for the script above/////

<?php
$NameArr = array(“Flash-db.com”, “FlashKit”, “PHP.net”,“MySQL”,“Flash Magazine”, “CNN”);
$DataArr = array(“http://www.flash-db.com”, “http://www.flashkit.com”, “http://www.php.net”, “http://www.mysql.com”,“http://www.flashmagazine.com”, “http://www.cnn.com”);

$numReturn = count($NameArr);
$i = 0;
print “&”;

while ($i < $numReturn) {
$Name = $NameArr[$i];
$DataRow = $DataArr[$i];

print “Name$i=$Name&DataRow$i=$DataRow&”;
$i++;
}
print “&NumItems=$numReturn&Go=Yes&”;
?>