home *** CD-ROM | disk | FTP | other *** search
- var mili = 20;
- var maxInst = 9;
- var min = 180;
- var max = 660;
- var pas = 20;
- var i = 1;
- while(i <= maxInst)
- {
- this["d" + i].initY = this["d" + i]._y;
- i++;
- }
- var doTheDew = function(inst, calea)
- {
- calea.hideThe.cursor(true);
- txt = new String(inst);
- var excludedInst = Number(txt.slice(1));
- initYexcludedInst = calea["d" + excludedInst]._y;
- gata = true;
- if(calea["d" + excludedInst]._y > min)
- {
- calea["d" + excludedInst]._y += pas * -1;
- gata = false;
- }
- excludedInst++;
- var nextInst = excludedInst;
- initYnextInst = calea["d" + nextInst]._y;
- var j = nextInst;
- while(j <= maxInst)
- {
- if(calea["d" + nextInst]._y < max)
- {
- calea["d" + j]._y += pas * 1;
- gata = false;
- }
- j++;
- }
- if(gata)
- {
- clearInterval(intervalul);
- excludedInst--;
- calea["d" + excludedInst].play();
- calea.hideThe.cursor(false);
- }
- };
- var undoTheDew = function(inst, calea)
- {
- calea.hideThe.cursor(true);
- txt = new String(inst);
- var excludedInst = Number(txt.slice(1));
- initYexcludedInst = calea["d" + excludedInst].initY;
- gata = true;
- if(calea["d" + excludedInst]._y < initYexcludedInst)
- {
- calea["d" + excludedInst]._y += pas * 1;
- gata = false;
- }
- excludedInst++;
- var nextInst = excludedInst;
- initYnextInst = calea["d" + nextInst].initY;
- var j = nextInst;
- while(j <= maxInst)
- {
- if(calea["d" + nextInst]._y > initYnextInst)
- {
- calea["d" + j]._y += pas * -1;
- gata = false;
- }
- j++;
- }
- if(gata)
- {
- clearInterval(intervalul);
- excludedInst--;
- calea["d" + excludedInst].play();
- calea.hideThe.cursor(false);
- }
- };
- stop();
-