home *** CD-ROM | disk | FTP | other *** search
/ PC World 2002 April / PCWorld_2002-04_cd.bin / Software / Komercni / abra / html / ceniky / CSScriptLib.js < prev    next >
Encoding:
JavaScript  |  2001-10-29  |  44.3 KB  |  1,363 lines

  1. // -- Adobe GoLive JavaScript Library
  2. // -- Global Functions
  3. CSAg = window.navigator.userAgent; CSBVers = parseInt(CSAg.charAt(CSAg.indexOf("/")+1),10);
  4. function IsIE() { return CSAg.indexOf("MSIE") > 0;}
  5. function CSIEStyl(s) { return document.all.tags("div")[s].style; }
  6. function CSNSStyl(s) { return CSFindElement(s,0); }
  7. function CSFindElement(n,ly) { if (CSBVers < 4) return document[n];
  8.     var curDoc = ly ? ly.document : document; var elem = curDoc[n];
  9.     if (!elem) { for (var i=0;i<curDoc.layers.length;i++) {
  10.         elem = CSFindElement(n,curDoc.layers[i]); if (elem) return elem; }}
  11.     return elem;
  12. }
  13. function CSSetStylePos(s,d,p) { if (IsIE()) { if (d == 0) CSIEStyl(s).posLeft = p; else CSIEStyl(s).posTop = p; }
  14.     else { if (d == 0) CSNSStyl(s).left = p; else CSNSStyl(s).top = p; } }
  15. function CSGetStylePos(s,d) { if (IsIE()) { if (d == 0) return CSIEStyl(s).posLeft; else return CSIEStyl(s).posTop; }
  16.     else { if (d == 0) return CSNSStyl(s).left; else return CSNSStyl(s).top; }}
  17. CSLoopIsRunning = false; CSFctArray = new Array; CSTimeoutID = null;
  18. function CSLoop() {    
  19.     CSLoopIsRunning = false;
  20.     for (i=0;i<CSFctArray.length;i++) {
  21.         var curFct = CSFctArray[i];
  22.         if (curFct)    {
  23.             if (curFct.DoFunction(curFct)) { CSLoopIsRunning = true; curFct.counter++; }
  24.             else CSFctArray[i] = 0;
  25.         }
  26.     }
  27.     if (CSLoopIsRunning) CSTimeoutID = setTimeout("CSLoop()", 1);
  28. }
  29. function CSStartFunction(fct,data) {
  30.     if (!CSLoopIsRunning) { CSFctArray = 0; CSFctArray = new Array; }
  31.     var fctInfo = new Object;
  32.     fctInfo.DoFunction = fct; fctInfo.counter = 0; fctInfo.data = data;
  33.     CSFctArray[CSFctArray.length] = fctInfo; 
  34.     if (!CSLoopIsRunning) CSLoop();
  35. }
  36. function CSStopFunction(sceneName) {
  37.     var i;
  38.     for (i=0;i<CSFctArray.length;i++) {
  39.         var curFct = CSFctArray[i];
  40.         if (curFct){ if (curFct.data.name == sceneName){ CSFctArray[i] = 0; return; } }
  41.     }
  42. }
  43. function CSStopComplete() {
  44.     if (CSTimeoutID == null) return;
  45.     clearTimeout (CSTimeoutID); CSLoopIsRunning = false; CSTimeoutID = null;
  46. }
  47. function CSMoveLoop(fInf) {
  48.     var ticks = 60 * (((new Date()).getTime()) - fInf.data.startTime)/1000;
  49.     var f = ticks/fInf.data.ticks;
  50.     if (f < 1) { CSSetStylePos(fInf.data.layer,0,fInf.data.start[0] * (1-f) + fInf.data.end[0] * f);
  51.         CSSetStylePos(fInf.data.layer,1,fInf.data.start[1] * (1-f) + fInf.data.end[1] * f); return true; }
  52.     else { CSSetStylePos(fInf.data.layer,0,fInf.data.end[0]);
  53.         CSSetStylePos(fInf.data.layer,1,fInf.data.end[1]); }
  54.     return false;
  55. }
  56. function CSSlideObj (layer,start,end,ticks,startTime) {
  57.     this.layer=layer;this.start=start;this.end=end;this.ticks=ticks;this.startTime=startTime;
  58. }
  59. function CSSlideLayer(l,pos,anim,ticks) {
  60.     var x = pos[0]; var y = pos[1];
  61.  
  62.     if (l == '') return;
  63.     if (!anim) { CSSetStylePos(l,0,x); CSSetStylePos(l,1,y); }
  64.     else {  var fctData = new CSSlideObj(l,new Array(CSGetStylePos(l,0),CSGetStylePos(l,1)),new Array(x,y),ticks,(new Date()).getTime()); CSStartFunction(CSMoveLoop,fctData); }
  65. }
  66. function CSSetStyleVis(s,v) { if (IsIE()) CSIEStyl(s).visibility = (v == 0) ? "hidden" : "visible";
  67.     else CSNSStyl(s).visibility = (v == 0) ? 'hide' : 'show'; }
  68. function CSGetStyleVis(s) { if (IsIE()) return (CSIEStyl(s).visibility == "hidden") ? 0 : 1;
  69.     else return (CSNSStyl(s).visibility == 'hide') ? 0 : 1;}
  70. function CSGetLayerClip (el) {
  71.     if (el.isIE) return (new CSRect(0,0,el.offsetWidth,el.offsetHeight));
  72.     else return (new CSRect(el.clip.left,el.clip.top,el.clip.width,el.clip.height));
  73. }
  74. function CSSetLayerClip (el,clipRect) {
  75.     var l,t,r,b;
  76.     l=clipRect.left; t=clipRect.top; r=l+clipRect.width; b=t+clipRect.height;
  77.     if(el.isIE) { el.style.clip = "rect("+ t + " " + r + " " + b + " " + l + ")"; }
  78.     else {
  79.         el.clip.left=l; el.clip.top=t; 
  80.         el.clip.width=clipRect.width; el.clip.height=clipRect.height;
  81.     }
  82.     CSSetStyleVis(el.layer);
  83. }
  84. function CSRect (left,top,width,height) {
  85. this.left=left; this.top=top; this.width=width; this.height=height;
  86. }
  87. function CSCreateTransElement (layer, steps) {
  88.     var el;
  89.     if (IsIE()) el=document.all.tags("div")[layer];
  90.     else el=CSNSStyl(layer);
  91.     if (el==null) return null;
  92.     if (el.locked && (el.locked == true)) return null;
  93.     el.isIE=IsIE();
  94.     el.clipRect=CSGetLayerClip(el);
  95.     if (el.clipRect==null) return null;
  96.     el.maxValue=steps;
  97.     if (el.maxValue<=0) el.maxValue=30;
  98.     el.modus=""; el.layer=layer;
  99.     el.width=el.clipRect.width; el.height=el.clipRect.height;
  100.     el.locked = true;
  101.     return el;
  102. }
  103. function CSDisposeTransElement (el) { el.locked = false; }
  104. CSStateArray = new Object;
  105. CSCookieArray = new Object;
  106. CSCookieValArray = new Object;
  107. function CSWriteCookie(action) {
  108.     var name   = "DFT" + action[1];
  109.     var hrs    = action[2];
  110.     var path   = action[3];
  111.     var domain = action[4];
  112.     var secure = action[5];
  113.     var exp    = new Date((new Date()).getTime() + hrs * 3600000);
  114.     var cookieVal = "";
  115.     for(var prop in CSCookieArray) {
  116.         if(("DFT" + CSCookieArray[prop]) == name) {
  117.             if(cookieVal != "") cookieVal += "&";
  118.             cookieVal += prop + ":" + escape(CSStateArray[prop]);
  119.         }
  120.     }
  121.     if(hrs != 0)
  122.         cookieVal += "; expires=" + exp.toGMTString();
  123.     if(path != "")
  124.         cookieVal += "; path=" + path;
  125.     if(domain != "")
  126.         cookieVal += "; domain=" + domain;
  127.     if(secure == true)
  128.         cookieVal += "; secure";
  129.     //alert(cookieVal);
  130.     document.cookie = name + '=' + cookieVal;
  131. }
  132. function CSReadCookie(action) {
  133.     var name    = "DFT" + action[1];
  134.     var cookies = document.cookie;
  135.     if(cookies == "") return;
  136.     var start = cookies.indexOf(name);
  137.     if(start == -1) return;
  138.     start += name.length + 1;
  139.     var end = cookies.indexOf(";", start);
  140.     if(end == -1) end = cookies.length;
  141.     var cookieVal = cookies.substring(start, end);
  142.     var arr = cookieVal.split('&');
  143.     for(var i = 0; i < arr.length; i++) {
  144.         var a = arr[i].split(':');
  145.         CSStateArray[a[0]] = unescape(a[1]);
  146.     }    
  147. }
  148. function CSDefineState(action) {
  149.     CSCookieArray[action[1]] = action[3]; 
  150. }
  151. function CSSetState(action) {
  152.     CSStateArray[action[1]] = action[2];
  153. }
  154. function CSInitState(action) {
  155.     if(typeof(CSStateArray[action[1]]) == "undefined")
  156.         CSStateArray[action[1]] = action[2];
  157. }
  158. function CSCheckState(action) {
  159.     var obj1 = CSStateArray[action[1]];
  160.     var obj2 = action[2];
  161.     if(typeof(obj1) == "object") {
  162.         for(var i=0;i<obj1.length;i++) {
  163.             if(obj1[i] != obj2[i])
  164.                 return false;
  165.             }
  166.         return true;
  167.         }
  168.     var res;
  169.     var op = action[3];
  170.              if(op == "==") res = (CSStateArray[action[1]] == action[2]);    
  171.         else if(op == "!=") res = (CSStateArray[action[1]] != action[2]);    
  172.         else if(op == ">" ) res = (CSStateArray[action[1]] >  action[2]);    
  173.         else if(op == ">=") res = (CSStateArray[action[1]] >= action[2]);    
  174.         else if(op == "<" ) res = (CSStateArray[action[1]] <  action[2]);    
  175.         else if(op == "<=") res = (CSStateArray[action[1]] <= action[2]);    
  176.     return res;
  177. }
  178.  
  179. function CSScriptInit() {
  180. if(typeof(skipPage) != "undefined") { if(skipPage) return; }
  181. idxArray = new Array;
  182. for(var i=0;i<CSInit.length;i++)
  183.     idxArray[i] = i;
  184. CSAction2(CSInit, idxArray);
  185.  
  186. }
  187.  
  188. function CSScriptExit() {
  189. idxArray = new Array;
  190. for(var i=0;i<CSExit.length;i++)
  191.     idxArray[i] = i;
  192. CSAction2(CSExit, idxArray);
  193.  
  194. }
  195. CSInit = new Array;
  196. CSExit = new Array;
  197. CSStopExecution = false;
  198. function CSAction(array) { 
  199.     return CSAction2(CSAct, array);
  200. }
  201. function CSAction2(fct, array) { 
  202.     var result;
  203.     for (var i=0;i<array.length;i++) {
  204.         if(CSStopExecution) return false; 
  205.         var actArray = fct[array[i]];
  206.         if(actArray == null) return false; 
  207.         var tempArray = new Array;
  208.         for(var j=1;j<actArray.length;j++) {
  209.             if((actArray[j] != null) && (typeof(actArray[j]) == "object") && (actArray[j].length == 2)) {
  210.                 if(actArray[j][0] == "VAR") {
  211.                     tempArray[j] = CSStateArray[actArray[j][1]];
  212.                 }
  213.                 else {
  214.                     if(actArray[j][0] == "ACT") {
  215.                         tempArray[j] = CSAction(new Array(new String(actArray[j][1])));
  216.                     }
  217.                 else
  218.                     tempArray[j] = actArray[j];
  219.                 }
  220.             }
  221.             else
  222.                 tempArray[j] = actArray[j];
  223.         }            
  224.         result = actArray[0](tempArray);
  225.     }
  226.     return result;
  227. }
  228. CSAct = new Object;
  229. CSIm = new Object();
  230. function CSIShow(n,i) {
  231.     if (document.images) {
  232.         if (CSIm[n]) {
  233.             var img = (!IsIE()) ? CSFindElement(n,0) : document[n];
  234.             if (img && typeof(CSIm[n][i].src) != "undefined") {img.src = CSIm[n][i].src;}
  235.             if(i != 0)
  236.                 self.status = CSIm[n][3];
  237.             else
  238.                 self.status = " ";
  239.             return true;
  240.         }
  241.     }
  242.     return false;
  243. }
  244. function CSILoad(action) {
  245.     im = action[1];
  246.     if (document.images) {
  247.         CSIm[im] = new Object();
  248.         for (var i=2;i<5;i++) {
  249.             if (action[i] != '') { CSIm[im][i-2] = new Image(); CSIm[im][i-2].src = action[i]; }
  250.             else CSIm[im][i-2] = 0;
  251.         }
  252.         CSIm[im][3] = action[5];
  253.     }
  254. }
  255.  
  256. function CSClickReturn () {
  257.     var bAgent = window.navigator.userAgent; 
  258.     var bAppName = window.navigator.appName;
  259.     if ((bAppName.indexOf("Explorer") >= 0) && (bAgent.indexOf("Mozilla/3") >= 0) && (bAgent.indexOf("Mac") >= 0))
  260.         return true; // dont follow link
  261.     else return false; // dont follow link
  262. }
  263. function CSButtonReturn () {
  264.     var bAgent = window.navigator.userAgent; 
  265.     var bAppName = window.navigator.appName;
  266.     if ((bAppName.indexOf("Explorer") >= 0) && (bAgent.indexOf("Mozilla/3") >= 0) && (bAgent.indexOf("Mac") >= 0))
  267.         return false; // follow link
  268.     else return true; // follow link
  269. }
  270. function CSBrowserSwitch(action) {
  271.     var bAgent    = window.navigator.userAgent;
  272.     var bAppName    = window.navigator.appName;
  273.  
  274.     var isNS        = (bAppName.indexOf("Netscape") >= 0);
  275.     var isIE        = (bAppName.indexOf("Explorer") >= 0);
  276.     var isWin        = (bAgent.indexOf("Win") >= 0); 
  277.     var isMac        = (bAgent.indexOf("Mac") >= 0); 
  278.  
  279.     var vers        = 0;
  280.     var versIdx    = (bAgent.indexOf("Mozilla/"));
  281.  
  282.     if(versIdx >= 0)
  283.         {
  284.         var sstr    = bAgent.substring(versIdx + 8, versIdx + 9);
  285.         vers        = parseInt(sstr) - 2;
  286.         }
  287.  
  288.     var url        = action[1];
  289.     var platform    = action[2];
  290.  
  291.     var versVec;
  292.     if(platform)
  293.         {
  294.         if(isNS && isMac) versVec = action[3];
  295.         if(isIE && isMac) versVec = action[5];
  296.         if(isNS && isWin) versVec = action[4];
  297.         if(isIE && isWin) versVec = action[6];
  298.         }
  299.     else
  300.         {
  301.         if(isNS) versVec = action[3];
  302.         if(isIE) versVec = action[4];
  303.         }
  304.  
  305.     if(vers > (versVec.length-1))
  306.         vers = versVec.length-1;
  307.     if(versVec[vers] == 0)
  308.         {
  309.         location            = url;
  310.         CSStopExecution    = true;    
  311.         }
  312. }
  313.  
  314.  
  315. function CSURLPopupShow(formName, popupName, target) {
  316.     var form  = CSFindElement(formName);
  317.     var popup = form.elements[popupName];
  318.     window.open(popup.options[popup.selectedIndex].value, target);
  319.     popup.selectedIndex = 0;
  320. }
  321.  
  322. function CSSetStyleDepth(style,depth) { if (IsIE()) CSIEStyl(style).zIndex = depth; else CSNSStyl(style).zIndex = depth;}
  323. function CSGetStyleDepth(style) { if (IsIE()) return (CSIEStyl(style).zIndex); else return (CSNSStyl(style).zIndex); }
  324. CSSeqArray = new Array;
  325. function CSSeqActionFct(seq,loopCount,continueLoop) {
  326.     if ((seq.loop < 2) || ((loopCount % 2) != 0)) {
  327.         for (var i=0;i<seq.actionCount;i++) {
  328.             if (seq.actions[3*i + 1] <= seq.frame) {
  329.                 if ((loopCount > 1) && (seq.actions[3*i + 1] < seq.start)) continue;
  330.                 if (seq.actions[3*i + 2] < loopCount) {
  331.                     seq.actions[3*i + 2] = loopCount; CSLoopIsRunning = true;
  332.                     CSAction(new Array(seq.actions[3*i + 0])); continueLoop = true;
  333.                 }
  334.             } else { continueLoop = true; break; }
  335.         }
  336.     } else {
  337.         for (var i=seq.actionCount-1;i>=0;i--) {
  338.             if (seq.actions[3*i + 1] > seq.frame) {
  339.                 if (seq.actions[3*i + 1] > seq.end) continue;
  340.                 if (seq.actions[3*i + 2] < loopCount) {
  341.                     seq.actions[3*i + 2] = loopCount; CSLoopIsRunning = true;
  342.                     CSAction(new Array(seq.actions[3*i + 0])); continueLoop = true;
  343.                 }
  344.             } else { continueLoop = true; break; }
  345.         }
  346.     }
  347.     return continueLoop;
  348. }        
  349. function CSSeqFunction(fctInfo)
  350. {
  351.     var seq = fctInfo.data; var oldFrame = seq.frame;
  352.     var newTicks = (new Date()).getTime();
  353.     seq.frame = Math.round((seq.fps * (newTicks - seq.startTicks)/1000.0) - 0.5);
  354.     var continueLoop  = false; var loopCount = 1;
  355.     
  356.     if (seq.loop > 0) {
  357.         continueLoop = true;
  358.         if (seq.loop == 1) {
  359.             var iv = (seq.end - seq.start);
  360.             var f = Math.round(((seq.frame - seq.start) / iv) - 0.5);
  361.             if (f < 0) f = 0;
  362.             loopCount = f+1;
  363.             seq.frame = seq.start + ((seq.frame - seq.start) % (seq.end - seq.start));
  364.         } else {
  365.             var iv = (seq.end - seq.start);
  366.             var f = Math.round(((seq.frame - seq.start) / iv) - 0.5);
  367.             if (f < 0) f = 0;
  368.             loopCount = f+1;
  369.             f = (seq.frame - seq.start) % (2 * iv);
  370.             if (f > iv) f = 2*iv - f;
  371.             seq.frame = seq.start + f;
  372.         }
  373.     }
  374.     continueLoop = CSSeqActionFct(seq,loopCount,continueLoop);
  375.     for (var i=0;i<seq.tracks.length;i++) {
  376.         var track = seq.tracks[i]; var frameCount = 0; var lastCount = 0; var partCount = 0;
  377.         var partIdx = track.parts.ticks.length;
  378.         for (var k=0;k<track.parts.ticks.length;k++) {
  379.             frameCount += track.parts.ticks[k];
  380.             if (frameCount > seq.frame) { partIdx = k; partCount = seq.frame - lastCount; break; }
  381.             lastCount = frameCount;
  382.         }
  383.         if (partIdx < track.parts.ticks.length) {
  384.             var type=track.parts.moveType[partIdx];
  385.             if(type==1) CSSetLinearPos (track, partIdx, partCount);
  386.             else if(type==2) CSSetCurvePos (track, partIdx, partCount);
  387.             else if(type==3) if (oldFrame != seq.frame) CSSetRandomPos (track, partIdx, partCount);
  388.                              else { x = CSGetStylePos(track.layer,0); y = CSGetStylePos(track.layer,1); }
  389.             CSSetStyleVis(track.layer,track.parts.visibilities[partIdx]);
  390.             CSSetStyleDepth(track.layer,track.parts.depths[partIdx]);
  391.             continueLoop = true;
  392.         } else {
  393.             var partIdx = track.parts.moveType.length-1;
  394.             var posArray = track.parts.positions;
  395.             var x = posArray[partIdx * 6 + 0]; var y = posArray[partIdx * 6 + 1];
  396.             CSSetStylePos(track.layer,0,x); CSSetStylePos(track.layer,1,y);
  397.             CSSetStyleVis(track.layer,track.parts.visibilities[partIdx]);
  398.             CSSetStyleDepth(track.layer,track.parts.depths[partIdx]);
  399.         }
  400.     }
  401.     return continueLoop;
  402. }
  403. function CSSetLinearPos (track, partIdx, partCount) {
  404.     var curTicks = track.parts.ticks[partIdx];
  405.     var pIdx1 = partIdx * 6; var pIdx2 = (partIdx+1) * 6;
  406.     var posArray = track.parts.positions;
  407.     var x = posArray[pIdx1 + 0]; var y = posArray[pIdx1 + 1];
  408.     var x1,x2,y1,y2;
  409.     var factor = partCount/curTicks;
  410.     x1 = x; y1 = y;
  411.     x2 = posArray[pIdx2 + 0]; y2 = posArray[pIdx2 + 1];
  412.     x = x1 * (1-factor) + x2 * factor; y = y1 * (1-factor) + y2 * factor;
  413.     CSSetStylePos(track.layer,0,x); CSSetStylePos(track.layer,1,y);
  414. }
  415. function CSSetCurvePos (track, partIdx, partCount) {
  416.     var curTicks = track.parts.ticks[partIdx];
  417.     var pIdx1 = partIdx * 6; var pIdx2 = (partIdx+1) * 6;
  418.     var posArray = track.parts.positions;
  419.     var x = posArray[pIdx1 + 0]; var y = posArray[pIdx1 + 1];
  420.     var x1,x2,x3,x4,y1,y2,y3,y4;
  421.     var factor = partCount/curTicks;
  422.     var t = factor; var u = t * t; var v = u * t;
  423.     var val1 = 3*(u-t) - v + 1; var val2 = 3*(v+t - 2*u); var val3 = 3*(u-v); var val4 = v;
  424.     x1 = x; y1 = y; x2 = posArray[pIdx1 + 2]; y2 = posArray[pIdx1 + 3];
  425.     x3 = posArray[pIdx1 + 4]; y3 = posArray[pIdx1 + 5];
  426.     x4 = posArray[pIdx2 + 0]; y4 = posArray[pIdx2 + 1];
  427.     x = x1 * val1 + x2 * val2 + x3 * val3 + x4 * val4;
  428.     y = y1 * val1 + y2 * val2 + y3 * val3 + y4 * val4;
  429.     CSSetStylePos(track.layer,0,x); CSSetStylePos(track.layer,1,y);
  430. }
  431. function CSSetRandomPos (track, partIdx, partCount) {
  432.     var curTicks = track.parts.ticks[partIdx];
  433.     var pIdx1 = partIdx * 6; var pIdx2 = (partIdx+1) * 6;
  434.     var posArray = track.parts.positions;
  435.     var x = posArray[pIdx1 + 0]; var y = posArray[pIdx1 + 1];
  436.     var x1,x2,y1,y2;
  437.     var factor = partCount/curTicks;
  438.     x1 = x; y1 = y;
  439.     x2 = posArray[pIdx2 + 0]; y2 = posArray[pIdx2 + 1];
  440.     var factorx = Math.random(); var factory = Math.random();
  441.     x = x1 * (1-factorx) + x2 * factorx; y = y1 * (1-factory) + y2 * factory;
  442.     CSSetStylePos(track.layer,0,x); CSSetStylePos(track.layer,1,y);
  443. }
  444. function CSStartSeq(name) {
  445.     var seq = CSGetScene(name); var date = new Date()
  446.     seq.startTicks = date.getTime()
  447.     for (var i=0;i<seq.actionCount;i++) seq.actions[3*i+2] = 0;
  448.     CSStartFunction(CSSeqFunction,seq);
  449. }
  450. function CSSceneObj (name,fps,loop,start,end,frame,sTicks,numAct,acts,tracks) {
  451.     this.name=name;this.fps=fps;this.loop=loop;this.start=start;this.end=end;
  452.     this.frame=frame;this.startTicks=sTicks;this.actionCount=numAct;
  453.     this.actions=acts;this.tracks=tracks;
  454. }
  455. function CSTrackObj (name,partIdx,partCount,parts) {
  456.     this.layer=name;this.partIdx=partIdx;this.partCount=partCount;this.parts=parts;
  457. }
  458. function CSPartObj (ticks,pos,depths,vis,moveType) {
  459.     this.ticks=ticks;this.positions=pos;this.depths=depths;this.visibilities=vis;
  460.     this.moveType=moveType;
  461. }
  462. function CSGetScene (name) {
  463.     for (i=0;i<CSSeqArray.length;i++) { var seq = CSSeqArray[i]; if (seq.name==name) return seq; }
  464.     return 0;
  465. }
  466.  
  467. function CSAutoStartScene(action) { CSStartSeq (action[1]); }
  468.  
  469.  
  470. // -- Action Functions
  471.  
  472. // Script copyright 1999, Adobe Systems Incorporated. All rights reserved.
  473.  
  474. function WBConfirmLink(action) {
  475.      
  476.     if (checkIt(action)) {
  477.          
  478.         if (action[2] != "(Empty Reference!)") {
  479.          
  480.             if (action[3].length < 1) {
  481.                 parent.location.href=action[2];
  482.             }
  483.              
  484.             else {
  485.                 parent.frames[action[3]].location.href=action[2];
  486.             }
  487.         }
  488.     }
  489.     return;
  490. }
  491. function checkIt(action) {
  492.     var carryOn = window.confirm(action[1]);
  493.     return carryOn;
  494.     }
  495.  
  496. // Script copyright 1999, Adobe Systems Incorporated. All rights reserved.
  497.  
  498. function initIArray() {
  499. this.length = initIArray.arguments.length;
  500. for (var i = 0; i < this.length; i++)
  501. this[i+1] = initIArray.arguments[i]; 
  502. }
  503.  
  504. function dailyImageURL(action) {
  505. var dateArray = new
  506. initIArray("Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday");
  507. var today = new Date();
  508. var day = dateArray[today.getDay()];
  509. if (today.getDay() == 0) { day = "Sunday"; }
  510. var img = null;
  511. if (document.images) {
  512.     if (!IsIE()) img = CSFindElement(action[1],0);
  513.     else img = document.images[action[1]];
  514.         if (img) {
  515.             if (day == "Monday" && action[2] != "(Empty Reference!)") img.src = action[2]
  516.             if (day == "Tuesday" && action[3] != "(Empty Reference!)") img.src = action[3]
  517.             if (day == "Wednesday" && action[4] != "(Empty Reference!)") img.src = action[4]
  518.             if (day == "Thursday" && action[5] != "(Empty Reference!)") img.src = action[5]
  519.             if (day == "Friday" && action[6] != "(Empty Reference!)") img.src = action[6]
  520.             if (day == "Saturday" && action[7] != "(Empty Reference!)") img.src = action[7]
  521.             if (day == "Sunday" && action[8] != "(Empty Reference!)") img.src = action[8]
  522.         }  
  523. }  
  524. }
  525.  
  526. // Script copyright 1999, Adobe Systems Incorporated. All rights reserved.
  527.  
  528. function initArray() {
  529. this.length = initArray.arguments.length;
  530. for (var i = 0; i < this.length; i++)
  531. this[i+1] = initArray.arguments[i]; 
  532. }
  533.  
  534. function dailyRedirect(action) {
  535. var dateArray = new
  536. initArray("Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday");
  537. var today = new Date();
  538. var day = dateArray[today.getDay()];
  539. if (today.getDay() == 0) { day = "Sunday"; }
  540. if (day == "Monday" && action[1] != "(Empty Reference!)") window.location = action[1]
  541. if (day == "Tuesday" && action[2] != "(Empty Reference!)") window.location = action[2]
  542. if (day == "Wednesday" && action[3] != "(Empty Reference!)") window.location = action[3]
  543. if (day == "Thursday" && action[4] != "(Empty Reference!)") window.location = action[4]
  544. if (day == "Friday" && action[5] != "(Empty Reference!)") window.location = action[5]
  545. if (day == "Saturday" && action[6] != "(Empty Reference!)") window.location = action[6]
  546. if (day == "Sunday" && action[7] != "(Empty Reference!)") window.location = action[7]
  547. }
  548.  
  549. // Script copyright 1999, Adobe Systems Incorporated. All rights reserved.
  550.  
  551. function CSDeleteCookie(action) 
  552. {
  553. var name=action[1]
  554. var value=action[2]
  555. var jours=-12000
  556. path="/"
  557. domain=null
  558. var expdate = new Date ();
  559. expdate.setTime (expdate.getTime() + (jours * 60 * 60 * 1000));
  560. SetCookie(name,value,expdate)
  561. }
  562.  
  563. function SetCookie (name, value) {
  564.   var argv = SetCookie.arguments;
  565.   var argc = SetCookie.arguments.length;
  566.   var expires = (argc > 2) ? argv[2] : null;
  567.   var secure = (argc > 5) ? argv[5] : false;
  568.   document.cookie = name + "=" + escape (value) +
  569.     ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
  570.     ((path == null) ? "" : ("; path=" + path)) +
  571.     ((domain == null) ? "" : ("; domain=" + domain)) +
  572.     ((secure == true) ? "; secure" : "");
  573. }
  574.  
  575. // Script copyright 1999, Adobe Systems Incorporated. All rights reserved.
  576.  
  577.         function frameP(action) {
  578.             if(parent.frames.length==0) {
  579.                 var fileName=window.location.href.substring(window.location.href.lastIndexOf("/")+1,window.location.href.length);
  580.                 window.location.href=action[1]+"?"+action[2]+"="+fileName;
  581.             } else {
  582.                 if(top.location.search!="") {
  583.                     var sFrame=top.location.search.substring(1,top.location.search.indexOf("="));
  584.  
  585.                     if(name==sFrame) {
  586.                         var sName=top.location.search.substring(top.location.search.indexOf("=")+1,top.location.search.length);
  587.                         var fileName=window.location.href.substring(window.location.href.lastIndexOf("/")+1,window.location.href.length);
  588.                         if(fileName!=sName) {
  589.                             location=sName;
  590.                         }
  591.                     }
  592.                 }
  593.             }
  594.         }
  595.  
  596. // Script copyright 1999, Adobe Systems Incorporated. All rights reserved.
  597.  
  598.  
  599. function CSPAKkillframe() { 
  600.  
  601. if (self.parent.frames.length != 0)
  602. self.parent.location = document.location
  603.  
  604. }
  605.  
  606. // ⌐ 1999, Adobe Systems Incorporated. All rights reserved.
  607. var actn1 = "";
  608. var actn2 = "";
  609. var pass=""
  610. var z=23;
  611. var y=28;
  612. iCounter = 3;
  613. if (Array) {
  614.     var f= new Array();
  615.     var K= new Array();
  616.     var base= new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z","a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z")
  617. function inc(){
  618. iCounter--
  619. if (iCounter > 0)
  620.     {
  621.     if (confirm("\nPassword is incorrect.\n\n\n\nRetry?"))
  622.         Check()
  623.     } 
  624.     else
  625.         alert('Access Denied');
  626. function Check(){
  627. pass = prompt("Enter your password.","")
  628. if(pass==null || pass==""){
  629.     alert("You did not enter a password!");
  630.     if(pass==""){
  631.         Check()
  632.     } 
  633. else{
  634.     var lpass=(pass.length)+1
  635.     for (l=1; l<lpass; l++){
  636.         K[l]=pass.charAt(l)
  637.     } 
  638.     var transmit=0;
  639.     for (y=1; y<lpass; y++){
  640.         for(x=0; x<62; x++){
  641.             if (K[y]==base[x]){
  642.                 transmit+=f[x]
  643.                 transmit*=y
  644.             } 
  645.         } 
  646.     } 
  647.     if (transmit==parseInt(actn1))     
  648.         go()
  649.     else
  650.         inc()
  651. function go(){
  652. alert(actn2);
  653. location.href=pass+".html";
  654. function PVpassword(action) { 
  655. if (Array) { 
  656.     actn1 = action[1];
  657.     actn2 = action[2];
  658.     z=23;
  659.     y=28;
  660.     for (x=0; x<10; x++){
  661.         f[x]=x<<9
  662.         f[x]+=23
  663.     } 
  664.     for (x=10; x<36; x++){
  665.         y=y<<1
  666.         v= Math.sqrt(y)
  667.         v = parseInt(v,16)
  668.         v+=5
  669.         f[x]=v
  670.         y++
  671.     } 
  672.     for (x=36; x<62; x++){
  673.         z=z<<1
  674.         v= Math.sqrt(z)
  675.         v = parseInt(v,16)
  676.         v+=74
  677.         f[x]=v
  678.         z++
  679.     } 
  680.     iCounter = 3;
  681.     Check();
  682. }
  683.  
  684. // Script copyright 1999, Adobe Systems Incorporated. All rights reserved.
  685.  
  686. SSnumimg=1; SSsens2=-1;SSsens3=-1
  687. function CSSlideShow(action) 
  688. {
  689. SSmax=action[2]
  690. SSimgNom=action[1]
  691. SSloop=action[4]
  692. SSsens=action[3] 
  693. SSpalin=action[5]
  694. var SSimg = null;
  695.     if (document.images) {
  696.         if (!IsIE()) SSimg = CSFindElement(SSimgNom,0);
  697.         else SSimg = document.images[SSimgNom];
  698. SSstr=SSimg.src
  699. SSn=SSstr.length
  700. SSp=SSn-6
  701. SSpstr=SSstr.substring(0,SSp)
  702. SSnimg=SSstr.substring(SSp,SSp+2)
  703. SSformat=SSstr.substring(SSp+2,SSn)
  704. if (SSformat==".jpg" || SSformat==".JPG" || SSformat==".gif" || SSformat==".GIF")
  705. {}
  706. else
  707. {
  708.  alert("Image extension must be .jpg or .gif (case sensitive). Images must be numbered 01, 02 ...")
  709. }
  710. slide(SSmax,SSformat,SSpstr,SSnimg,SSimgNom,SSloop,SSpalin)
  711. }
  712. }
  713. function slide(SSmax,SSformat,SSpstr,SSnimg,SSimgNom,SSloop,SSpalin)
  714. {
  715. if (SSsens2==true) {SSsens=true}
  716. if (SSsens2==false) {SSsens=false}
  717. if (SSsens==true) 
  718. {
  719. SSsuite=SSnumimg-1
  720.     if (SSnumimg>SSmax)SSsuite=SSmax
  721.     if (SSnumimg<=1 & SSloop==true & SSpalin!=true) { SSsuite=SSmax }
  722.     if (SSnumimg<=1 & SSloop==true & SSpalin==true) { 
  723.         if (SSsens2==-1 & SSsens3==-1) {SSsuite=SSmax;SSsens3=1} else { SSsuite=SSnumimg+1; SSsens2=false }}
  724.     if (SSnumimg<=1 & SSloop!=true & SSpalin!=true) {
  725.         if  (SSsens2==-1 & SSsens3==-1) { SSsuite=SSmax;SSsens3=1 } else {SSsuite=SSnumimg; SSfini()}}
  726. }
  727. else
  728. {
  729. SSmax=SSmax-1
  730. SSsuite=SSnumimg+1
  731.     if (SSnumimg>SSmax & SSloop==true & SSpalin!=true) { SSsuite=1}
  732.     if (SSnumimg>SSmax & SSloop==true & SSpalin==true) {SSsuite=SSnumimg-1; SSsens2=true }
  733.     if (SSnumimg>SSmax & SSloop!=true &  SSpalin!=true) { SSsuite=SSnumimg;SSfini() }
  734.     if (SSnumimg<1) SSsuite=1
  735. }
  736. SSnumimg=SSsuite
  737. if (SSsuite<10) {
  738.     SSaller="0"+SSsuite
  739.     }
  740.     else SSaller=SSsuite
  741. SSsource=SSpstr+SSaller+SSformat
  742. var SSimg = null;
  743.     if (document.images) {
  744.         if (!IsIE()) SSimg = CSFindElement(SSimgNom,0);
  745.         else SSimg = document.images[SSimgNom];
  746.         if (SSimg) SSimg.src = SSsource;
  747.     }
  748. }
  749. function SSfini() {
  750. }
  751.  
  752. // Script copyright 1999, Adobe Systems Incorporated. All rights reserved.
  753.  
  754. function CSSlideShowAuto(action) 
  755. {
  756. SSAfini=0
  757. SSAnumimg=0
  758. SSAmax=action[2]
  759. SSAimgNom=action[1]
  760. SSAtemps=action[3]*1000
  761. if (action[4]==true) 
  762.         {
  763.         SSAstop=true
  764.         }
  765.     else SSAstop=false
  766. var SSAimg = null;
  767.     if (document.images) {
  768.         if (!IsIE()) SSAimg = CSFindElement(SSAimgNom,0);
  769.         else SSAimg = document.images[SSAimgNom];
  770. str=SSAimg.src
  771. n=str.length
  772. p=n-6
  773. SSApstr=str.substring(0,p)
  774. SSAnimg=str.substring(p,p+2)
  775. SSAformat=str.substring(p+2,n)
  776. if (SSAformat==".jpg" || SSAformat==".JPG" || SSAformat==".gif" || SSAformat==".GIF")
  777. {}
  778. else
  779. {
  780.  alert("Image extension must be .jpg or .gif (case sensitive). Images must use 2 digit naming starting with 01, 02 ... plus extension")
  781. }
  782. if (SSAnimg.substring(0,1)=="0") 
  783. {
  784. SSAnumimg=Number(SSAnimg.substring(1,2))
  785. }
  786. else
  787. {SSAnumimg=Number(SSAnimg)}
  788.  
  789.  
  790. SSAtempo(SSAmax,SSAimgNom,SSAtemps,SSAstop,SSApstr,SSAnimg,SSAformat)
  791. }
  792. }
  793.  
  794. function SSAtempo(SSAmax,SSAimgNom,SSAtemps,SSAstop,SSApstr,SSAnimg,SSAformat)
  795. {
  796. setTimeout("slideAuto(SSAmax,SSAimgNom,SSAstop,SSApstr,SSAnimg,SSAformat)",SSAtemps)
  797. }
  798.  
  799.  
  800. function slideAuto(SSAmax,SSAimgNom,SSAstop,SSApstr,SSAnimg,SSAformat)
  801. {
  802. if (SSAfini==1) {
  803. SSAnumimg = SSAnumimg-2
  804. CSSlideShowAutoPause()
  805. }
  806. else 
  807. {
  808. SSAmax=SSAmax-1
  809. SSAsuite=SSAnumimg+1
  810.     if (SSAnumimg>SSAmax)
  811.         {
  812.         SSAsuite=1
  813.         if (SSAstop==true) SSAfini=1
  814.         else
  815.         SSAfini=0
  816.         }
  817.     if (SSAnumimg<1) SSAsuite=1
  818. SSAnumimg=SSAsuite
  819. if (SSAsuite<10) {
  820.     SSAaller="0"+SSAsuite
  821.     }
  822.     else SSAaller=SSAsuite
  823. SSAsource=SSApstr+SSAaller+SSAformat
  824. var SSAimg = null;
  825.     if (document.images) {
  826.         if (!IsIE()) SSAimg = CSFindElement(SSAimgNom,0);
  827.         else SSAimg = document.images[SSAimgNom];
  828.         if (SSAimg) SSAimg.src = SSAsource;
  829.     }
  830. SSAtempo(SSAmax,SSAimgNom,SSAtemps,SSAstop,SSApstr,SSAnimg,SSAformat)
  831. }
  832. }
  833.  
  834. function CSSlideShowAutoPause() 
  835. {}
  836.  
  837. // Script copyright 1999, Adobe Systems Incorporated. All rights reserved.
  838.  
  839. function CSSlideShowAutoStop(action) 
  840. {
  841. if (SSAfini==0) SSAfini=1
  842. else SSAfini=0 ; SSAnumimg = SSAnumimg+2 ;  slideAuto(SSAmax,SSAimgNom,SSAstop,SSApstr,SSAnimg,SSAformat)
  843. }
  844.  
  845. // Script copyright 1999, Adobe Systems Incorporated. All rights reserved.
  846.  
  847. function CSPAKtrg2frames(action) { 
  848.     parent.frames[action[1]].location.href = action[2]
  849.     parent.frames[action[3]].location.href = action[4]
  850.  }
  851.  
  852. // Script copyright 1999, Adobe Systems Incorporated. All rights reserved.
  853.  
  854. function CSPakRemote(action) { 
  855.     if (TRversion()) {
  856.         if (action[2].length < 1) {
  857.             opener.location.href=action[1];
  858.         }
  859.         else {
  860.             opener.parent.frames[action[2]].location.href=action[1];
  861.         }
  862.     }
  863.     return;
  864. }
  865.  
  866. function TRversion() {
  867.     return (navigator.appName.indexOf("Netscape") >= 0 && parseInt(navigator.appVersion.charAt(0)) >= 3)
  868.           || (navigator.appName.indexOf("Explorer") >= 0 && parseInt(navigator.appVersion.charAt(0)) >= 3);
  869. }
  870.  
  871. // Script copyright 1999, Adobe Systems Incorporated. All rights reserved.
  872.  
  873. function timeRedirect(action) {
  874. var now = new Date();
  875. var hours = now.getHours();
  876. var timeValue = action[1];
  877. if (timeValue >= 12) { timeValue = timeValue - 12; } // deals with 24-hour time
  878. if (action[2] == true) { timeValue += 12; } // deals with PM times
  879. if (hours < timeValue && action[4] != "(Empty Reference!)" && action[3] == true) {
  880. window.location = action[4]; }
  881. if (hours >= timeValue && action[6] != "(Empty Reference!)" && action[5] == true) {
  882. window.location = action[6]; }
  883. }
  884.  
  885. // Script copyright 1999, Adobe Systems Incorporated. All rights reserved.
  886.  
  887. function CSVisitorCookie(action) 
  888. {
  889. resultat = "visitor"
  890. cookiename = action[1]
  891. goUrl = action[2]
  892. var arg = cookiename + "=";
  893.   var alen = arg.length;
  894.   var clen = document.cookie.length;
  895.   var i = 0;
  896.   while (i < clen) {
  897.     var j = i + alen;
  898.        if (document.cookie.substring(i, j) == arg)
  899.      return CSVisitorGetCookie (j);
  900.     i = document.cookie.indexOf(" ", i) + 1;
  901.     if (i == 0) break; 
  902.   }
  903.   VisitorSetCookie(cookiename)
  904.   return null; 
  905. }
  906. function CSVisitorGetCookie (offset) {
  907.   var endstr = document.cookie.indexOf (";", offset);
  908.   if (endstr == -1) 
  909.     endstr = document.cookie.length;
  910.   valeur=unescape(document.cookie.substring(offset, endstr))
  911.   if (valeur==resultat)
  912.   VisitorGotoLink(goUrl)
  913.   else
  914.   VisitorSetCookie(cookiename)
  915. }
  916.  
  917.  
  918. function VisitorGotoLink(goUrl) {
  919. location = goUrl
  920. }
  921.  
  922.  
  923.  
  924. function VisitorSetCookie(cookiename) 
  925. {
  926. var value="visitor"
  927. var jours=500*24
  928. path="/"
  929. domain=null
  930. var expdate = new Date ();
  931. expdate.setTime (expdate.getTime() + (jours * 60 * 60 * 1000));
  932. SetCookie(cookiename,value,expdate)
  933. }
  934.  
  935. function SetCookie (cookiename, value) {
  936.   var argv = SetCookie.arguments;
  937.   var argc = SetCookie.arguments.length;
  938.   var expires = (argc > 2) ? argv[2] : null;
  939.   var secure = (argc > 5) ? argv[5] : false;
  940.   document.cookie = cookiename + "=" + escape (value) +
  941.     ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
  942.     ((path == null) ? "" : ("; path=" + path)) +
  943.     ((domain == null) ? "" : ("; domain=" + domain)) +
  944.     ((secure == true) ? "; secure" : "");
  945. }
  946.  
  947. function CSGetLayerPos(action) { 
  948.     var layer = action[1];
  949.     var x        = CSGetStylePos(layer, 0);
  950.     var y        = CSGetStylePos(layer, 1);
  951.     return new Array(x, y);
  952. }
  953.  
  954. function CSGetFormElementValue(action) { 
  955.     var form = action[1];
  956.     var elem = action[2];
  957.     return document.forms[form].elements[elem].value;
  958. }
  959.  
  960. CSImages=new Array();
  961. function CSPreloadImage(action) {
  962.     if (document.images) { CSImages[CSImages.length]=new Image(); CSImages[CSImages.length-1].src=action[1]; }
  963. }
  964.  
  965. function CSRandomImg(action) { 
  966.     if (document.images) {
  967.         var img = null;
  968.         var whichone = Math.floor((Math.random() * 10)) % 3
  969.         if(!IsIE()) img = CSFindElement(action[1],0);
  970.         else img = document.images[action[1]];
  971.         img.src = action[whichone+2]
  972.     }
  973.  }
  974.  
  975. function CSSetImageURL(action) {
  976.     var img = null;
  977.     if (document.images) {
  978.         if (!IsIE()) img = CSFindElement(action[1],0);
  979.         else img = document.images[action[1]];
  980.         if (img) img.src = action[2];
  981.     }
  982. }
  983.  
  984. function CSGoBack1() { history.back() }
  985.  
  986. function CSGotoLink(action) {
  987.     if (action[2].length) {
  988.         var hasFrame=false;
  989.         for(i=0;i<parent.frames.length;i++) { if (parent.frames[i].name==action[2]) { hasFrame=true; break;}}
  990.         if (hasFrame==true)
  991.             parent.frames[action[2]].location = action[1];
  992.         else
  993.             window.open (action[1],action[2],"");
  994.     }
  995.     else location = action[1];
  996. }
  997.  
  998. function CSHistoryGo(action) { history.go(action[1]); }
  999.  
  1000. function CSOpenWindow(action) {
  1001.     var wf = "";    
  1002.     wf = wf + "width=" + action[3];
  1003.     wf = wf + ",height=" + action[4];
  1004.     wf = wf + ",resizable=" + (action[5] ? "yes" : "no");
  1005.     wf = wf + ",scrollbars=" + (action[6] ? "yes" : "no");
  1006.     wf = wf + ",menubar=" + (action[7] ? "yes" : "no");
  1007.     wf = wf + ",toolbar=" + (action[8] ? "yes" : "no");
  1008.     wf = wf + ",directories=" + (action[9] ? "yes" : "no");
  1009.     wf = wf + ",location=" + (action[10] ? "yes" : "no");
  1010.     wf = wf + ",status=" + (action[11] ? "yes" : "no");        
  1011.     window.open(action[1],action[2],wf);
  1012. }
  1013.  
  1014. function CSDocWrite(action) { document.write(action[1]); }
  1015.  
  1016. function CSOpenAlert(action) { alert(action[1]); }
  1017.  
  1018. function CSSetStatus(action) { self.status = action[1]; }
  1019.  
  1020. var gCSIEDragObject = null;
  1021. function CSSetupDrag (layerName) {
  1022.     this.x = 0; this.y = 0;
  1023.     if (IsIE()) {
  1024.         this.canDrag=true; 
  1025.         this.layerObj=document.all.tags("div")[layerName];
  1026.         this.layerObj.dragObj = this;
  1027.         document.ondragstart = CSIEStartDrag;
  1028.         document.onmousedown = CSIEMouseDown;
  1029.         document.onmouseup = CSIEStopDrag;
  1030.     } else {
  1031.         this.layer=CSNSStyl(layerName);this.onmousemove=null; 
  1032.         this.layer.document.theLayer=this;
  1033.         this.layer.document.captureEvents(Event.MOUSEDOWN);
  1034.         this.layer.document.onmousedown=CSNSStartDrag; 
  1035.         this.layer.document.onmouseup=CSNSStopDrag;
  1036.     }
  1037. }
  1038. function CSNSStartDrag (ev) {
  1039.     var clickInMe = false;
  1040.     if (ev.target != this) {
  1041.         for (var i=0;i<this.images.length;i++) {
  1042.             if (this.images[i] == ev.target) { clickInMe = true; break;}
  1043.             }
  1044.         }
  1045.     else clickInMe = true;    
  1046.     if (clickInMe)
  1047.         {
  1048.         this.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP); 
  1049.         this.onmousemove=CSNSDoDrag;
  1050.         this.theLayer.x= ev.pageX;
  1051.         this.theLayer.y= ev.pageY;
  1052.         this.routeEvent(ev);
  1053.         return false;
  1054.         }
  1055.    this.onmousemove=null;this.releaseEvents(Event.MOUSEMOVE|Event.MOUSEUP);
  1056.     this.routeEvent(ev);
  1057.    return true; 
  1058. }
  1059. function CSNSStopDrag (ev) {
  1060.    this.onmousemove=null;this.releaseEvents(Event.MOUSEMOVE|Event.MOUSEUP);return false; 
  1061. }
  1062. function CSNSDoDrag (ev) {
  1063.     this.theLayer.layer.moveBy(ev.pageX-this.theLayer.x, ev.pageY-this.theLayer.y); 
  1064.     this.theLayer.x = ev.pageX; 
  1065.     this.theLayer.y = ev.pageY;
  1066.     this.routeEvent(ev);
  1067. }
  1068. function CSIEStartDrag () {
  1069.     if(gCSIEDragObject != null && (gCSIEDragObject.tagName==event.srcElement.tagName))
  1070.         event.returnValue=false;  
  1071. }
  1072. function CSIEStopDrag () { gCSIEDragObject=null; document.onmousemove=null; }
  1073. function CSIEMouseDown () {
  1074.     if(event.button==1) {
  1075.         dragLayer = event.srcElement;
  1076.         while (dragLayer!=null) 
  1077.             {
  1078.             if ((dragLayer.dragObj == null) && (dragLayer.tagName == "DIV"))
  1079.                 break;
  1080.             if (dragLayer.dragObj != null)
  1081.                 break;
  1082.             dragLayer=dragLayer.parentElement;
  1083.             }
  1084.             
  1085.         if (dragLayer == null) return;
  1086.         if (dragLayer.dragObj!=null && dragLayer.dragObj.canDrag) {
  1087.             gCSIEDragObject = dragLayer;
  1088.             gCSIEDragObject.dragObj.x=event.clientX;
  1089.             gCSIEDragObject.dragObj.y=event.clientY;
  1090.             document.onmousemove = CSIEMouseMove;
  1091.         }
  1092.     }
  1093. }
  1094. function CSIEMouseMove () {
  1095.     gCSIEDragObject.dragObj.layerObj.style.pixelLeft+=(event.clientX-gCSIEDragObject.dragObj.x);
  1096.     gCSIEDragObject.dragObj.layerObj.style.pixelTop+=(event.clientY-gCSIEDragObject.dragObj.y);
  1097.     gCSIEDragObject.dragObj.x=event.clientX;
  1098.     gCSIEDragObject.dragObj.y=event.clientY;
  1099.     event.returnValue = false;
  1100.     event.cancelBubble = true;
  1101. }
  1102. var gDragArray = new Array();
  1103. function CSDrag(action) { gDragArray[gDragArray.length] = new CSSetupDrag(action[1]); }
  1104.  
  1105. function CSFlipMove(action) {
  1106.     if (action[1] == '') return;
  1107.     var curX = CSGetStylePos(action[1],0); var curY = CSGetStylePos(action[1],1);
  1108.     var x1 = action[2][0];
  1109.     var y1 = action[2][1];
  1110.     if ((x1 != curX) || (y1 != curY)) CSSlideLayer(action[1],action[2],action[4],action[5]);
  1111.     else CSSlideLayer(action[1],action[3],action[4],action[5]);
  1112. }
  1113.  
  1114. function CSMoveBy(action)
  1115. {
  1116.     x = CSGetStylePos(action[1], 0);
  1117.     y = CSGetStylePos(action[1], 1);
  1118.     x += parseInt(action[2]);
  1119.     y += parseInt(action[3]);
  1120.     x = CSSetStylePos(action[1], 0, x);
  1121.     y = CSSetStylePos(action[1], 1, y);
  1122. }
  1123.  
  1124. function CSMoveTo(action) { CSSlideLayer(action[1],action[2],action[3],action[4]); }
  1125.  
  1126. function CSPlayScene(action) { CSStartSeq (action[1]); }
  1127.  
  1128. var CSLastSound = null
  1129. function CSPlaySound(action) {
  1130.     if (eval('document.'+action[1])!=null) {
  1131.         if (CSLastSound != null && CSLastSound != action[1]) eval ('document.' + CSLastSound + '.stop()');
  1132.         CSLastSound = action[1]
  1133.         if (window.navigator.userAgent.indexOf("MSIE") > 0) eval ('document.' + CSLastSound + '.run()');
  1134.         else eval ('document.' + CSLastSound + '.play(true)');
  1135.     } else { alert ("The current Plug-In cannot be controlled by JavaScript. Please try using LiveAudio or a compatible Plug-In!"); }
  1136. }
  1137.  
  1138. function CSShowHide(action) {
  1139.     if (action[1] == '') return;
  1140.     var type=action[2];
  1141.     if(type==0) CSSetStyleVis(action[1],0);
  1142.     else if(type==1) CSSetStyleVis(action[1],1);
  1143.     else if(type==2) { 
  1144.         if (CSGetStyleVis(action[1]) == 0) CSSetStyleVis(action[1],1);
  1145.         else CSSetStyleVis(action[1],0);
  1146.     }
  1147. }
  1148.  
  1149. function CSStopAll(action) { CSStopComplete (); }
  1150.  
  1151. function CSStopScene(action) { CSStopFunction (action[1]); }
  1152.  
  1153. function CSStopSound (action) {if (eval('document.'+action[1])!=null) { eval ('document.' + action[1] + '.stop()');}}
  1154.  
  1155. function CSStartWipe (action)
  1156. {
  1157.     var el=CSCreateTransElement (action[1], action[2]);
  1158.     if (el==null) return;
  1159.     var dir=action[3];
  1160.     if (dir=="_inLeft") {el.steps=el.clipRect.width/el.maxValue; el.modus="in";}
  1161.     else if (dir=="_inRight") {el.steps=el.clipRect.width/el.maxValue; el.modus="in";}
  1162.     else if (dir=="_outLeft") {el.steps=el.clipRect.width/el.maxValue; el.modus="out";}
  1163.     else if (dir=="_outRight") {el.steps=el.clipRect.width/el.maxValue; el.modus="out";}
  1164.     else if (dir=="_inTop") {el.steps=el.clipRect.height/el.maxValue; el.modus="in";}
  1165.     else if (dir=="_inBottom") {el.steps=el.clipRect.height/el.maxValue; el.modus="in";}
  1166.     else if (dir=="_outTop") {el.steps=el.clipRect.height/el.maxValue; el.modus="out";}
  1167.     else if (dir=="_outBottom") {el.steps=el.clipRect.height/el.maxValue; el.modus="out";}
  1168.     else if (dir=="_inCenter") {el.HSteps=el.clipRect.width/el.maxValue; el.VSteps=el.clipRect.height/el.maxValue; el.modus="in";}
  1169.     else if (dir=="_outCenter") {el.HSteps=el.clipRect.width/el.maxValue; el.VSteps=el.clipRect.height/el.maxValue; el.modus="out";}
  1170.     if (el.modus=="") return;
  1171.     el.currentValue=0;
  1172.     el.glDir=action[3];
  1173.     CSStartFunction(CSDoWipe,el);
  1174. }
  1175. function CSDoWipe (info)
  1176. {
  1177.     var el = info.data;
  1178.     if (el==null) return false;
  1179.     if (el.currentValue==el.maxValue) { CSFinishWipe(el); return false; }
  1180.     var r = new CSRect(el.clipRect.left,el.clipRect.top,el.clipRect.width,el.clipRect.height);
  1181.     var dir=el.glDir;
  1182.     if (dir=="_inLeft") {r.left=r.width-el.currentValue*el.steps;}
  1183.     else if (dir=="_inTop") {r.top=r.height-el.currentValue*el.steps;}
  1184.     else if (dir=="_inRight") {r.width=el.currentValue*el.steps;}
  1185.     else if (dir=="_inBottom") {r.height=el.currentValue*el.steps;}
  1186.     else if (dir=="_outLeft") {r.width=r.width-el.currentValue*el.steps;}
  1187.     else if (dir=="_outTop") {r.height=r.height-el.currentValue*el.steps;}
  1188.     else if (dir=="_outRight") {r.left=el.currentValue*el.steps;}
  1189.     else if (dir=="_outBottom") {r.top=el.currentValue*el.steps;}
  1190.     else if (dir=="_inCenter") {r=CSCenterRectIn(el,r);}
  1191.     else if (dir=="_outCenter") {r=CSCenterRectOut(el,r);}
  1192.     CSSetLayerClip(el,r);
  1193.     el.currentValue+=1;
  1194.     return true;
  1195. }
  1196. function CSFinishWipe (el)
  1197. {
  1198.     if (el.modus=="in") CSSetLayerClip(el,el.clipRect);
  1199.     else { 
  1200.         el.clipRect=new CSRect(0,0,el.width,el.height); 
  1201.         CSSetLayerClip(el,el.clipRect); 
  1202.         CSSetStyleVis(el.layer,0);
  1203.     }
  1204.     CSDisposeTransElement(el);
  1205. }
  1206. function CSCenterRectIn(el,r)
  1207. {
  1208.     var hValue= el.currentValue*el.HSteps/2;
  1209.     var vValue= el.currentValue*el.VSteps/2;
  1210.     r.left=Math.round(r.left+r.width/2-hValue); 
  1211.     r.top=Math.round(r.top+r.height/2-vValue); 
  1212.     r.width=Math.round(hValue*2);
  1213.     r.height=Math.round(vValue*2);
  1214.     return r;
  1215. }
  1216. function CSCenterRectOut(el,r)
  1217. {
  1218.     var hValue= el.currentValue*el.HSteps/2;
  1219.     var vValue= el.currentValue*el.VSteps/2;
  1220.     r.left+=Math.round(hValue); 
  1221.     r.top+=Math.round(vValue); 
  1222.     r.width-=Math.round(hValue*2);
  1223.     r.height-=Math.round(vValue*2);
  1224.     return r;
  1225. }
  1226.  
  1227. function CSFixFct() {
  1228.     var d = document; var w = window;
  1229.     if (d.cs.csFix.w != w.innerWidth || d.cs.csFix.h != w.innerHeight) {
  1230.         d.location = d.location; }
  1231. }
  1232. function CSNSFix(action) { 
  1233.     var d = document; var w = window;
  1234.     if ((navigator.appName == 'Netscape') && (parseInt(navigator.appVersion) == 4)) {
  1235.         if (typeof d.cs == 'undefined') { 
  1236.             d.cs = new Object;
  1237.             d.cs.csFix = new Object; 
  1238.         } else if (CSIsFrame (w) == true) CSFixFct();
  1239.         d.cs.csFix.w = w.innerWidth;
  1240.         d.cs.csFix.h = w.innerHeight; 
  1241.         window.onresize = CSFixFct;
  1242.       }
  1243. }
  1244. function CSIsFrame (window) {
  1245.     var rootWindow = window.parent;
  1246.     if (rootWindow == 'undefined') return false;
  1247.     for (i = 0; i < rootWindow.frames.length; i++)
  1248.         if (window == rootWindow.frames[i]) return true;
  1249.     return false;
  1250. }
  1251.  
  1252. function CSResizeWindow(action) { 
  1253.     if(navigator.appVersion.charAt(0) >=4) { window.resizeTo (action[1],action[2]) }
  1254. }
  1255.  
  1256. function CSScrollDown(action){
  1257.     if(navigator.appVersion.charAt(0) >=4) {
  1258.         var container = 0    
  1259.         if (action[2] > 0)        {
  1260.             while (container < action[1]) {
  1261.                    window.scrollBy(0,action[2]);
  1262.                    container = container + action[2];  
  1263.             }     
  1264.           }
  1265.     }
  1266. }
  1267.  
  1268. function CSScrollLeft(action){
  1269.     if(navigator.appVersion.charAt(0) >=4) {
  1270.         var container = 0    
  1271.         if (action[2] > 0)        {
  1272.             while (container < action[1]) {
  1273.                    window.scrollBy(-action[2],0);
  1274.                    container = container + action[2];  
  1275.             }     
  1276.           }
  1277.     }
  1278. }
  1279.  
  1280. function CSScrollRight(action){
  1281.     if(navigator.appVersion.charAt(0) >=4) {
  1282.         var container = 0    
  1283.         if (action[2] > 0)        {
  1284.             while (container < action[1]) {
  1285.                    window.scrollBy(action[2],0);
  1286.                    container = container + action[2];  
  1287.             }     
  1288.           }
  1289.     }
  1290. }
  1291.  
  1292. function CSScrollUp(action){
  1293.     if(navigator.appVersion.charAt(0) >=4) {
  1294.         var container = 0    
  1295.         if (action[2] > 0)        {
  1296.             while (container < action[1]) {
  1297.                    window.scrollBy(0,-action[2]);
  1298.                    container = container + action[2];  
  1299.             }     
  1300.           }
  1301.     }
  1302. }
  1303.  
  1304. function CSSetBackColor(action) { document.bgColor = action[1]; }
  1305.  
  1306. function CSActionGroup (action) {
  1307.     for(var i=1;i<action.length;i++) { CSAction(new Array(action[i])); }
  1308. }
  1309.  
  1310. function CSCallAction(action)
  1311. {
  1312.     CSAction(new Array(action[1]));
  1313. }
  1314.  
  1315. function CSCallFunction(action)
  1316. {
  1317.     var str = action[1];
  1318.     str += "(";
  1319.     str += action[2];
  1320.     str += ");"
  1321.  
  1322.     return eval(str);
  1323. }
  1324.  
  1325. function CSConditionAction(action) {
  1326.     if (action[1]) {
  1327.         if (CSAction(new Array(action[1])) == true) {
  1328.             if (action[2]) CSAction(new Array(action[2]));
  1329.         } else if (action[3]) CSAction(new Array(action[3]));
  1330.     }
  1331. }
  1332.  
  1333. function CSIdleObject (action) {
  1334.     this.conditionAction = action[2];
  1335.     this.trueAction = action[3];
  1336.     this.falseAction = action[4];
  1337.     this.exitIdleIfTrue = action[1];
  1338.     this.lastState = false;
  1339. }
  1340. function CSIdleAction(action) {
  1341.     idleObj = new CSIdleObject (action);
  1342.     CSStartFunction (CSDoIdle,idleObj);
  1343. }
  1344. function CSDoIdle (param) {
  1345.     idleObject=param.data;
  1346.     if (idleObject.conditionAction) {
  1347.         gCurrentIdleObject = idleObject;
  1348.         var result = CSAction(new Array(idleObject.conditionAction));
  1349.         if (result == true && idleObject.lastState==false) {
  1350.             idleObject.lastState = result;
  1351.             if (idleObject.trueAction) {
  1352.                 CSAction(new Array(idleObject.trueAction));
  1353.                 if (idleObject.exitIdleIfTrue == true) return false;
  1354.             }
  1355.         } else if (result == false && idleObject.lastState == true) {
  1356.             idleObject.lastState = false;
  1357.             if (idleObject.falseAction) {
  1358.                 CSAction(new Array(idleObject.falseAction));
  1359.             }        
  1360.         }
  1361.     }
  1362.     return true;
  1363. }
  1364.  
  1365. function CSLayerIntersect (condition)
  1366. {
  1367.     var l1,t1,r1,b1,l2,t2,r2,b2;
  1368.     if (IsIE()) {
  1369.         var layer1=document.all.tags("div")[condition[1]];
  1370.         var layer2=document.all.tags("div")[condition[2]];
  1371.         l1=layer1.style.pixelLeft; t1=layer1.style.pixelTop; r1=layer1.offsetWidth+l1; b1=layer1.offsetHeight+t1;
  1372.         l2=layer2.style.pixelLeft; t2=layer2.style.pixelTop; r2=layer2.offsetWidth+l2; b2=layer2.offsetHeight+t2;    
  1373.     } else {
  1374.         var layer1=CSNSStyl(condition[1]);
  1375.         var layer2=CSNSStyl(condition[2]);
  1376.         l1=layer1.x; t1=layer1.y; r1=layer1.clip.width+l1; b1=layer1.clip.height+t1;
  1377.         l2=layer2.x; t2=layer2.y; r2=layer2.clip.width+l2; b2=layer2.clip.height+t2;
  1378.     }
  1379.     var w = (r1 < r2 ? r1 : r2) - (l1 > l2 ? l1 : l2)
  1380.     var h = (b1 < b2 ? b1 : b2) - (t1 > t2 ? t1 : t2)
  1381.     return ((w >= 0) && (h >= 0));
  1382. }
  1383.  
  1384. CSCurrentPressedKey = -1;
  1385. function CSKeyPress(ev) {
  1386.     var code;
  1387.     if(IsIE()) CSCurrentPressedKey = event.keyCode;
  1388.     else CSCurrentPressedKey = ev.which;
  1389. }
  1390. document.onkeypress    = CSKeyPress;
  1391.  
  1392. function CSKeyCompare(condition)
  1393. {
  1394.     var eq = (condition[1] == CSCurrentPressedKey);
  1395.     if(eq)
  1396.         CSCurrentPressedKey = -1;
  1397.     return eq;
  1398. }
  1399.  
  1400. function CSTimeout (condition) {
  1401.     var result = false;
  1402.     if (typeof (gCurrentIdleObject) == "undefined")    return result;
  1403.     if (gCurrentIdleObject.lastTime) {
  1404.         var t=new Date();
  1405.         if (t.getTime() >= gCurrentIdleObject.lastTime) { 
  1406.             if (t.getTime() >= gCurrentIdleObject.nextTime) { 
  1407.                 gCurrentIdleObject.lastTime = t.getTime() + condition[1]*1000;
  1408.                 gCurrentIdleObject.nextTime = gCurrentIdleObject.lastTime + condition[1]*1000;
  1409.                 return false;
  1410.             }
  1411.             return true;
  1412.         }
  1413.     } else { 
  1414.         var t=new Date();
  1415.         gCurrentIdleObject.lastTime = t.getTime() + condition[1]*1000;
  1416.         gCurrentIdleObject.nextTime = gCurrentIdleObject.lastTime + condition[1]*1000;
  1417.     }
  1418.     return result;
  1419. }
  1420.  
  1421.  
  1422.  
  1423.  
  1424.  
  1425.  
  1426.  
  1427.  
  1428. // EOF
  1429.