/*#################################################################################################
   + Create Button Parameter Type
   - Arguments  : 
   - Return     : 
   - Usage      : 
   - Content    : 
#################################################################################################*/
   var go_ButtonParameter = new Object();
       go_ButtonParameter.sButtonContainer = new String();       // Button Container Object [Name Or Id       ]
       go_ButtonParameter.sButtonText      = new String();       // Button Label            [Interface String ]
       go_ButtonParameter.sButtonArrow     = new String();       // Button DownArrow        [Arrow (Y, N, )   ]
       go_ButtonParameter.sButtonTitle     = new String();       // Button Title            [ToolTip          ]
       go_ButtonParameter.sButtonName      = new String();       // Button Object Name      [Button Name      ]
       go_ButtonParameter.sButtonMode      = new String();       // Button Mode             [Type (1, 2, ...) ]
       go_ButtonParameter.sButtonWidth     = new String();       // Button Width            [Button Width     ]
       go_ButtonParameter.sButtonFunction  = new String();       // Button Event            [Function         ]
       
   var gs_ButtonArrowImagePath = new String("/_images/icon_downarrow.gif");
/*#################################################################################################
   + Create Button Type
   - Arguments  : 
   - Return     : 
   - Usage      : 
   - Content    : 
#################################################################################################*/
   var go_ButtonType = new Object();
       go_ButtonType.sImgButtonMode            = new String();
       go_ButtonType.sImgButtonNormalClassName = new String();
       go_ButtonType.sImgButtonOverClassName   = new String();
       go_ButtonType.sImgButtonDownClassName   = new String();
       go_ButtonType.sImgButtonDownLeft        = new String();
       go_ButtonType.sImgButtonDownRight       = new String();
       go_ButtonType.sImgButtonOverLeft        = new String();
       go_ButtonType.sImgButtonOverRight       = new String();
       go_ButtonType.sImgButtonNormalLeft      = new String();
       go_ButtonType.sImgButtonNormalRight     = new String();
       
   var ga_ButtonMode = new Array();
       ga_ButtonMode.push([go_ButtonType]);
       ga_ButtonMode[ga_ButtonMode.length - 1].sImgButtonMode            = "1";
       ga_ButtonMode[ga_ButtonMode.length - 1].sImgButtonNormalClassName = "SetButtonOut1";
       ga_ButtonMode[ga_ButtonMode.length - 1].sImgButtonOverClassName   = "SetButtonOver1";
       ga_ButtonMode[ga_ButtonMode.length - 1].sImgButtonDownClassName   = "SetButtonDown1";
       ga_ButtonMode[ga_ButtonMode.length - 1].sImgButtonDownLeft        = "/_images/btn1_down_left.gif";
       ga_ButtonMode[ga_ButtonMode.length - 1].sImgButtonDownRight       = "/_images/btn1_down_right.gif";
       ga_ButtonMode[ga_ButtonMode.length - 1].sImgButtonOverLeft        = "/_images/btn1_over_left.gif";
       ga_ButtonMode[ga_ButtonMode.length - 1].sImgButtonOverRight       = "/_images/btn1_over_right.gif";
       ga_ButtonMode[ga_ButtonMode.length - 1].sImgButtonNormalLeft      = "/_images/btn1_normal_left.gif";
       ga_ButtonMode[ga_ButtonMode.length - 1].sImgButtonNormalRight     = "/_images/btn1_normal_right.gif";
            
       ga_ButtonMode.push([go_ButtonType]);
       ga_ButtonMode[ga_ButtonMode.length - 1].sImgButtonMode            = "2";
       ga_ButtonMode[ga_ButtonMode.length - 1].sImgButtonNormalClassName = "SetButtonOut2";
       ga_ButtonMode[ga_ButtonMode.length - 1].sImgButtonOverClassName   = "SetButtonOver2";
       ga_ButtonMode[ga_ButtonMode.length - 1].sImgButtonDownClassName   = "SetButtonDown2";
       ga_ButtonMode[ga_ButtonMode.length - 1].sImgButtonDownLeft        = "/_images/btn2_down_left.gif";
       ga_ButtonMode[ga_ButtonMode.length - 1].sImgButtonDownRight       = "/_images/btn2_down_right.gif";
       ga_ButtonMode[ga_ButtonMode.length - 1].sImgButtonOverLeft        = "/_images/btn2_over_left.gif";
       ga_ButtonMode[ga_ButtonMode.length - 1].sImgButtonOverRight       = "/_images/btn2_over_right.gif";
       ga_ButtonMode[ga_ButtonMode.length - 1].sImgButtonNormalLeft      = "/_images/btn2_normal_left.gif";
       ga_ButtonMode[ga_ButtonMode.length - 1].sImgButtonNormalRight     = "/_images/btn2_normal_right.gif";
       
