/* 
 * JavaScript functions used by list.php
 */


/**
 * Select maps in the list, whose key is in the keyArr, that is active drawn frames
 */
function selectMaps( keyArr ) {
  for( var i=0 ; i<keyArr.length ; i++ ) {
    //alert( "sel" + keyArr[i] ) ;
    document.getElementById( "sel" + String(keyArr[i]) ).checked = true ;
  }
} // selectMaps

/**
 * Select all maps in the list including activating the Google Map frame.
 */
function selectAllInLst() {
  for (var i = 0; i < document.lstCharts.length ; i++ )
    if( (document.lstCharts.elements[i].id.indexOf("sel") == 0)
        && (! document.lstCharts.elements[i].checked) )
      document.lstCharts.elements[i].click() ;
} // selectAllInLst

function prepareAll() {
  if (parent.mapFrame.getMapKeys) {
    selectMaps( parent.mapFrame.getMapKeys() );
  } else {
    setTimeout('prepareAll()',500);
  }
}
