﻿var gCurrentComboListObj       = null;
var gCurrentComboListBorderObj = null;
var gShowCombobox              = false;
//=============================================================================
function hideCombobox1(e) 
{
    //if(event.keyCode == 27) 
    //hideCombobox();	    
    if(isEscClicked(e)) 
    {
	    hideCombobox();
    }	    	    
}
//=============================================================================
function hideCombobox2() 
{
    if(gShowCombobox) 
    {
        gShowCombobox = false;
        return;
    }    
    hideCombobox();
}
//=============================================================================
function hideCombobox() 
{
	if(gCurrentComboListObj != null) 
	{
	    gCurrentComboListObj.style.display = "none";
	    gCurrentComboListObj.visibility    = 'hidden';
	    gCurrentComboListObj               = null;
	}		
	if(gCurrentComboListBorderObj != null) 
	{
	    gCurrentComboListBorderObj.style.display = "none";
	    gCurrentComboListBorderObj.visibility    = 'hidden';
         gCurrentComboListBorderObj               = null;
    }
}
//=============================================================================
function showCombobox(listObjName, listBorderObjName) 
{
    hideCombobox();

    gCurrentComboListObj = document.getElementById(listObjName);
    gCurrentComboListBorderObj = document.getElementById(listBorderObjName);
            
    gCurrentComboListObj.style.display       = "block";
    gCurrentComboListBorderObj.style.display = "block";
    
    gShowCombobox = true;
}
//=============================================================================
function onComboButtunOver(comboButton)
{
    comboButton.className = "combo_button_over";
}
//=============================================================================
function onComboButtunOut(comboButton)
{
    comboButton.className = "combo_button";
}
//=============================================================================
function onComboOptionOver(comboOption)
{
    comboOption.className = "option_over";
}
//=============================================================================
function onComboOptionOut(comboOption)
{
    comboOption.className = "option";
}
//=============================================================================
function selectComboOption(comboOption, comboboxObjName)
{
    document.getElementById(comboboxObjName).value = comboOption.innerHTML; 
    hideCombobox();
}
//=============================================================================