/*#################################################################################################
   + Local 변수
   - Arguments  : 
   - Return     : 
   - Usage      : 
   - Content    :
#################################################################################################*/
   var li_MouseDownEnabled = 1;
   var li_MouseOverEnabled = 0;
/*#################################################################################################
   + gfnButtonSetOver()
   - Arguments  : 
   - Return     : 
   - Usage      : 
   - Content    :
#################################################################################################*/
   function gfnButtonSetOver(sButtonObjName,iMode, obj)
   {
      try{
         var sMode       = new String(iMode);
         var bModeExists = new Boolean(false);
         var sImgLeft    = new String("");
         var sImgRight   = new String("");
         var sImgClass   = new String("");
         if (li_MouseOverEnabled==0){return;}

         var iIndex = gfnGetIndex(obj);
//         var iIndex = gfnGetIndex(event.srcElement.parentNode.parentNode.parentNode);
         for(var i=0;i<ga_ButtonMode.length;i++){
            if(sMode.toLowerCase() == ga_ButtonMode[i].sImgButtonMode.toLowerCase()){
               sImgClass   = ga_ButtonMode[i].sImgButtonOverClassName;
               sImgLeft    = ga_ButtonMode[i].sImgButtonOverLeft;
               sImgRight   = ga_ButtonMode[i].sImgButtonOverRight;
               bModeExists = true;
               break;
            }
         }
         if(bModeExists == true){
            var oButtonLt, oButtonRt, oButton;
            if(iIndex == null){
               oButtonLt = document.getElementById(sButtonObjName+"_left");
               oButtonRt = document.getElementById(sButtonObjName+"_right");
               oButton   = document.getElementById(sButtonObjName+"_center");
            }else{
               oButtonLt = (gs_BrowserType == "M") ? document.all[sButtonObjName+"_left"][iIndex] : gfnGetElementsById(sButtonObjName+"_left")[iIndex];
               oButtonRt = (gs_BrowserType == "M") ? document.all[sButtonObjName+"_right"][iIndex]: gfnGetElementsById(sButtonObjName+"_right")[iIndex];
               oButton   = (gs_BrowserType == "M") ? document.all[sButtonObjName+"_center"][iIndex] : gfnGetElementsById(sButtonObjName+"_center")[iIndex];
            }
            oButtonLt.src  = sImgLeft;
            oButtonRt.src = sImgRight;
            oButton.className = sImgClass;
         }
      }catch(e){
         gfnMsg(e, "gfnButtonSetOver");
      }
   }

