﻿// JavaScript Document


var CargoWeights = new Array();

CargoWeights[1] = new Array();

CargoWeights[1][0] = JSMessage_up_to +" 15.999";

CargoWeights[1][1] = "16.000-20.999";

CargoWeights[1][2] = "21.000-23.999";

CargoWeights[1][3] = "24.000 " + JSMessage_above;

CargoWeights[2] = new Array();

CargoWeights[2][0] = JSMessage_up_to +" 17.999";

CargoWeights[2][1] = "18.000-18.999";

CargoWeights[2][2] = "19.000-19.999";

CargoWeights[2][3] = "20.000-24.000";

CargoWeights[3] = new Array();

CargoWeights[3][0] = JSMessage_up_to +" 17.999";

CargoWeights[3][1] = "18.000-18.999";

CargoWeights[3][2] = "19.000-19.999";

CargoWeights[3][3] = "20.000-24.000";

var CargoWeightsValues = new Array();

CargoWeightsValues[1] = new Array();

CargoWeightsValues[1][0] = "15999";

CargoWeightsValues[1][1] = "20999";

CargoWeightsValues[1][2] = "23999";

CargoWeightsValues[1][3] = "24000";

CargoWeightsValues[2] = new Array();

CargoWeightsValues[2][0] = "17999";

CargoWeightsValues[2][1] = "18999";

CargoWeightsValues[2][2] = "19999";

CargoWeightsValues[2][3] = "24000";

CargoWeightsValues[3] = new Array();

CargoWeightsValues[3][0] = "17999";

CargoWeightsValues[3][1] = "18999";

CargoWeightsValues[3][2] = "19999";

CargoWeightsValues[3][3] = "24000";

function DropDownFillOptions(id, _options, sObj, selected) {

var obj = document.getElementById(id);

var containerType = sObj.options[sObj.selectedIndex].value;

if (typeof selected == 'undefined') selected = false;

if (obj.options[obj.selectedIndex].text != "") {

DropDownDropOptions(obj);

if (_options!=null && _options.length>0) {

var optionElement = null;

for (var i in _options) {

optionElement = document.createElement("option");

optionElement.text = _options[i];

optionElement.value = CargoWeightsValues[containerType][i];

if (selected != false && CargoWeightsValues[containerType][i]==selected) {

optionElement.selected = true;

}

try {

obj.add(optionElement, null);

} catch(ex) {

obj.add(optionElement);

}

}

}

} else {

DropDownDropOptions(obj);

}

}

function SetContainerType(containerType, selected) {

var id = "w_container";

var _options = CargoWeights[containerType];

var sObj = document.getElementById('container_type');

DropDownFillOptions(id, _options, sObj, selected);

}

function DropDownDropOptions(obj) {

if (obj.options.length>0) {

for (optIndex=obj.options.length; optIndex>=0; optIndex--) {

obj.remove(optIndex);

}

var emptyOption = document.createElement("option");

emptyOption.value = "";

emptyOption.text = "-Select-";

try {

obj.add(emptyOption,null);

} catch(ex) {

obj.add(emptyOption);

}

}

}




