﻿// JScript File
function emptyList( box ) {
	// Set each option to null thus removing it
	//while ( box.options.length ) box.options[0] = null;
	box.options.length = 0;
}

// This function assigns new drop down options to the given
// drop down box from the list of lists specified

function fillList( box, arr , currentValue ) {

	option = new Option("Please Select","0");
	box.options[box.length] = option;

	var idx;

	for ( i = 0; i < arr.length; i++ ) {

		var opts = arr[i].split("=");

		// Create a new drop down option with the
		// display text and value from arr
		option = new Option( opts[1], opts[0] );
		idx = box.length;

		// Add to the end of the existing options
		box.options[idx] = option;

		if (currentValue == opts[0]) {
		  box.selectedIndex=idx;
		}
	}

	// Preselect option 0
	if (box.length > 0) {
	box.selectedIndex=0;
	}

}

// This function performs a drop down list option change by first
// emptying the existing option list and then assigning a new set

function changeList( box, list, currentValue ) {

	// Next empty the slave list
	emptyList( box );

	// Then assign the new list values
	fillList( box, list, currentValue );
}


// JScript File
function emptyListImages( box ) {
	// Set each option to null thus removing it
	//while ( box.options.length ) box.options[0] = null;
	box.options.length = 0;
}

// This function assigns new drop down options to the given
// drop down box from the list of lists specified

function fillListImages( box, arr , currentValue ) {

    var z=new dhtmlXComboFromSelect(box);
	z.addOption(arr);


}

// This function performs a drop down list option change by first
// emptying the existing option list and then assigning a new set

function changeListImages( box, list, currentValue ) {

	// Next empty the slave list
	emptyListImages( box );

	// Then assign the new list values
	fillListImages( box, list, currentValue );
}