/*#################################################################################################
   + gfnButtonSetDown()
   - Arguments  : 
   - Return     : 
   - Usage      : 
   - Content    :
#################################################################################################*/
   function gfnButtonSetDown(sButtonObjName,iMode, obj)
   {
      try{
         var sMode       = new String(iMode);
         var bModeExists = new Boolean(false);
         var sImgLeft    = new String("");
         var sImgRight   = new String("");
         var sImgClass   = new String("");
         if (li_MouseDownEnabled==0){return;}
         var iIndex = gfnGetIndex(obj);
//         var iIndex = gfnGetIndex(event.srcElement.parentNode.parentNode.parentNode);

         for(var i=0;i<ga_ButtonMode.length;i++){
            if(sMode.toLowerCase() == ga_ButtonMode[i].sImgButtonMode.toLowerCase()){
               sImgClass   = ga_ButtonMode[i].sImgButtonDownClassName;
               sImgLeft    = ga_ButtonMode[i].sImgButtonDownLeft;
               sImgRight   = ga_ButtonMode[i].sImgButtonDownRight;
               bModeExists = true;
               break;
            }
         }

         if(bModeExists == true){
            var oButtonLt, oButtonRt, oButton;
            if(iIndex == null){
               oButtonLt = document.getElementById(sButtonObjName+"_left");
               oButtonRt = document.getElementById(sButtonObjName+"_right");
               oButton   = document.getElementById(sButtonObjName+"_center");
            }else{
               oButtonLt = (gs_BrowserType == "M") ? document.all[sButtonObjName+"_left"][iIndex] : gfnGetElementsById(sButtonObjName+"_left")[iIndex];
               oButtonRt = (gs_BrowserType == "M") ? document.all[sButtonObjName+"_right"][iIndex]: gfnGetElementsById(sButtonObjName+"_right")[iIndex];
               oButton   = (gs_BrowserType == "M") ? document.all[sButtonObjName+"_center"][iIndex] : gfnGetElementsById(sButtonObjName+"_center")[iIndex];
            }
            oButtonLt.src  = sImgLeft;
            oButtonRt.src = sImgRight;
            oButton.className = sImgClass;
         }
         li_MouseOverEnabled = 0;
      }catch(e){
         gfnMsg(e, "gfnButtonSetDown");
      }
   }
/*#################################################################################################
   + gfnButtonSetOut()
   - Arguments  : 
   - Return     : 
   - Usage      : 
   - Content    :
#################################################################################################*/
   function gfnButtonSetOut(sButtonObjName,iMode, obj)
   {
      try{
         var sMode       = new String(iMode);
         var bModeExists = new Boolean(false);
         var sImgLeft    = new String("");
         var sImgRight   = new String("");
         var sImgClass   = new String("");
    
         var iIndex = gfnGetIndex(obj);
//alert(iIndex);
//         var iIndex = gfnGetIndex(event.srcElement.parentNode.parentNode.parentNode);
         var oButton;
         if(iIndex == null)
            oButton = document.getElementById(sButtonObjName+"_center");
         else 
            oButton = (gs_BrowserType == "M") ? document.all[sButtonObjName+"_center"][iIndex] : gfnGetElementsById(sButtonObjName+"_center")[iIndex];
/*
var oButton = document.all[sButtonObjName+"_center"];
alert(oButton.className);
*/

         for(var i=0;i<ga_ButtonMode.length;i++){
             if(sMode.toLowerCase() == ga_ButtonMode[i].sImgButtonMode.toLowerCase()){
               sImgClass   = ga_ButtonMode[i].sImgButtonNormalClassName;
               sImgLeft    = ga_ButtonMode[i].sImgButtonNormalLeft;
               sImgRight   = ga_ButtonMode[i].sImgButtonNormalRight;

               if (((li_MouseDownEnabled==1) && (oButton.className==ga_ButtonMode[i].sImgButtonDownClassName)) ||
                   ((li_MouseOverEnabled==1) && (oButton.className==ga_ButtonMode[i].sImgButtonOverClassName)))
               {
                  sImgClass   = ga_ButtonMode[i].sImgButtonNormalClassName;
                  bModeExists = true;
               }
               break;
            }
         }

         if (bModeExists == true){
            var oButtonLt, oButtonRt;
            if(iIndex == null){
               oButtonLt = document.getElementById(sButtonObjName+"_left");
               oButtonRt = document.getElementById(sButtonObjName+"_right");
            }else{
               oButtonLt = (gs_BrowserType == "M") ? document.all[sButtonObjName+"_left"][iIndex] : gfnGetElementsById(sButtonObjName+"_left")[iIndex];
               oButtonRt = (gs_BrowserType == "M") ? document.all[sButtonObjName+"_right"][iIndex]: gfnGetElementsById(sButtonObjName+"_right")[iIndex];
            }
            oButtonLt.src  = sImgLeft;
            oButtonRt.src = sImgRight;
            oButton.className = sImgClass;
         }
         //li_MouseOverEnabled = 1;
      }catch(e){
         gfnMsg(e, "gfnButtonSetOut");
      }
   }
