var ie;
if (document.all)
	ie = true;
else
	ie = false;

function addCountry(){
  var opts = document.country_chooser.country_select.options;
  var sel = document.country_chooser.country_select.selectedIndex;
	
	if (opts.item(sel).value == "select")
		return;
		
	if (ie) {
		var new_opt = document.createElement("option");
		new_opt.text = opts.item(sel).text;
		new_opt.value = opts.item(sel).value;
		document.country_chooser.country_list.options.add(new_opt);
	}
	else {
		var optText = opts.item(sel).text;
		var optValue = opts.item(sel).value;
		var len = document.country_chooser.country_list.options.length;
		document.country_chooser.country_list.options[len] = new Option(optText, optValue, false, false);
	}
	
	document.country_chooser.country_select.selectedIndex = -1;
	document.country_chooser.add.disabled = true;
}

function removeCountry(){
  var opts = document.country_chooser.country_list.options;
  var sel = document.country_chooser.country_list.selectedIndex;
  
  if (checkIsSatellite(opts.item(sel).value) == true){
	numSat--;
	if (numSat == 0)
		rentSatellite = false;
  }
 
  if (ie)
    opts.remove(sel);
  else
    opts[sel] = null;
  document.country_chooser.remove.disabled = true;
}

function clearCountry(){
  var opts = document.country_chooser.country_list.options;
  var num = document.country_chooser.country_list.options.length;
  if (num > 0){ 
    for (i = 0; i < num; i++){
      if (ie)
        opts.remove(0);
      else
        opts[0] = null;
	  }
    }
}

function showAdd(){
  if (document.country_chooser.country_select.value == 0)
    document.country_chooser.add.disabled = true;
  else
    document.country_chooser.add.disabled = false;
}
function showRemove(){
  if (document.country_chooser.country_select.value == "select")
    document.country_chooser.remove.disabled = true;
  else
    document.country_chooser.remove.disabled = false;
}

function showItinerary(si){
if (si.length == 0) return;
var countries = document.country_chooser.country_list.options;
var asi = new Array();
asi = si.split(",");
var no;
for (var i = 0; i < asi.length; i++){
  if (ie){
	no = document.createElement("OPTION");
	no.text = asi[i];
	no.value = asi[i];
	countries.add(no, i);
	}
  else{
    no = new Option(asi[i], asi[i], false, false);
	countries[i] = no;
	}
  }
}
//