//###################################################################################################### FUNCTINOS ###
//# FUNCTIONS TO PERFORM VISUAL EFECTS
//--------------------------------------------------------------------------------------------------------------------
    //### DEFINING METHODS FOR FADING EFECT
    var oc = 0;

    function initFade(divObjName, step, method){
      if(dlgOptions.fx.fadeEnabled == true){
        method = (method != null ? method : 'linear');
        oc = 0;
        var str_debug = "";
        switch(method){
          case 'linear':{
            for(var i=0; i<Math.abs(100/step); i++){
              x = i; //str_debug += "x=" + x + ", y=" + step + ", y2-y1=" + (step+step - step) + "\n";
              setTimeout('changeOpacity('+document.getElementById(divObjName)+', '+step+')', (1000/Math.abs(100/step))*x);
            } //alert(str_debug);
            break;
          }
          case 'sin':{
            step = 1;
            for(var i=0; i<90; i++){
              x2 = ((Math.PI/2)/90) * (i+1);
              x1 = ((Math.PI/2)/90) * i; //str_debug += "x=" + x1 + ", sin(x)=" + Math.sin(x1) + ", sin(x2)-sin(x1)=" + (Math.sin(x2)-Math.sin(x1)) + "\n";
              setTimeout('changeOpacity('+document.getElementById(divObjName)+', '+100*(Math.sin(x2)-Math.sin(x1))+')', (1000/Math.abs(90/step))*i);
            } //alert(str_debug);
            break;
          }
          case 'x2':{
            var step = 0.2;
            var x = 0;
            var value = 0;
            for(var i=0; value<100; i++){
              x = x + step;
              value += 0.1*Math.pow(x, 2); //str_debug += "x=" + x + ", y=" + Math.pow(x, 2) + ", y2-y1=" + value + "\n";
              setTimeout('setOpacity('+document.getElementById(divObjName)+', '+ 0.1*(Math.pow(x, 2)) +')', (1000/i)*i);
            } //alert(str_debug + "\n" + i);
            break;
          }
        }
        return false;
      }
    }     

    function setOpacity(divObj, value){
      if(dlgOptions.display.opacityEnabled == true){
        if(value<0) value = 0;
        else if(value>100) value = 100;
        oc = value;
        divObj.style.opacity = oc/100;
        divObj.style.filter = 'alpha(opacity=' + oc + ')';
      }
    }

    function changeOpacity(step){
      if(dlgOptions.display.opacityEnabled == true){		
        if(((step<0)&&(oc+step<=0)) || ((step>0)&&(oc+step>100))){
          if(step<0){oc = 0; step = 0;}
          else{oc = 1; step = 0;}
        }
        oc += step;
  
        divObj.style.opacity = oc/100;
        divObj.style.filter = 'alpha(opacity=' + oc + ')';
      }
    }
