//var lbox_on=0;
//var inlbox=0;
//var dbox_on=0;
//var indbox=0;
//var gbox_on=0;
//var ingbox=0;

//log object of priority debug and the popup logger
//var log = new Log(Log.DEBUG, Log.popupLogger);

function panel(id) {
    this.id = id;
    this.mouseOverInd = 0;
    this.effectsRunningInd = 0;

    this.show = function (panelElement) {
//        log.debug('SHOW: '+this.id+' effectsRunningInd ='+this.effectsRunningInd);
  	    this.mouseOverInd = 1;
        if (this.effectsRunningInd == 1)
            return;
        this.effectsRunningInd = 1;
//        log.debug('zapatecSHOW: '+this.id);
        this.growPanel(panelElement);
        var pObj = this; // save "this" object pointer for the onFinish() function below
        Zapatec.Effects.show(this.id,
                             9,
                             'slideBottom',
                             function() {
                               pObj.effectsRunningInd = 0;
                               // here is where we check to see if they "moused out" the <DIV> while we were showing it
                               if (pObj.mouseOverInd == 0) {
//                                 log.debug('zapatecSHOWFinish: '+pObj.id + '  pObj.mouseOverInd=' + pObj.mouseOverInd);
                                 pObj.hide(panelElement);
                               }
                             });
    };

    this.hide = function (panelElement) {
//        log.debug('HIDE: '+this.id+' effectsRunningInd ='+this.effectsRunningInd);
        this.mouseOverInd = 0;
        if (this.effectsRunningInd == 1)
            return;
        this.effectsRunningInd = 1;
//        log.debug('zapatecHIDE: '+this.id);
        var pObj = this; // save "this" object pointer for the onFinish() function below
        Zapatec.Effects.hide(this.id,
                             9,
                             'slideBottom',
                             function() {
                               pObj.shrinkPanel(panelElement);
                               pObj.effectsRunningInd = 0;
                               // here is where we check to see if they "moused over" the <DIV>
                               if (pObj.mouseOverInd == 1) {
//                                 log.debug('zapatecHIDEFinish: '+pObj.id + '  pObj.mouseOverInd=' + pObj.mouseOverInd);
                                 pObj.show(panelElement);
                               }
                             });
    };
    
    // this will grow the <DIV> panel and image inside it
    this.growPanel = function (panelElement) {
        panelElement.style.height = '405px';
        var imageElements = panelElement.getElementsByTagName("img");
        imageElements[0].style.height = '405px';    // there is only one child <IMG>...    
        panelElement.style.top = '0px';
    };
    
    // this will shrink the <DIV> panel and image inside it
    this.shrinkPanel = function (panelElement) {
        panelElement.style.height = '45px';
        var imageElements = panelElement.getElementsByTagName("img");
        imageElements[0].style.height = '45px';    // there is only one child <IMG>...    
		panelElement.style.top = '360px';
    };
}




//function lbox(action){
// var a=2;
//
// if(action=='out' && !inlbox && lbox_on) {
//  a=0;
//  lbox_on=0;
//  inlbox=0;
// }
//
// if(action=='over') {
//  inlbox=0;
//  if(!inlbox && !lbox_on){
//   lbox_on=1;
//   a=1;
//  }
// }
//
// if(action=='outbox' && lbox_on && inlbox) {
//  a=0;
//  lbox_on=0;
//  inlbox=0;
// }
//
// if(action=='overbox') {
//  inlbox=1;
//  lbox_on=1;
// }
//
// if(a==0){ Zapatec.Effects.hide('lBox', 9, 'slideBottom'); }
// if(a==1){ Zapatec.Effects.show('lBox', 9, 'slideBottom'); }
//}
//
//function dbox(action){
// var a=2;
//
// if(action=='out' && !indbox && dbox_on) {
//  a=0;
//  dbox_on=0;
//  indbox=0;
// }
//
// if(action=='over') {
//  indbox=0;
//  if(!indbox && !dbox_on){
//   dbox_on=1;
//   a=1;
//  }
// }
//
// if(action=='outbox' && dbox_on && indbox) {
//  a=0;
//  dbox_on=0;
//  indbox=0;
// }
//
// if(action=='overbox') {
//  indbox=1;
//  dbox_on=1;
// }
//
// if(a==0){ Zapatec.Effects.hide('dBox', 9, 'slideBottom'); }
// if(a==1){ Zapatec.Effects.show('dBox', 9, 'slideBottom'); }
//}
//
//function gbox(action){
// var a=2;
//
// if(action=='out' && !ingbox && gbox_on) {
//  a=0;
//  gbox_on=0;
//  ingbox=0;
// }
//
// if(action=='over') {
//  ingbox=0;
//  if(!ingbox && !gbox_on){
//   gbox_on=1;
//   a=1;
//  }
// }
//
// if(action=='outbox' && gbox_on && ingbox) {
//  a=0;
//  gbox_on=0;
//  ingbox=0;
// }
//
// if(action=='overbox') {
//  ingbox=1;
//  gbox_on=1;
// }
//
// if(a==0){ Zapatec.Effects.hide('gBox', 9, 'slideBottom'); }
// if(a==1){ Zapatec.Effects.show('gBox', 9, 'slideBottom'); }
//}