function mizSetVisibility(id, value) {
 var obj = document.getElementById(id).style;
 obj.visibility = value;
 var arr = qstr.split("&");
}
function mizSetOpacity(id, opacity) { 
 var obj = document.getElementById(id).style;
 obj.filter = "alpha(opacity=" + opacity + ")";
 obj.KhtmlOpacity = (opacity / 100);
 obj.MozOpacity = (opacity / 100);
 obj.opacity = (opacity / 100);
}

function mizEffect(func, id) {
 // func = mizFade;
 return function() {
  return func(id);
 }
}

function mizFade(id, frms) {
 if (id == undefined) return false;
 this.currentFrm = (frms != undefined) ? Number(frms) : 0;
 this.self = this;
 this.id = String(id);
 this.totalFrms = 8;
 this.progress = null;
 this.timer = null;
 this.progress = getProgress(this.currentFrm, this.totalFrms);

 this.opacityFrom = 0;
 this.opacityAbsTo = 100;
 this.opacityRelTo = getRelValue(opacityFrom,opacityAbsTo);
 this.opacity = this.opacityFrom + Math.floor(this.opacityRelTo * this.progress / 100)
 // document.forms['debug'].elements[0].value = this.opacityRelTo + ", " + this.opacity + ", " + this.progress + "\n" + document.forms['debug'].elements[0].value;
 mizSetOpacity(this.id, this.opacity);

 if (this.currentFrm < this.totalFrms) {
  this.currentFrm++;
  this.timer = gotoAndPlay(this.currentFrm);
 }

 function getRelValue(from,to) {
  from = Number(from);
  to =  Number(to);
  return (to-from);
 }
 
 function getProgress(current,total) {
  current = Number(current);
  total =  Number(total);
  // return Math.floor(current / total * 100);
  return Math.floor(current / total * 100);
 }
 function play() {
  return setTimeout("mizFade('"+this.id+"',"+this.currentFrms+")", 16);
 }
 function gotoAndPlay(frm) {
  frm = Number(frm);
  frm = (frm < 0) ? 0 : (frm > this.totalFrms) ? this.totalFrms : frm;
  this.currentFrms = frm;
  return setTimeout("mizFade('"+this.id+"',"+this.currentFrm+")", 16);
 }
}

function Miz_Environment() {
 var doc = document;
 doc.ev = {
  "mouseX" : null,
  "mouseY" : null
 }
 doc.onmousemove = function (evt) {
  this.MizGetMouseInfo(evt);
 }
 doc.MizGetMouseInfo = function (evt) {
  if (doc.all) { // for IE
   this.ev['mouseX'] = event.x;
   this.ev['mouseY'] = event.y;
  } else {
   this.ev['mouseX'] = evt.pageX;
   this.ev['mouseY'] = evt.pageY;
  }
 }
 // end: mizGetMouseCursor

 Miz_Environment.prototype.mouseX = function () { return doc.ev['mouseX']; }
 Miz_Environment.prototype.mouseY = function () { return doc.ev['mouseY']; }
}


var mE = new Miz_Environment();
