var csIdTabLeftPrefixJq = '#'+csIdTabLeftPrefix;
var csIdTabMidPrefixJq = '#'+csIdTabMidPrefix;
var csIdTabRightPrefixJq = '#'+csIdTabRightPrefix;
var csIdTabLinkPrefixJq = '#'+csIdTabLinkPrefix;

var csTabDeselClass = 'navOff';
var csTabSelClass = 'navOn';

//var iCurrPanelIndex_g = 0;
var iCurrPanelIndexArr_g = new Array(0,0,0,0,0,0,0,0);

//NTH: Move into a class.
function showListPanel(siIdListPrefix, iiMenuIndex, iiPanelIndex){
   //Show the specified input form.
	jQuery("#" + siIdListPrefix + '_' + iiMenuIndex + '_'+ iiPanelIndex).slideDown("fast");
}

function hideListPanel(siIdListPrefix, iiMenuIndex, iiPanelIndex){
  //Hide the specified input form if success.
  jQuery("#" + siIdListPrefix + '_' + iiMenuIndex + '_'+ iiPanelIndex).slideUp("fast");
}

function deselectTab(iiMenuIndex, iiPanelIndex){
   jQuery(csIdTabLeftPrefixJq + '_' + iiMenuIndex + '_' + iiPanelIndex).attr("class", csTabDeselClass);
   jQuery(csIdTabMidPrefixJq + '_' + iiMenuIndex + '_' + iiPanelIndex).attr("class", csTabDeselClass); 
   jQuery(csIdTabRightPrefixJq + '_' + iiMenuIndex + '_' + iiPanelIndex).attr("class", csTabDeselClass); 
}

function selectTab(iiMenuIndex, iiPanelIndex){
   jQuery(csIdTabLeftPrefixJq + '_' + iiMenuIndex + '_' + iiPanelIndex).attr("class", csTabSelClass);
   jQuery(csIdTabMidPrefixJq + '_' + iiMenuIndex + '_' + iiPanelIndex).attr("class", csTabSelClass); 
   jQuery(csIdTabRightPrefixJq + '_' + iiMenuIndex + '_' + iiPanelIndex).attr("class", csTabSelClass);
}

function refreshListPanel(siIdListPrefix, iiMenuIndex, iiNewPanelIndex){   
   var i = 0;
   var bOnBeforeUnloadFuncPresent = false;   
         
   //Deselect all tab (we don't know what is the current selected tab.)
   //for (i = 0; i < iiTabCnt; i++){
   //   deselectTab(iiMenuIndex, i);
   //   hideListPanel(siIdListPrefix, iiMenuIndex, i);
   //}
   
   deselectTab(iiMenuIndex, iCurrPanelIndexArr_g[iiMenuIndex]);
   selectTab(iiMenuIndex, iiNewPanelIndex);   
   hideListPanel(siIdListPrefix, iiMenuIndex, iCurrPanelIndexArr_g[iiMenuIndex]);
   showListPanel(siIdListPrefix, iiMenuIndex, iiNewPanelIndex);
   iCurrPanelIndexArr_g[iiMenuIndex] = iiNewPanelIndex;
}
