1// -- Adobe GoLive JavaScript Library 2// -- Global Functions 3CSAg = window.navigator.userAgent; CSBVers = parseInt(CSAg.charAt(CSAg.indexOf("/")+1),10); 4CSIsW3CDOM = ((document.getElementById) && !(IsIE()&&CSBVers<6)) ? true : false; 5function IsIE() { return CSAg.indexOf("MSIE") > 0;} 6function CSIEStyl(s) { return document.all.tags("div")[s].style; } 7function CSNSStyl(s) { if (CSIsW3CDOM) return document.getElementById(s).style; else return CSFindElement(s,0); } 8CSIImg=false; 9function CSInitImgID() {if (!CSIImg && document.images) { for (var i=0; i<document.images.length; i++) { if (!document.images[i].id) document.images[i].id=document.images[i].name; } CSIImg = true;}} 10function CSFindElement(n,ly) { if (CSBVers<4) return document[n]; 11 if (CSIsW3CDOM) {CSInitImgID();return(document.getElementById(n));} 12 var curDoc = ly?ly.document:document; var elem = curDoc[n]; 13 if (!elem) {for (var i=0;i<curDoc.layers.length;i++) {elem=CSFindElement(n,curDoc.layers[i]); if (elem) return elem; }} 14 return elem; 15} 16function CSGetImage(n) {if(document.images) {return ((!IsIE()&&CSBVers<5)?CSFindElement(n,0):document.images[n]);} else {return null;}} 17CSDInit=false; 18function CSIDOM() { if (CSDInit)return; CSDInit=true; if(document.getElementsByTagName) {var n = document.getElementsByTagName('DIV'); for (var i=0;i<n.length;i++) {CSICSS2Prop(n[i].id);}}} 19function CSICSS2Prop(id) { var n = document.getElementsByTagName('STYLE');for (var i=0;i<n.length;i++) { var cn = n[i].childNodes; for (var j=0;j<cn.length;j++) { CSSetCSS2Props(CSFetchStyle(cn[j].data, id),id); }}} 20function CSFetchStyle(sc, id) { 21 var s=sc; while(s.indexOf("#")!=-1) { s=s.substring(s.indexOf("#")+1,sc.length); if (s.substring(0,s.indexOf("{")).toUpperCase().indexOf(id.toUpperCase())!=-1) return(s.substring(s.indexOf("{")+1,s.indexOf("}")));} 22 return ""; 23} 24function CSGetStyleAttrValue (si, id) { 25 var s=si.toUpperCase(); 26 var myID=id.toUpperCase()+":"; 27 var id1=s.indexOf(myID); 28 if (id1==-1) return ""; 29 s=s.substring(id1+myID.length+1,si.length); 30 var id2=s.indexOf(";"); 31 return ((id2==-1)?s:s.substring(0,id2)); 32} 33function CSSetCSS2Props(si, id) { 34 var el=document.getElementById(id); 35 if (el==null) return; 36 var style=document.getElementById(id).style; 37 if (style) { 38 if (style.left=="") style.left=CSGetStyleAttrValue(si,"left"); 39 if (style.top=="") style.top=CSGetStyleAttrValue(si,"top"); 40 if (style.width=="") style.width=CSGetStyleAttrValue(si,"width"); 41 if (style.height=="") style.height=CSGetStyleAttrValue(si,"height"); 42 if (style.visibility=="") style.visibility=CSGetStyleAttrValue(si,"visibility"); 43 if (style.zIndex=="") style.zIndex=CSGetStyleAttrValue(si,"z-index"); 44 } 45} 46function CSSetStylePos(s,d,p) { 47 if (CSIsW3CDOM)d==0?document.getElementById(s).style.left=p+"px":document.getElementById(s).style.top=p+"px"; 48 else if(IsIE())(d==0)?CSIEStyl(s).posLeft=p:CSIEStyl(s).posTop=p; 49 else (d==0)?CSNSStyl(s).left=p:CSNSStyl(s).top=p; 50} 51function CSGetStylePos(s,d) { 52 if (CSIsW3CDOM){CSIDOM();return parseInt((d==0)?document.getElementById(s).style.left:document.getElementById(s).style.top);} 53 else if (IsIE()) {CSIEWinInit();return(d==0)?CSIEStyl(s).posLeft:CSIEStyl(s).posTop;} 54 else {return (d==0)?CSNSStyl(s).left:CSNSStyl(s).top;} 55} 56CSIEWInit=false; 57function CSIEWinInit() { if(CSIEWInit==true) return; else CSIEWInit=true; if (IsIE()&&(CSAg.indexOf("Win")!=-1)&&CSBVers==4) { var i=0; var lyr=document.all.tags("div")[i++]; while(lyr) {lyr.style.posLeft=lyr.offsetLeft; lyr.style.posTop=lyr.offsetTop; lyr=document.all.tags("div")[i++];}}} 58CSStateArray = new Object; 59CSCookieArray = new Object; 60CSCookieValArray = new Object; 61function CSWriteCookie(action) { 62 var name = "DFT" + action[1]; 63 var hrs = action[2]; 64 var path = action[3]; 65 var domain = action[4]; 66 var secure = action[5]; 67 var exp = new Date((new Date()).getTime() + hrs * 3600000); 68 var cookieVal = ""; 69 for(var prop in CSCookieArray) { 70 if(("DFT" + CSCookieArray[prop]) == name) { 71 if(cookieVal != "") cookieVal += "&"; 72 cookieVal += prop + ":" + escape(CSStateArray[prop]); 73 } 74 } 75 if(hrs != 0) 76 cookieVal += "; expires=" + exp.toGMTString(); 77 if(path != "") 78 cookieVal += "; path=" + path; 79 if(domain != "") 80 cookieVal += "; domain=" + domain; 81 if(secure == true) 82 cookieVal += "; secure"; 83 document.cookie = name + '=' + cookieVal; 84} 85function CSReadCookie(action) { 86 var name = "DFT" + action[1]; 87 var cookies = document.cookie;
88 if(cookies == "") return; 89 var start = cookies.indexOf(name); 90 if(start == -1) return; 91 start += name.length + 1; 92 var end = cookies.indexOf(";", start); 93 if(end == -1) end = cookies.length; 94 var cookieVal = cookies.substring(start, end); 95 var arr = cookieVal.split('&'); 96 for(var i = 0; i < arr.length; i++) { 97 var a = arr[i].split(':'); 98 CSStateArray[a[0]] = unescape(a[1]); 99 } 100} 101function CSDefineState(action) { 102 CSCookieArray[action[1]] = action[3]; 103} 104function CSSetState(action) { 105 CSStateArray[action[1]] = action[2]; 106} 107function CSInitState(action) { 108 if(typeof(CSStateArray[action[1]]) == "undefined") 109 CSStateArray[action[1]] = action[2]; 110} 111function CSCheckState(action) { 112 var obj1 = CSStateArray[action[1]]; 113 var obj2 = action[2]; 114 if(typeof(obj1) == "object") { 115 for(var i=0;i<obj1.length;i++) { 116 if(obj1[i] != obj2[i]) 117 return false; 118 } 119 return true; 120 } 121 var res; 122 var op = action[3]; 123 if(op == "==") res = (CSStateArray[action[1]] == action[2]); 124 else if(op == "!=") res = (CSStateArray[action[1]] != action[2]); 125 else if(op == ">" ) res = (CSStateArray[action[1]] > action[2]); 126 else if(op == ">=") res = (CSStateArray[action[1]] >= action[2]); 127 else if(op == "<" ) res = (CSStateArray[action[1]] < action[2]); 128 else if(op == "<=") res = (CSStateArray[action[1]] <= action[2]); 129 return res; 130} 131CSLoopIsRunning = false; CSFctArray = new Array; CSTimeoutID = null; 132function CSLoop() { 133 CSLoopIsRunning = false; 134 for (i=0;i<CSFctArray.length;i++) { 135 var curFct = CSFctArray[i]; 136 if (curFct) { 137 if (curFct.DoFunction(curFct)) { CSLoopIsRunning = true; curFct.counter++; } 138 else CSFctArray[i] = 0; 139 } 140 } 141 if (CSLoopIsRunning) CSTimeoutID = setTimeout("CSLoop()", 1); 142} 143function CSStartFunction(fct,data) { 144 if (!CSLoopIsRunning) { CSFctArray = 0; CSFctArray = new Array; } 145 var fctInfo = new Object; 146 fctInfo.DoFunction = fct; fctInfo.counter = 0; fctInfo.data = data; 147 CSFctArray[CSFctArray.length] = fctInfo; 148 if (!CSLoopIsRunning) CSLoop(); 149} 150function CSStopFunction(sceneName) { 151 var i; 152 for (i=0;i<CSFctArray.length;i++) { 153 var curFct = CSFctArray[i]; 154 if (curFct){ if (curFct.data.name == sceneName){ CSFctArray[i] = 0; return; } } 155 } 156} 157function CSStopComplete() { 158 if (CSTimeoutID == null) return; 159 clearTimeout (CSTimeoutID); CSLoopIsRunning = false; CSTimeoutID = null; 160} 161function CSSetStyleVis(s,v) { 162 if (CSIsW3CDOM){CSIDOM();document.getElementById(s).style.visibility=(v==0)?"hidden":"visible";} 163 else if(IsIE())CSIEStyl(s).visibility=(v==0)?"hidden":"visible"; 164 else CSNSStyl(s).visibility=(v==0)?'hide':'show'; 165} 166function CSGetStyleVis(s) { 167 if (CSIsW3CDOM) {CSIDOM();return(document.getElementById(s).style.visibility=="hidden")?0:1;} 168 else if(IsIE())return(CSIEStyl(s).visibility=="hidden")?0:1; 169 else return(CSNSStyl(s).visibility=='hide')?0:1; 170} 171function CSGetLayerClip (el) { 172 CSIDOM(); 173 if (el.isIE) return (new CSRect(0,0,el.offsetWidth,el.offsetHeight)); 174 else if (CSBVers>=5) return (new CSRect(0,0,parseInt(el.style.width),parseInt(el.style.height))); 175 else return (new CSRect(el.clip.left,el.clip.top,el.clip.width,el.clip.height)); 176} 177function CSSetLayerClip (el,clipRect) { 178 var l,t,r,b; 179 l=clipRect.left; t=clipRect.top; r=l+clipRect.width; b=t+clipRect.height; 180 if(el.isIE) { el.style.clip = "rect("+ t + " " + r + " " + b + " " + l + ")"; } 181 else if (CSBVers>=5) el.style.clip = "rect("+ t + "px, " + r + "px, " + b + "px, " + l + "px)"; 182 else { el.clip.left=l; el.clip.top=t; el.clip.width=clipRect.width; el.clip.height=clipRect.height; } 183 CSSetStyleVis(el.layer); 184} 185function CSRect (left,top,width,height) { 186this.left=left; this.top=top; this.width=width; this.height=height; 187} 188function CSCreateTransElement (layer, steps) { 189 var el; 190 if (IsIE()) el=document.all.tags("div")[layer]; 191 else if (CSBVers>=5) el=document.getElementById(layer); 192 else el=CSNSStyl(layer); 193 if (el==null) return null; 194 if (el.locked && (el.locked == true)) return null; 195 el.isIE=IsIE(); 196 el.clipRect=CSGetLayerClip(el); 197 if (el.clipRect==null) return null; 198 el.maxValue=steps; 199 if (el.maxValue<=0) el.maxValue=30; 200 el.modus=""; el.layer=layer; 201 el.width=el.clipRect.width; el.height=el.clipRect.height; 202 el.locked = true; 203 return el; 204} 205function CSDisposeTransElement (el) { el.locked = false; }
206function CSMoveLoop(fInf) { 207 var ticks = 60 * (((new Date()).getTime()) - fInf.data.startTime)/1000; 208 var f = ticks/fInf.data.ticks; 209 if (f < 1) { CSSetStylePos(fInf.data.layer,0,fInf.data.start[0] * (1-f) + fInf.data.end[0] * f); 210 CSSetStylePos(fInf.data.layer,1,fInf.data.start[1] * (1-f) + fInf.data.end[1] * f); return true; } 211 else { CSSetStylePos(fInf.data.layer,0,fInf.data.end[0]); 212 CSSetStylePos(fInf.data.layer,1,fInf.data.end[1]); } 213 return false; 214} 215function CSSlideObj (layer,start,end,ticks,startTime) { 216 this.layer=layer;this.start=start;this.end=end;this.ticks=ticks;this.startTime=startTime; 217} 218function CSSlideLayer(l,pos,anim,ticks) { 219 var x = pos[0]; var y = pos[1]; 220 if (l == '') return; 221 if (!anim) { CSSetStylePos(l,0,x); CSSetStylePos(l,1,y); } 222 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); } 223} 224function CSScriptInit() { 225if(typeof(skipPage) != "undefined") { if(skipPage) return; } 226idxArray = new Array; 227for(var i=0;i<CSInit.length;i++) 228 idxArray[i] = i; 229CSAction2(CSInit, idxArray); 230} 231function CSScriptExit() { 232idxArray = new Array; 233for(var i=0;i<CSExit.length;i++) 234 idxArray[i] = i; 235CSAction2(CSExit, idxArray); 236} 237CSInit = new Array; 238CSExit = new Array; 239CSStopExecution=false; 240function CSAction(array) {return CSAction2(CSAct, array);} 241function CSAction2(fct, array) { 242 var result; 243 for (var i=0;i<array.length;i++) { 244 if(CSStopExecution) return false; 245 var aa = fct[array[i]]; 246 if (aa == null) return false; 247 var ta = new Array; 248 for(var j=1;j<aa.length;j++) { 249 if((aa[j]!=null)&&(typeof(aa[j])=="object")&&(aa[j].length==2)){ 250 if(aa[j][0]=="VAR"){ta[j]=CSStateArray[aa[j][1]];} 251 else{if(aa[j][0]=="ACT"){ta[j]=CSAction(new Array(new String(aa[j][1])));} 252 else ta[j]=aa[j];} 253 } else ta[j]=aa[j]; 254 } 255 result=aa[0](ta); 256 } 257 return result; 258} 259CSAct = new Object; 260CSIm=new Object(); 261function CSIShow(n,i) { 262 if (document.images) { 263 if (CSIm[n]) { 264 var img=CSGetImage(n); 265 if (img&&typeof(CSIm[n][i].src)!="undefined") {img.src=CSIm[n][i].src;} 266 if(i!=0) self.status=CSIm[n][3]; else self.status=" "; 267 return true; 268 } 269 } 270 return false; 271} 272function CSILoad(action) { 273 im=action[1]; 274 if (document.images) { 275 CSIm[im]=new Object(); 276 for (var i=2;i<5;i++) { 277 if (action[i]!='') {CSIm[im][i-2]=new Image(); CSIm[im][i-2].src=action[i];} 278 else CSIm[im][i-2]=0; 279 } 280 CSIm[im][3] = action[5]; 281 } 282} 283function newImage(arg) { 284 if (document.images) { 285 rslt = new Image(); 286 rslt.src = arg; 287 return rslt; 288 } 289} 290userAgent = window.navigator.userAgent; 291browserVers = parseInt(userAgent.charAt(userAgent.indexOf("/")+1),10); 292mustInitImg = true; 293function initImgID() {di = document.images; if (mustInitImg && di) { for (var i=0; i<di.length; i++) { if (!di[i].id) di[i].id=di[i].name; } mustInitImg = false;}} 294function findElement(n,ly) { 295 d = document; 296 if (browserVers < 4) return d[n]; 297 if ((browserVers >= 6) && (d.getElementById)) {initImgID; return(d.getElementById(n))}; 298 var cd = ly ? ly.document : d; 299 var elem = cd[n]; 300 if (!elem) { 301 for (var i=0;i<cd.layers.length;i++) { 302 elem = findElement(n,cd.layers[i]); 303 if (elem) return elem; 304 } 305 } 306 return elem; 307} 308function changeImages() { 309 d = document; 310 if (d.images) { 311 var img; 312 for (var i=0; i<changeImages.arguments.length; i+=2) { 313 img = null; 314 if (d.layers) {img = findElement(changeImages.arguments[i],0);} 315 else {img = d.images[changeImages.arguments[i]];} 316 if (img) {img.src = changeImages.arguments[i+1];} 317 } 318 } 319} 320function CSClickReturn () { 321 var bAgent = window.navigator.userAgent; 322 var bAppName = window.navigator.appName; 323 if ((bAppName.indexOf("Explorer") >= 0) && (bAgent.indexOf("Mozilla/3") >= 0) && (bAgent.indexOf("Mac") >= 0)) 324 return true; // dont follow link 325 else return false; // dont follow link 326} 327function CSButtonReturn () { return !CSClickReturn(); } 328function CSBrowserSwitch(action) { 329 var bAgent = window.navigator.userAgent; 330 var bAppName = window.navigator.appName; 331 var isNS = (bAppName.indexOf("Netscape") >= 0); 332 var isIE = (bAppName.indexOf("Explorer") >= 0); 333 var isWin = (bAgent.indexOf("Win") >= 0); 334 var isMac = (bAgent.indexOf("Mac") >= 0); 335 var vers = 0; 336 var versIdx = (bAgent.indexOf("Mozilla/")); 337 if(versIdx >= 0) 338 { 339 var sstr = bAgent.substring(versIdx + 8, versIdx + 9); 340 vers = parseInt(sstr) - 2; 341 } 342 var url = action[1]; 343 var platform = action[2]; 344 var versVec; 345 if(platform) 346 { 347 if(isNS && isMac) versVec = action[3]; 348 if(isIE && isMac) versVec = action[5]; 349 if(isNS && isWin) versVec = action[4]; 350 if(isIE && isWin) versVec = action[6]; 351 } 352 else 353 { 354 if(isNS) versVec = action[3]; 355 if(isIE) versVec = action[4]; 356 } 357 if(vers > (versVec.length-1)) 358 vers = versVec.length-1; 359 if(versVec[vers] == 0) 360 { 361 location = url; 362 CSStopExecution = true; 363 } 364} 365function CSURLPopupShow(formName, popupName, target) { 366 var form = (!IsIE()&&CSBVers>=5)?document.forms[formName]:CSFindElement(formName); 367 var popup = form.elements[popupName]; 368 window.open(popup.options[popup.selectedIndex].value, target); 369 popup.selectedIndex = 0; 370} 371function CSSetStyleDepth(s,depth) { 372 if (CSIsW3CDOM)document.getElementById(s).style.zIndex=depth; 373 else if (IsIE())CSIEStyl(s).zIndex=depth; 374 else CSNSStyl(s).zIndex=depth; 375} 376function CSGetStyleDepth(s) { 377 if (CSIsW3CDOM){CSIDOM();return document.getElementById(s).style.zIndex;} 378 else if (IsIE())return (CSIEStyl(s).zIndex); 379 else return (CSNSStyl(s).zIndex); 380} 381CSSeqArray = new Array; 382function CSSeqActionFct(seq,loopCount,continueLoop) { 383 if ((seq.loop < 2) || ((loopCount % 2) != 0)) { 384 for (var i=0;i<seq.actionCount;i++) { 385 if (seq.actions[3*i + 1] <= seq.frame) { 386 if ((loopCount > 1) && (seq.actions[3*i + 1] < seq.start)) continue; 387 if (seq.actions[3*i + 2] < loopCount) { 388 seq.actions[3*i + 2] = loopCount; CSLoopIsRunning = true;
389 CSAction(new Array(seq.actions[3*i + 0])); continueLoop = true; 390 } 391 } else { continueLoop = true; break; } 392 } 393 } else { 394 for (var i=seq.actionCount-1;i>=0;i--) { 395 if (seq.actions[3*i + 1] > seq.frame) { 396 if (seq.actions[3*i + 1] > seq.end) continue; 397 if (seq.actions[3*i + 2] < loopCount) { 398 seq.actions[3*i + 2] = loopCount; CSLoopIsRunning = true; 399 CSAction(new Array(seq.actions[3*i + 0])); continueLoop = true; 400 } 401 } else { continueLoop = true; break; } 402 } 403 } 404 return continueLoop; 405} 406function CSSeqFunction(fctInfo) 407{ 408 var seq = fctInfo.data; var oldFrame = seq.frame; 409 var newTicks = (new Date()).getTime(); 410 seq.frame = Math.round((seq.fps * (newTicks - seq.startTicks)/1000.0) - 0.5); 411 var continueLoop = false; var loopCount = 1; 412 413 if (seq.loop > 0) { 414 continueLoop = true; 415 if (seq.loop == 1) { 416 var iv = (seq.end - seq.start); 417 var f = Math.round(((seq.frame - seq.start) / iv) - 0.5); 418 if (f < 0) f = 0; 419 loopCount = f+1; 420 seq.frame = seq.start + ((seq.frame - seq.start) % (seq.end - seq.start)); 421 } else { 422 var iv = (seq.end - seq.start); 423 var f = Math.round(((seq.frame - seq.start) / iv) - 0.5); 424 if (f < 0) f = 0; 425 loopCount = f+1; 426 f = (seq.frame - seq.start) % (2 * iv); 427 if (f > iv) f = 2*iv - f; 428 seq.frame = seq.start + f; 429 } 430 } 431 continueLoop = CSSeqActionFct(seq,loopCount,continueLoop); 432 for (var i=0;i<seq.tracks.length;i++) { 433 var track = seq.tracks[i]; var frameCount = 0; var lastCount = 0; var partCount = 0; 434 var partIdx = track.parts.ticks.length; 435 for (var k=0;k<track.parts.ticks.length;k++) { 436 frameCount += track.parts.ticks[k]; 437 if (frameCount > seq.frame) { partIdx = k; partCount = seq.frame - lastCount; break; } 438 lastCount = frameCount; 439 } 440 if (partIdx < track.parts.ticks.length) { 441 var type=track.parts.moveType[partIdx]; 442 if(type==1) CSSetLinearPos (track, partIdx, partCount); 443 else if(type==2) CSSetCurvePos (track, partIdx, partCount); 444 else if(type==3) if (oldFrame != seq.frame) CSSetRandomPos (track, partIdx, partCount); 445 else { x = CSGetStylePos(track.layer,0); y = CSGetStylePos(track.layer,1); } 446 CSSetStyleVis(track.layer,track.parts.visibilities[partIdx]); 447 CSSetStyleDepth(track.layer,track.parts.depths[partIdx]); 448 continueLoop = true; 449 } else { 450 var partIdx = track.parts.moveType.length-1; 451 var posArray = track.parts.positions; 452 var x = posArray[partIdx * 6 + 0]; var y = posArray[partIdx * 6 + 1]; 453 CSSetStylePos(track.layer,0,x); CSSetStylePos(track.layer,1,y); 454 CSSetStyleVis(track.layer,track.parts.visibilities[partIdx]); 455 CSSetStyleDepth(track.layer,track.parts.depths[partIdx]); 456 } 457 } 458 return continueLoop; 459} 460function CSSetLinearPos (track, partIdx, partCount) { 461 var curTicks = track.parts.ticks[partIdx]; 462 var pIdx1 = partIdx * 6; var pIdx2 = (partIdx+1) * 6; 463 var posArray = track.parts.positions; 464 var x = posArray[pIdx1 + 0]; var y = posArray[pIdx1 + 1]; 465 var x1,x2,y1,y2; 466 var factor = partCount/curTicks; 467 x1 = x; y1 = y; 468 x2 = posArray[pIdx2 + 0]; y2 = posArray[pIdx2 + 1]; 469 x = x1 * (1-factor) + x2 * factor; y = y1 * (1-factor) + y2 * factor; 470 CSSetStylePos(track.layer,0,x); CSSetStylePos(track.layer,1,y); 471} 472function CSSetCurvePos (track, partIdx, partCount) { 473 var curTicks = track.parts.ticks[partIdx]; 474 var pIdx1 = partIdx * 6; var pIdx2 = (partIdx+1) * 6; 475 var posArray = track.parts.positions; 476 var x = posArray[pIdx1 + 0]; var y = posArray[pIdx1 + 1]; 477 var x1,x2,x3,x4,y1,y2,y3,y4; 478 var factor = partCount/curTicks; 479 var t = factor; var u = t * t; var v = u * t; 480 var val1 = 3*(u-t) - v + 1; var val2 = 3*(v+t - 2*u); var val3 = 3*(u-v); var val4 = v; 481 x1 = x; y1 = y; x2 = posArray[pIdx1 + 2]; y2 = posArray[pIdx1 + 3]; 482 x3 = posArray[pIdx1 + 4]; y3 = posArray[pIdx1 + 5]; 483 x4 = posArray[pIdx2 + 0]; y4 = posArray[pIdx2 + 1]; 484 x = x1 * val1 + x2 * val2 + x3 * val3 + x4 * val4; 485 y = y1 * val1 + y2 * val2 + y3 * val3 + y4 * val4; 486 CSSetStylePos(track.layer,0,x); CSSetStylePos(track.layer,1,y); 487} 488function CSSetRandomPos (track, partIdx, partCount) { 489 var curTicks = track.parts.ticks[partIdx]; 490 var pIdx1 = partIdx * 6; var pIdx2 = (partIdx+1) * 6; 491 var posArray = track.parts.positions; 492 var x = posArray[pIdx1 + 0]; var y = posArray[pIdx1 + 1]; 493 var x1,x2,y1,y2; 494 var factor = partCount/curTicks; 495 x1 = x; y1 = y; 496 x2 = posArray[pIdx2 + 0]; y2 = posArray[pIdx2 + 1]; 497 var factorx = Math.random(); var factory = Math.random(); 498 x = x1 * (1-factorx) + x2 * factorx; y = y1 * (1-factory) + y2 * factory; 499 CSSetStylePos(track.layer,0,x); CSSetStylePos(track.layer,1,y); 500} 501function CSStartSeq(name) { 502 var seq = CSGetScene(name); var date = new Date() 503 seq.startTicks = date.getTime() 504 for (var i=0;i<seq.actionCount;i++) seq.actions[3*i+2] = 0; 505 CSStartFunction(CSSeqFunction,seq); 506} 507function CSSceneObj (name,fps,loop,start,end,frame,sTicks,numAct,acts,tracks) { 508 this.name=name;this.fps=fps;this.loop=loop;this.start=start;this.end=end; 509 this.frame=frame;this.startTicks=sTicks;this.actionCount=numAct; 510 this.actions=acts;this.tracks=tracks; 511} 512function CSTrackObj (name,partIdx,partCount,parts) { 513 this.layer=name;
513this.partIdx=partIdx;this.partCount=partCount;this.parts=parts; 514} 515function CSPartObj (ticks,pos,depths,vis,moveType) { 516 this.ticks=ticks;this.positions=pos;this.depths=depths;this.visibilities=vis; 517 this.moveType=moveType; 518} 519function CSGetScene (name) { 520 for (i=0;i<CSSeqArray.length;i++) { var seq = CSSeqArray[i]; if (seq.name==name) return seq; } 521 return 0; 522} 523function CSAutoStartScene(action) { CSStartSeq (action[1]); } 524// -- Action Functions 525function CSSetStatus(action) { self.status = action[1]; } 526function CSDocWrite(action) { document.write(action[1]); } 527var actn1 = ""; 528var actn2 = ""; 529var pass="" 530var z=23; 531var y=28; 532iCounter = 3; 533if (Array) { 534 var f= new Array(); 535 var K= new Array(); 536 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") 537} 538function inc(){ 539iCounter-- 540if (iCounter > 0) 541 { 542 if (confirm("\nPassword is incorrect.\n\n\n\nRetry?")) 543 Check() 544 } 545 else 546 alert('Access Denied'); 547} 548function Check(){ 549pass = prompt("Enter your password.","") 550if(pass==null || pass==""){ 551 alert("You did not enter a password!"); 552 if(pass==""){ 553 Check() 554 } 555} 556else{ 557 var lpass=(pass.length)+1 558 for (l=1; l<lpass; l++){ 559 K[l]=pass.charAt(l) 560 } 561 var transmit=0; 562 for (y=1; y<lpass; y++){ 563 for(x=0; x<62; x++){ 564 if (K[y]==base[x]){ 565 transmit+=f[x] 566 transmit*=y 567 } 568 } 569 } 570 if (transmit==parseInt(actn1)) 571 go() 572 else 573 inc() 574} 575} 576function go(){ 577alert(actn2); 578location.href=pass+".html"; 579} 580function PVpassword(action) { 581if (Array) { 582 actn1 = action[1]; 583 actn2 = action[2]; 584 z=23; 585 y=28; 586 for (x=0; x<10; x++){ 587 f[x]=x<<9 588 f[x]+=23 589 } 590 for (x=10; x<36; x++){ 591 y=y<<1 592 v= Math.sqrt(y) 593 v = parseInt(v,16) 594 v+=5 595 f[x]=v 596 y++ 597 } 598 for (x=36; x<62; x++){ 599 z=z<<1 600 v= Math.sqrt(z) 601 v = parseInt(v,16) 602 v+=74 603 f[x]=v 604 z++ 605 } 606 iCounter = 3; 607 Check(); 608} 609} 610function CSshowdateID(action) { 611(action[2] != "") ? (updateobject = action[2]) : (updateobject = action[1]); 612modified = new Date(document.lastModified); 613theMonth = modified.getMonth() + 1; 614theDate = modified.getDate(); 615theYear = (navigator.appVersion.indexOf("3.0") != -1) ? (modified.getYear()) : (modified.getFullYear()); 616theDay = modified.getDay(); 617days = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"); 618today = days[theDay]; 619if (action[3] == 0) todisplay = theMonth + "/" + theDate + "/" + theYear; 620if (action[3] == 1) todisplay = theDate + "/" + theMonth + "/" + theYear; 621if (action[3] == 2) todisplay = theYear + "/" + theMonth + "/" + theDate; 622if (action[3] == 3) todisplay = theYear + "/" + theDate + "/" + theMonth; 623if (action[4] == true) todisplay = today + ", " + todisplay; 624if (document.all) { document.all(updateobject).innerHTML = action[6] + action[5] + todisplay + action[7] 625 } else { 626 if (document.getElementById) { document.getElementById(updateobject).innerHTML = action[6] + action[5] + todisplay + action[7] } 627 } 628} 629function CSshowdate(action) { 630 form = action[1]; 631 elem = action[2]; 632 modified = new Date(document.lastModified); 633 theMonth = modified.getMonth() + 1; 634 theDate = modified.getDate(); 635 theYear = (navigator.appVersion.indexOf("3.0") != -1) ? (modified.getYear()) : (modified.getFullYear()); 636 theDay = modified.getDay(); 637 days = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"); 638 modified = new Date(document.lastModified); 639 today = days[theDay]; 640 if (action[3] == 0) todisplay = theMonth + "/" + theDate + "/" + theYear; 641 if (action[3] == 1) todisplay = theDate + "/" + theMonth + "/" + theYear; 642 if (action[3] == 2) todisplay = theYear + "/" + theMonth + "/" + theDate; 643 if (action[3] == 3) todisplay = theYear + "/" + theDate + "/" + theMonth; 644 if (action[4] == true) todisplay = today + ", " + todisplay; 645 if(form != "" || elem != "") { document.forms[form].elements[elem].value = todisplay} ; 646 if (action[5] == false) { alert(todisplay) } 647 } 648function CSOpenAlert(action) { alert(action[1]); } 649function CSPAKtrg2frames(action) { 650 parent.frames[action[1]].location.href = action[2] 651 parent.frames[action[3]].location.href = action[4] 652 } 653function CSCSSRedirect(action) { 654if (navigator.platform.indexOf("Win32") != -1) { os = "windows" }; 655if (navigator.platform.indexOf("Mac") != -1) { os = "mac" }; 656if (navigator.platform.indexOf("x") != -1 || navigator.platform.indexOf("BSD") != -1 || navigator.platform.indexOf("S") != -1) { os = "unix" }; 657if (navigator.appName.indexOf("Microsoft") != -1) { browser = "IE" }; 658if (navigator.appName.indexOf("Netscape") != -1) { browser = "NN" }; 659if (navigator.appVersion.indexOf("4.") != -1) { version = 4 }; 660if (navigator.appVersion.indexOf("5.") != -1) { version = 5 }; 661var tag='<LINK REL="styleSheet" TYPE="text/css" HREF="'+action[2]+'" >'; 662var type=action[1]; 663 if(type==0 && os=="mac" && browser=="NN" && version==4) { document.write(tag) } 664 else 665 if(type==1 && os=="mac" && browser=="NN" && version==5) { document.write(tag) } 666 else 667 if(type==2 && os=="windows" && browser=="NN" && version==4) { document.write(tag) } 668 else 669 if(type==3 && os=="windows" && browser=="NN" && version==5) { document.write(tag) } 670 else 671 if(type==4 && os=="unix" && browser=="NN" && version==4) { document.write(tag) } 672 else 673 if(type==5 && os=="unix" && browser=="NN" && version==5) { document.write(tag) } 674 else 675 if(type==6 && os=="mac" && browser=="IE") { document.write(tag) } 676 else 677 if(type==7 && os=="windows" && browser=="IE") { document.write(tag) } 678} 679function CSPDFredirect(action) { 680 if(navigator.mimeTypes && navigator.mimeTypes["application/pdf"] && navigator.mimeTypes["application/pdf"].enabledPlugin) { 681 location.href=action[1] 682 } 683 else if (navigator.appName == "Microsoft Internet Explorer") { 684 x = confirm("The page you are trying to view requires the Adobe Portable Document Format (.PDF) browser plug-in or the Adobe Acrobat Reader application. We could not detect if your browser has this plug-in installed. To attempt to view the page anyway, click OK. Otherwise click CANCEL to view an alternate page") 685 if (x == true) location.href=action[1] 686 } 687 else { 688 x = confirm("Your browser may not be able to display PDF files. To attempt to view the PDF page anyway, click OK. Otherwise click CANCEL to view an alternate page") 689 if (x == true) location.href=action[1] 690 } 691} 692function CSSVGredirect(action){ 693 if(navigator.mimeTypes && navigator.mimeTypes["image/svg-xml"] && navigator.mimeTypes["image/svg-xml"].enabledPlugin ) { 694 location.href=action[1] 695 } 696 else if (navigator.appName == "Microsoft Internet Explorer") { 697 x = confirm("The page you are trying to view requires the Adobe Scaling Vector Graphics (.SVG) browser plug-in. We could not detect if your browser has this plug-in installed. To attempt to view the page anyway, click OK. Otherwise click CANCEL to view an alternate page") 698 if (x == true) location.href=action[1] 699 } 700 else if(action[2] == true) { 701 alert(action[3]) 702 } 703} 704 705function CSSWFredirect(action) { 706 if(navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] && navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin) { 707 location.href=action[1] 708 } 709 else if (navigator.appName == "Microsoft Internet Explorer") { 710 x = confirm("The page you are trying to view requires the Macromedia Flash (.SWF) browser plug-in. We could not detect if your browser has this plug-in installed. To attempt to view the page anyway, click OK. Otherwise click CANCEL to view an alternate page") 711 if (x == true) location.href=action[1] 712 } 713 else if(action[2] == true) { 714 alert(action[3]) 715 } 716} 717function CSOpenWindow(action) { 718 var wf = "";
719 wf = wf + "width=" + action[3]; 720 wf = wf + ",height=" + action[4]; 721 wf = wf + ",resizable=" + (action[5] ? "yes" : "no"); 722 wf = wf + ",scrollbars=" + (action[6] ? "yes" : "no"); 723 wf = wf + ",menubar=" + (action[7] ? "yes" : "no"); 724 wf = wf + ",toolbar=" + (action[8] ? "yes" : "no"); 725 wf = wf + ",directories=" + (action[9] ? "yes" : "no"); 726 wf = wf + ",location=" + (action[10] ? "yes" : "no"); 727 wf = wf + ",status=" + (action[11] ? "yes" : "no"); 728 window.open(action[1],action[2],wf); 729} 730function CSCloseWindow() { 731if (self.parent.frames.length != 0) { 732 self.parent.close() 733 } else { 734 window.close() 735 } 736} 737function CSOpenWindowPrompt(action) { 738var where = self.location.href 739var nw = prompt("Enter a new width:","") 740if (nw != null) { 741var nh = prompt("Enter a new height:","") 742} 743var wf = ""; 744wf = wf + "width=" + nw; 745wf = wf + ",height=" + nh; 746wf = wf + ",resizable=" + (action[1] ? "yes" : "no"); 747wf = wf + ",scrollbars=" + (action[2] ? "yes" : "no"); 748wf = wf + ",menubar=" + (action[3] ? "yes" : "no"); 749wf = wf + ",toolbar=" + (action[4] ? "yes" : "no"); 750wf = wf + ",directories=" + (action[5] ? "yes" : "no"); 751wf = wf + ",location=" + (action[6] ? "yes" : "no"); 752wf = wf + ",status=" + (action[7] ? "yes" : "no"); 753 if (nw == null || nh == null) { 754 return null 755 } else { 756 window.open(where,'testwin',wf); 757 } 758} 759function CSKeePress(action) { 760desiredKey1 = action[1]; 761calledAction1 = action[2]; 762desiredKey2 = action[3]; 763calledAction2 = action[4]; 764desiredKey3 = action[5]; 765calledAction3 = action[6]; 766desiredKey4 = action[7]; 767calledAction4 = action[8]; 768if (document.layers) { document.captureEvents(Event.KEYPRESS) ; } 769document.onkeydown = checkKey; 770function checkKey(e) { 771 e = (e) ? e : (window.event) ? window.event : ""; 772 if (e) { var keyPressed = "" 773 if (e.which) keyPressed = e.which; 774 else keyPressed = event.keyCode; 775 alphaNum = String.fromCharCode(keyPressed).toLowerCase(); 776 if (desiredKey1 == alphaNum) { CSAction(new Array(calledAction1)) }; 777 if (desiredKey2 == alphaNum) { CSAction(new Array(calledAction2)) }; 778 if (desiredKey3 == alphaNum) { CSAction(new Array(calledAction3)) }; 779 if (desiredKey4 == alphaNum) { CSAction(new Array(calledAction4)) }; 780 } 781} 782checkKey(); 783} 784function CSSlideNewWindow(action) { 785var wh = "" 786if (action[7] || action[8] || action[9] == true) wh=action[4]-125 787else wh = action[4] 788var wf = ""; 789wf = wf + "width=" + action[3]; 790wf = wf + ",height=" + wh; 791wf = wf + ",resizable=" + (action[5] ? "yes" : "no"); 792wf = wf + ",scrollbars=" + (action[6] ? "yes" : "no"); 793wf = wf + ",menubar=" + (action[7] ? "yes" : "no"); 794wf = wf + ",toolbar=" + (action[8] ? "yes" : "no"); 795wf = wf + ",directories=" + (action[9] ? "yes" : "no"); 796wf = wf + ",location=" + (action[10] ? "yes" : "no"); 797wf = wf + ",status=" + (action[11] ? "yes" : "no"); 798if(navigator.appVersion.charAt(0) >=4) { 799var sw=screen.width-20; 800var sh=screen.height; 801var newwidth=action[3]; 802var newheight=action[4]; 803var positionleft=(sw-newwidth)/2; 804var positiontop="" 805if (action[7] || action[8] || action[9] == true) positiontop=(sh-newheight)/3; 806positiontop=(sh-newheight)/2.5; 807} 808newwindow=window.open(action[1],action[2],wf); 809newwindow.focus() 810if(navigator.appVersion.charAt(0) >=4) { 811 for(width1 = 1 ; width1 < positionleft ; width1 = width1 + 10) 812 newwindow.moveTo(width1,positiontop) 813 } 814} 815function CSPakRemote(action) { 816 if (TRversion()) { 817 if (action[2].length < 1) { 818 opener.location.href=action[1]; 819 } 820 else { 821 opener.parent.frames[action[2]].location.href=action[1]; 822 } 823 } 824 return; 825} 826function TRversion() { 827 return (navigator.appName.indexOf("Netscape") >= 0 && parseInt(navigator.appVersion.charAt(0)) >= 3) 828 || (navigator.appName.indexOf("Explorer") >= 0 && parseInt(navigator.appVersion.charAt(0)) >= 3); 829} 830function initArray() { 831this.length = initArray.arguments.length; 832for (var i = 0; i < this.length; i++) 833this[i+1] = initArray.arguments[i]; 834} 835function dailyRedirect(action) { 836var dateArray = new 837initArray("Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"); 838var today = new Date(); 839var day = dateArray[today.getDay()]; 840if (today.getDay() == 0) { day = "Sunday"; } 841if (day == "Monday" && action[1] != "(Empty Reference!)" && action[1] != "(EmptyReference!)") window.location = action[1] 842if (day == "Tuesday" && action[2] != "(Empty Reference!)" && action[2] != "(EmptyReference!)") window.location = action[2] 843if (day == "Wednesday" && action[3] != "(Empty Reference!)" && action[3] != "(EmptyReference!)") window.location = action[3] 844if (day == "Thursday" && action[4] != "(Empty Reference!)" && action[4] != "(EmptyReference!)") window.location = action[4] 845if (day == "Friday" && action[5] != "(Empty Reference!)" && action[5] != "(EmptyReference!)") window.location = action[5] 846if (day == "Saturday" && action[6] != "(Empty Reference!)" && action[6] != "(EmptyReference!)") window.location = action[6] 847if (day == "Sunday" && action[7] != "(Empty Reference!)" && action[7] != "(EmptyReference!)") window.location = action[7] 848} 849function CStextswapID(action) { 850(action[2] != "") ? (updateobject = action[2]) : (updateobject = action[1]); 851(action[5] == true) ? (whichfunction = "disappear()") : (whichfunction = "revert()"); 852if(document.all) { originaltext = document.all(updateobject).innerHTML }; 853if(document.getElementById) { originaltext = document.getElementById(updateobject).innerHTML}; 854timeout = (action[4] != "") ? (action[4] * 1000) : 0; 855if(document.getElementById) { originaltext = document.getElementById(updateobject).innerHTML}; 856timeout = (action[4] != "") ? (action[4] * 1000) : 0; 857if (document.all) { document.all(updateobject).innerHTML = action[6] + action[3] + action[7]; if (timeout != 0) setTimeout(whichfunction,timeout); } 858 else { if (document.getElementById) { document.getElementById(updateobject).innerHTML = action[6] + action[3] + action[7]; 859 if (timeout != 0) setTimeout(whichfunction,timeout) } 860 } 861} 862function disappear() { if (document.all) { document.all(updateobject).innerHTML = "<div id=updateobject></div>" } 863 else { if (document.getElementById) { document.getElementById(updateobject).innerHTML = "" } 864 } 865} 866function revert() { if (document.all) { document.all(updateobject).innerHTML = originaltext } 867 else { if (document.getElementById) { document.getElementById(updateobject).innerHTML = originaltext } 868 } 869} 870function CSHistoryGo(action) { history.go(action[1]); } 871function CSPAKkillframe() { 872if (self.parent.frames.length != 0) 873self.parent.location = document.location 874} 875function frameP(action) { 876 if(parent.frames.length==0) { 877 var fileName=window.location.href.substring(window.location.href.lastIndexOf("/")+1,window.location.href.length); 878 window.location.href=action[1]+"?"+action[2]+"="+fileName; 879 } else { 880 if(top.location.search!="") { 881 var sFrame=top.location.search.substring(1,top.location.search.indexOf("=")); 882 if(name==sFrame) { 883 var sName=top.location.search.substring(top.location.search.indexOf("=")+1,top.location.search.length); 884 var fileName=window.location.href.substring(window.location.href.lastIndexOf("/")+1,window.location.href.length); 885 if(fileName!=sName) { 886 location=sName; 887 } 888 } 889 } 890 } 891 } 892function CSRandomLinks(action){ 893var urlcounter = 0; 894if (action[2] != "(Empty Reference!)" && action[2] != "(EmptyReference!)") { ++urlcounter}; 895if (action[3] != "(Empty Reference!)" && action[3] != "(EmptyReference!)") { ++urlcounter}; 896if (action[4] != "(Empty Reference!)" && action[4] != "(EmptyReference!)") { ++urlcounter}; 897if (action[5] != "(Empty Reference!)" && action[5] != "(EmptyReference!)") { ++urlcounter}; 898if (action[6] != "(Empty Reference!)" && action[6] != "(EmptyReference!)") { ++urlcounter}; 899if (action[7] != "(Empty Reference!)" && action[7] != "(EmptyReference!)") { ++urlcounter}; 900if (parent.frames.length > 0) { 901if (action[1].length > 0) { parent.frames[action[1]].location=action[Math.floor(Math.random()*urlcounter)+2] } 902} 903else 904if (action[1].length > 0) { window.open(action[Math.floor(Math.random()*urlcounter)+2],action[1],"") } 905if (action[1].length == 0) { top.location=action[Math.floor(Math.random()*urlcounter)+2] } 906} 907function getCookie(thecookie){ 908 tempString= thecookie + "="; 909 if(document.cookie.length>0){ 910 start = document.cookie.indexOf(tempString); 911 if(start!=-1){ 912 end = document.cookie.indexOf(";",start); 913 if(end==-1){end=document.cookie.length;} 914 start += tempString.length; 915 return unescape(document.cookie.substring(start,end)) 916 } 917 } 918} 919function setCookie(thecookie,value,expire){ 920 cookieExpires = new Date 921 cookieExpires.setMonth(cookieExpires.getMonth() + 6) 922 document.cookie = thecookie + "=" + escape(value) + ";expires=" + cookieExpires.toGMTString(); 923} 924function testCookie(thecookie){ 925 if(getCookie(thecookie)){ 926 return(getCookie(thecookie)); 927 }else{ 928 return false;
929 } 930} 931function CSredPrompt(action) { 932 var thecookie = action[5] 933 if(testCookie(action[5]) && action[4] == true){ 934 location.href=getCookie(action[5]); 935 } else { 936 var x = 0; 937 } 938 939 function kill() { 940 alert(action[3]); 941 x = 1; 942 var enter = prompt(action[1],action[2]); 943 if (enter == action[6]){setCookie(action[5], action[7]);location.href=action[7];} 944 else if (enter == action[8]){setCookie(action[5], action[9]);location.href=action[9];} 945 else if (enter == action[10]){setCookie(action[5], action[11]);location.href=action[11];} 946 else if (enter == action[12]){setCookie(action[5], action[13]);location.href=action[13];} 947 else if (enter == action[15]){setCookie(action[5], action[16]);location.href=action[16];} 948 else if (enter == action[2]){kill();} 949 else if (enter == null) return 950 else kill() 951 } 952 if (x == 0) { 953 var enter = prompt(action[1],action[2]); 954 if (enter == action[6]){setCookie(action[5], action[7]);location.href=action[7];} 955 else if (enter == action[8]){setCookie(action[5], action[9]);location.href=action[9];} 956 else if (enter == action[10]){setCookie(action[5], action[11]);location.href=action[11];} 957 else if (enter == action[12]){setCookie(action[5], action[13]);location.href=action[13];} 958 else if (enter == action[14]){setCookie(action[5], action[15]);location.href=action[15];} 959 else if (enter == action[2]){kill();} 960 else if (enter == null) return 961 else kill() 962 } 963} 964function WBConfirmLink(action) { 965 if (checkIt(action)) { 966 if (action[2] != "(Empty Reference!)" && action[2] != "(EmptyReference!)") { 967 if (action[3].length < 1) { 968 parent.location.href=action[2]; 969 } 970 else { 971 parent.frames[action[3]].location.href=action[2]; 972 } 973 } 974 } 975 return; 976} 977function checkIt(action) { 978 var carryOn = window.confirm(action[1]); 979 return carryOn; 980 } 981function CSGotoLink(action) { 982 if (action[2].length) { 983 var hasFrame=false; 984 for(i=0;i<parent.frames.length;i++) { if (parent.frames[i].name==action[2]) { hasFrame=true; break;}} 985 if (hasFrame==true) 986 parent.frames[action[2]].location = action[1]; 987 else 988 window.open (action[1],action[2],""); 989 } 990 else location = action[1]; 991} 992function timeRedirect(action) { 993var now = new Date(); 994var hours = now.getHours(); 995var timeValue = action[1]; 996if (timeValue >= 12) { timeValue = timeValue - 12; } // deals with 24-hour time 997if (action[2] == true) { timeValue += 12; } // deals with PM times 998if (hours < timeValue && action[4] != "(Empty Reference!)" && action[4] != "(EmptyReference!)" && action[3] == true) { 999window.location = action[4]; } 1000if (hours >= timeValue && action[6] != "(Empty Reference!)" && action[6] != "(EmptyReference!)" && action[5] == true) { 1001window.location = action[6]; } 1002} 1003function CSGoBack1() { history.back() } 1004function initIArray() { 1005this.length = initIArray.arguments.length; 1006for (var i = 0; i < this.length; i++) 1007this[i+1] = initIArray.arguments[i]; 1008} 1009function dailyImageURL(action) { 1010var dateArray = new 1011initIArray("Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"); 1012var today = new Date(); 1013var day = dateArray[today.getDay()]; 1014if (today.getDay() == 0) { day = "Sunday"; } 1015var img = null; 1016if (document.images) { 1017 if (!IsIE()&&CSBVers<5) img = CSFindElement(action[1],0); 1018 else img = document.images[action[1]]; 1019 if (img) { 1020 if (day == "Monday" && action[2] != "(Empty Reference!)" && action[2] != "(EmptyReference!)") img.src = action[2] 1021 if (day == "Tuesday" && action[3] != "(Empty Reference!)" && action[3] != "(EmptyReference!)") img.src = action[3] 1022 if (day == "Wednesday" && action[4] != "(Empty Reference!)" && action[4] != "(EmptyReference!)") img.src = action[4] 1023 if (day == "Thursday" && action[5] != "(Empty Reference!)" && action[5] != "(EmptyReference!)") img.src = action[5] 1024 if (day == "Friday" && action[6] != "(Empty Reference!)" && action[6] != "(EmptyReference!)") img.src = action[6] 1025 if (day == "Saturday" && action[7] != "(Empty Reference!)" && action[7] != "(EmptyReference!)") img.src = action[7] 1026 if (day == "Sunday" && action[8] != "(Empty Reference!)" && action[8] != "(EmptyReference!)") img.src = action[8] 1027 } 1028} 1029} 1030function CSRandomImg(action) { 1031 var img = CSGetImage(action[1]); 1032 if (img) 1033 { 1034 var v1 = Math.floor(Math.random() * 10); 1035 var whichone = v1-(Math.floor(v1/3)*3); 1036 img.src = action[whichone+2]; 1037 } 1038} 1039function CSSetImageURL(action) { 1040 var img=CSGetImage(action[1]); 1041 if (img) img.src=action[2]; 1042} 1043CSImages=new Array(); 1044function CSPreloadImage(action) { 1045 if (document.images) { CSImages[CSImages.length]=new Image(); CSImages[CSImages.length-1].src=action[1]; } 1046}
1047function CSFieldValidate(action) { 1048var form = action[1]; 1049var elem = action[2]; 1050var theEntry = document.forms[form].elements[elem].value 1051var theFormElem = document.forms[form].elements[elem] 1052var badEntry = "" 1053 function theAlert () { 1054 alert(action[6]); 1055 theFormElem.select(); 1056 theFormElem.focus(); 1057 } 1058 function isEmpty() { 1059 if (theEntry == "") { 1060 theAlert() 1061 } 1062 } 1063 function isNumber() { 1064 if (theEntry == "") { 1065 theAlert() 1066 } 1067 for (i=0; i<theEntry.length; i++) { 1068 if (theEntry.charAt(i) < "0" || theEntry.charAt(i) > "9") { 1069 badEntry = "notnumber" 1070 } 1071 } 1072 if (badEntry == "notnumber") { 1073 theAlert() 1074 } 1075 } 1076 1077 function isAlpha() { 1078 if (theEntry == "") { 1079 theAlert() 1080 } 1081 for (i=0; i<theEntry.length; i++) { 1082 if (theEntry.charAt(i) >= "0" && theEntry.charAt(i) <= "9") { 1083 badEntry = "notalpha" 1084 } 1085 } 1086 if (badEntry == "notalpha") { 1087 theAlert() 1088 } 1089 } 1090 1091 function requiredChars() { 1092 numofChars = theEntry.length 1093 if (numofChars != action[4]) { 1094 theAlert() 1095 } 1096 } 1097 function exactString() { 1098 if (theEntry != action[5]) { 1099 theAlert() 1100 } 1101 } 1102 1103 function validEmail() { 1104 invalidChars = " /:,;" 1105 if (theEntry == "") { 1106 badEntry = "badEmail" 1107 } 1108 for (i=0; i < 5; i++) { 1109 badChar = invalidChars.charAt(i) 1110 if (theEntry.indexOf(badChar,0) > -1) { 1111 badEntry = "badEmail" 1112 } 1113 } 1114 atsignLoc = theEntry.indexOf("@",1) 1115 if (atsignLoc == -1) { 1116 badEntry = "badEmail" 1117 } 1118 if (theEntry.indexOf("@",atsignLoc+1) > -1) { 1119 badEntry = "badEmail" 1120 } 1121 dotLoc = theEntry.indexOf(".",atsignLoc) 1122 if (dotLoc == -1) { 1123 badEntry = "badEmail" 1124 } 1125 if (dotLoc+3 > theEntry.length) { 1126 badEntry = "badEmail" 1127 } 1128 if (badEntry == "badEmail") { 1129 theAlert() 1130 } 1131 } 1132 function validCC() { 1133 var theNumber = new Array(theEntry.length); 1134 var i = 0 1135 var total = 0 1136 for (i = 0; i < theEntry.length; ++i) { 1137 theNumber[i] = parseInt(theEntry.charAt(i)) 1138 } 1139 for (i = theNumber.length -2; i >= 0; i-=2) { 1140 theNumber[i] *= 2; 1141 if (theNumber[i] > 9) theNumber[i]-=9; 1142 } 1143 for (i = 0; i < theNumber.length; ++i) { 1144 total += theNumber[i]; 1145 } 1146 isinteger = total/10 1147 if(parseInt(isinteger)!=isinteger) { 1148 theAlert() 1149 } 1150 } 1151 1152var type=action[3]; 1153if(type==0) isEmpty() 1154else if(type==1) isNumber() 1155else if(type==2) isAlpha() 1156else if(type==3) requiredChars() 1157else if(type==4) exactString() 1158else if(type==5) validEmail() 1159else if(type==6) validCC() 1160} 1161 1162function CSGetFormElementValue(action) { 1163 var form = action[1]; 1164 var elem = action[2]; 1165 return document.forms[form].elements[elem].value; 1166} 1167function CSGetLayerPos(action) { 1168 var layer = action[1]; 1169 var x = CSGetStylePos(layer, 0); 1170 var y = CSGetStylePos(layer, 1); 1171 return new Array(x, y); 1172} 1173function CSDeleteCookie(action) 1174{ 1175var name=action[1] 1176var value=action[2] 1177var jours=-12000 1178path="/" 1179domain=null 1180var expdate = new Date (); 1181expdate.setTime (expdate.getTime() + (jours * 60 * 60 * 1000)); 1182SetCookie(name,value,expdate) 1183} 1184function SetCookie (name, value) { 1185 var argv = SetCookie.arguments; 1186 var argc = SetCookie.arguments.length; 1187 var expires = (argc > 2) ? argv[2] : null; 1188 var secure = (argc > 5) ? argv[5] : false; 1189 document.cookie = name + "=" + escape (value) + 1190 ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + 1191 ((path == null) ? "" : ("; path=" + path)) + 1192 ((domain == null) ? "" : ("; domain=" + domain)) + 1193 ((secure == true) ? "; secure" : ""); 1194} 1195function CSvisits(action) { 1196mycookie = action[8] 1197cookieExpires = new Date 1198cookieExpires.setMonth(cookieExpires.getMonth() + 12) 1199visits = eval(cookieVal(mycookie)) 1200visits++ 1201document.cookie = mycookie+"="+visits+";expires=" + cookieExpires.toGMTString() 1202 1203function cookieVal(cookieName) { 1204 thisCookie = document.cookie.split("; ") 1205 for (i=0; i<thisCookie.length; i++) { 1206 if (cookieName == thisCookie[i].split("=")[0]) { 1207 return thisCookie[i].split("=")[1] 1208 } 1209 } 1210 return 0 1211} 1212 if(visits == 1 && action[1] == true) alert(action[2]) 1213 else 1214 if(action[5] == true) alert(action[3] + " " + visits) 1215 if(action[6] == true) { 1216 if(visits == action[7]) 1217 alert(action[4]) 1218 } 1219} 1220 1221function CSVisitorCookie(action) 1222{ 1223resultat = "visitor" 1224cookiename = action[1] 1225goUrl = action[2] 1226var arg = cookiename + "="; 1227 var alen = arg.length; 1228 var clen = document.cookie.length; 1229 var i = 0; 1230 while (i < clen) { 1231 var j = i + alen; 1232 if (document.cookie.substring(i, j) == arg) 1233 return CSVisitorGetCookie (j); 1234 i = document.cookie.indexOf(" ", i) + 1; 1235 if (i == 0) break; 1236 }
1237 VisitorSetCookie(cookiename) 1238 return null; 1239} 1240function CSVisitorGetCookie (offset) { 1241 var endstr = document.cookie.indexOf (";", offset); 1242 if (endstr == -1) 1243 endstr = document.cookie.length; 1244 valeur=unescape(document.cookie.substring(offset, endstr)) 1245 if (valeur==resultat) 1246 VisitorGotoLink(goUrl) 1247 else 1248 VisitorSetCookie(cookiename) 1249} 1250function VisitorGotoLink(goUrl) { 1251location = goUrl 1252} 1253function VisitorSetCookie(cookiename) 1254{ 1255var value="visitor" 1256var jours=500*24 1257path="/" 1258domain=null 1259var expdate = new Date (); 1260expdate.setTime (expdate.getTime() + (jours * 60 * 60 * 1000)); 1261SetCookie(cookiename,value,expdate) 1262} 1263function SetCookie (cookiename, value) { 1264 var argv = SetCookie.arguments; 1265 var argc = SetCookie.arguments.length; 1266 var expires = (argc > 2) ? argv[2] : null; 1267 var secure = (argc > 5) ? argv[5] : false; 1268 document.cookie = cookiename + "=" + escape (value) + 1269 ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + 1270 ((path == null) ? "" : ("; path=" + path)) + 1271 ((domain == null) ? "" : ("; domain=" + domain)) + 1272 ((secure == true) ? "; secure" : ""); 1273} 1274var CSLastSound = null 1275function CSPlaySound(action) { 1276 if (eval('document.'+action[1])!=null) { 1277 if (CSLastSound != null && CSLastSound != action[1]) eval ('document.' + CSLastSound + '.stop()'); 1278 CSLastSound = action[1] 1279 if (window.navigator.userAgent.indexOf("MSIE") > 0) eval ('document.' + CSLastSound + '.run()'); 1280 else eval ('document.' + CSLastSound + '.play(true)'); 1281 } else { alert ("The current Plug-In cannot be controlled by JavaScript. Please try using LiveAudio or a compatible Plug-In!"); } 1282} 1283function CSStopSound (action) {if (eval('document.'+action[1])!=null) { eval ('document.' + action[1] + '.stop()');}} 1284function CSPlayScene(action) { CSStartSeq (action[1]); } 1285function CSStopScene(action) { CSStopFunction (action[1]); } 1286SSnumimg=1; SSsens2=-1;SSsens3=-1 1287function CSSlideShow(action) 1288{ 1289SSmax=action[2] 1290SSimgNom=action[1] 1291SSloop=action[4] 1292SSsens=action[3] 1293SSpalin=action[5] 1294var SSimg = null; 1295 if (document.images) { 1296 if (!IsIE()&&CSBVers<5) SSimg = CSFindElement(SSimgNom,0); 1297 else SSimg = document.images[SSimgNom]; 1298SSstr=SSimg.src 1299SSn=SSstr.length 1300SSp=SSn-6 1301SSpstr=SSstr.substring(0,SSp) 1302SSnimg=SSstr.substring(SSp,SSp+2) 1303SSformat=SSstr.substring(SSp+2,SSn) 1304if (SSformat==".jpg" || SSformat==".JPG" || SSformat==".gif" || SSformat==".GIF") 1305{} 1306else 1307{ 1308 alert("Image extension must be .jpg or .gif (case sensitive). Images must be numbered 01, 02 ...") 1309} 1310slide(SSmax,SSformat,SSpstr,SSnimg,SSimgNom,SSloop,SSpalin) 1311} 1312} 1313function slide(SSmax,SSformat,SSpstr,SSnimg,SSimgNom,SSloop,SSpalin) 1314{ 1315if (SSsens2==true) {SSsens=true} 1316if (SSsens2==false) {SSsens=false} 1317if (SSsens==true) 1318{ 1319SSsuite=SSnumimg-1 1320 if (SSnumimg>SSmax)SSsuite=SSmax 1321 if (SSnumimg<=1 & SSloop==true & SSpalin!=true) { SSsuite=SSmax } 1322 if (SSnumimg<=1 & SSloop==true & SSpalin==true) { 1323 if (SSsens2==-1 & SSsens3==-1) {SSsuite=SSmax;SSsens3=1} else { SSsuite=SSnumimg+1; SSsens2=false }} 1324 if (SSnumimg<=1 & SSloop!=true & SSpalin!=true) { 1325 if (SSsens2==-1 & SSsens3==-1) { SSsuite=SSmax;SSsens3=1 } else {SSsuite=SSnumimg; SSfini()}} 1326} 1327else 1328{ 1329SSmax=SSmax-1 1330SSsuite=SSnumimg+1 1331 if (SSnumimg>SSmax & SSloop==true & SSpalin!=true) { SSsuite=1} 1332 if (SSnumimg>SSmax & SSloop==true & SSpalin==true) {SSsuite=SSnumimg-1; SSsens2=true } 1333 if (SSnumimg>SSmax & SSloop!=true & SSpalin!=true) { SSsuite=SSnumimg;SSfini() } 1334 if (SSnumimg<1) SSsuite=1 1335} 1336SSnumimg=SSsuite 1337if (SSsuite<10) { 1338 SSaller="0"+SSsuite 1339 } 1340 else SSaller=SSsuite 1341SSsource=SSpstr+SSaller+SSformat 1342var SSimg = null; 1343 if (document.images) { 1344 if (!IsIE()&&CSBVers<5) SSimg = CSFindElement(SSimgNom,0); 1345 else SSimg = document.images[SSimgNom]; 1346 if (SSimg) SSimg.src = SSsource; 1347 } 1348} 1349function SSfini() { 1350} 1351var gCSIEDragObject = null; 1352var gDragX,gDragY; 1353function CSSetupDrag (layerName) { 1354 this.x = 0; this.y = 0; 1355 if (IsIE()) { 1356 this.canDrag=true; 1357 this.layerObj=document.all.tags("div")[layerName]; 1358 this.layerObj.dragObj = this; 1359 document.ondragstart = CSIEStartDrag; 1360 document.onmousedown = CSIEMouseDown; 1361 document.onmouseup = CSIEStopDrag; 1362 } else { 1363 if (CSBVers>=5) 1364 { 1365 this.layerObj=document.getElementById(layerName); 1366 this.layerObj.addEventListener("mousedown", CSNS6StartDrag, true); 1367 this.layerObj.addEventListener("mouseup", CSNS6StopDrag, true); 1368 } 1369 else 1370 {
1371 this.layer=CSNSStyl(layerName);this.onmousemove=null; 1372 this.layer.document.theLayer=this; 1373 this.layer.document.captureEvents(Event.MOUSEDOWN); 1374 this.layer.document.onmousedown=CSNSStartDrag; 1375 this.layer.document.onmouseup=CSNSStopDrag; 1376 } 1377 } 1378} 1379function CSNS6StartDrag (ev) { 1380 CSIDOM(); 1381 ev.currentTarget.addEventListener("mousemove", CSNS6DoDrag, true); 1382 gDragX=ev.clientX; 1383 gDragY=ev.clientY; 1384 ev.preventDefault(); 1385} 1386function CSNS6DoDrag (ev) { 1387 var style=ev.currentTarget.style; 1388 style.left = parseInt(style.left)+(ev.clientX-gDragX)+"px"; 1389 style.top = parseInt(style.top)+(ev.clientY-gDragY)+"px"; 1390 gDragX=ev.clientX; 1391 gDragY=ev.clientY; 1392} 1393function CSNS6StopDrag (ev) { 1394 ev.target.removeEventListener("mousedown", CSNS6StartDrag, true); 1395 ev.target.removeEventListener("mouseup", CSNS6StopDrag, true); 1396 ev.currentTarget.removeEventListener("mousemove", CSNS6DoDrag, true); 1397 ev.preventDefault(); 1398} 1399function CSNSStartDrag (ev) { 1400 var clickInMe = false; 1401 if (ev.target != this) { 1402 for (var i=0;i<this.images.length;i++) { 1403 if (this.images[i] == ev.target) { clickInMe = true; break;} 1404 } 1405 } 1406 else clickInMe = true; 1407 if (clickInMe) 1408 { 1409 this.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP); 1410 this.onmousemove=CSNSDoDrag; 1411 this.theLayer.x= ev.pageX; 1412 this.theLayer.y= ev.pageY; 1413 this.routeEvent(ev); 1414 return false; 1415 } 1416 this.onmousemove=null;this.releaseEvents(Event.MOUSEMOVE|Event.MOUSEUP); 1417 this.routeEvent(ev); 1418 return true; 1419} 1420function CSNSStopDrag (ev) { 1421 this.onmousemove=null;this.releaseEvents(Event.MOUSEMOVE|Event.MOUSEUP);return false; 1422} 1423function CSNSDoDrag (ev) { 1424 this.theLayer.layer.moveBy(ev.pageX-this.theLayer.x, ev.pageY-this.theLayer.y); 1425 this.theLayer.x = ev.pageX; 1426 this.theLayer.y = ev.pageY; 1427 this.routeEvent(ev); 1428} 1429function CSIEStartDrag () { 1430 if(gCSIEDragObject != null && (gCSIEDragObject.tagName==event.srcElement.tagName)) 1431 event.returnValue=false; 1432} 1433function CSIEStopDrag () { gCSIEDragObject=null; document.onmousemove=null; } 1434function CSIEMouseDown () { 1435 if(event.button==1) { 1436 dragLayer = event.srcElement; 1437 while (dragLayer!=null) 1438 { 1439 if ((dragLayer.dragObj == null) && (dragLayer.tagName == "DIV")) 1440 break; 1441 if (dragLayer.dragObj != null) 1442 break; 1443 dragLayer=dragLayer.parentElement; 1444 } 1445 1446 if (dragLayer == null) return; 1447 if (dragLayer.dragObj!=null && dragLayer.dragObj.canDrag) { 1448 gCSIEDragObject = dragLayer; 1449 gCSIEDragObject.dragObj.x=event.clientX; 1450 gCSIEDragObject.dragObj.y=event.clientY; 1451 document.onmousemove = CSIEMouseMove; 1452 } 1453 } 1454} 1455function CSIEMouseMove () { 1456 gCSIEDragObject.dragObj.layerObj.style.pixelLeft+=(event.clientX-gCSIEDragObject.dragObj.x); 1457 gCSIEDragObject.dragObj.layerObj.style.pixelTop+=(event.clientY-gCSIEDragObject.dragObj.y); 1458 gCSIEDragObject.dragObj.x=event.clientX; 1459 gCSIEDragObject.dragObj.y=event.clientY; 1460 event.returnValue = false; 1461 event.cancelBubble = true; 1462} 1463var gDragArray = new Array(); 1464function CSDrag(action) { gDragArray[gDragArray.length] = new CSSetupDrag(action[1]); } 1465if (navigator.appName == "Netscape" && navigator.appVersion.charAt(0) >=5) { 1466 leftH = ".left"; 1467 topV = ".top"; 1468 nndoc = "document.getElementById(layername).style"; 1469 iestyle = ""; 1470 offsetH = "window.pageXOffset"; 1471 offsetV = "window.pageYOffset"; 1472 } 1473 1474 else if (navigator.appName == "Netscape" && navigator.appVersion.charAt(0) >=4) { 1475 leftH = ".left"; 1476 topV = ".top"; 1477 nndoc = "document."; 1478 iestyle = ""; 1479 offsetH = "window.pageXOffset"; 1480 offsetV = "window.pageYOffset"; 1481 } 1482 1483 else if (navigator.appName == "Microsoft Internet Explorer") { 1484 leftH = ".pixelLeft"; 1485 topV = ".pixelTop"; 1486 nndoc = ""; 1487 iestyle = "document.getElementById(layername).style"; 1488 offsetH = "document.body.scrollLeft"; 1489 offsetV = "document.body.scrollTop"; 1490 } 1491function getnewPos() { 1492var currentH = eval(offsetH); 1493var currentV = eval(offsetV); 1494x = parseInt(currentH) + parseInt(xpos); 1495y = parseInt(currentV) + parseInt(ypos); 1496moveLayer(); 1497setTimeout("getnewPos()",10) 1498} 1499function CSFloatLayer(action) { 1500layername = action[1]; 1501ypos = action[2]; 1502xpos = action[3]; 1503if (navigator.appVersion.charAt(0) >=5 || navigator.appName == "Microsoft Internet Explorer") { 1504 leftPos = eval(nndoc + iestyle + leftH); 1505 topPos = eval(nndoc + iestyle + topV); 1506 } else {
1507 leftPos = eval(nndoc + layername + iestyle + leftH); 1508 topPos = eval(nndoc + layername + iestyle + topV); 1509 } 1510 getnewPos() 1511 } 1512function moveLayer() { 1513if (navigator.appVersion.charAt(0) >=5 || navigator.appName == "Microsoft Internet Explorer") { 1514 eval(nndoc + iestyle + topV + "=" + y); 1515 eval(nndoc + iestyle + leftH + "=" + x); 1516 } else { 1517 eval(nndoc + layername + iestyle + topV + "=" + y); 1518 eval(nndoc + layername + iestyle + leftH + "=" + x); 1519 } 1520} 1521var myLayer = false; 1522var offSetX = 1; 1523var offSetY = 1; 1524function CSMouseFollow(action,offX,offY){ 1525 myLayer = action[1]; 1526 if(offX){offSetX=offX;} 1527 if(offY){offSetY=offY;} 1528 if (navigator.appName == "Netscape") { 1529 document.captureEvents(Event.MOUSEMOVE); 1530 } else { 1531 if(navigator.appVersion.indexOf("Mac")!=-1){offSetX=offSetX-18;} 1532 } 1533 document.onmousemove = mouseLayer; 1534} 1535function mouseLayer(e){ 1536 if (navigator.appName == "Netscape" && navigator.appVersion.charAt(0) >=5) { 1537 document.getElementById(myLayer).style.left = (e.pageX+offSetX); 1538 document.getElementById(myLayer).style.top = (e.pageY+offSetY); 1539 } 1540 else if (navigator.appName == "Netscape") { 1541 document.layers[myLayer].moveBy( 1542 (e.pageX+offSetX) - document.layers[myLayer].left, 1543 (e.pageY+offSetY) - document.layers[myLayer].top); 1544 return true; 1545 } else { 1546 document.all[myLayer].style.pixelLeft = (event.x+offSetX); 1547 document.all[myLayer].style.pixelTop = (event.y+offSetY); 1548 event.cancelBubble = true; 1549 event.returnValue = false; 1550 } 1551} 1552function CSStartWipe (action) 1553{ 1554 var el=CSCreateTransElement (action[1], action[2]); 1555 if (el==null) return; 1556 var dir=action[3]; 1557 if (dir=="_inLeft") {el.steps=el.clipRect.width/el.maxValue; el.modus="in";} 1558 else if (dir=="_inRight") {el.steps=el.clipRect.width/el.maxValue; el.modus="in";} 1559 else if (dir=="_outLeft") {el.steps=el.clipRect.width/el.maxValue; el.modus="out";} 1560 else if (dir=="_outRight") {el.steps=el.clipRect.width/el.maxValue; el.modus="out";} 1561 else if (dir=="_inTop") {el.steps=el.clipRect.height/el.maxValue; el.modus="in";} 1562 else if (dir=="_inBottom") {el.steps=el.clipRect.height/el.maxValue; el.modus="in";} 1563 else if (dir=="_outTop") {el.steps=el.clipRect.height/el.maxValue; el.modus="out";} 1564 else if (dir=="_outBottom") {el.steps=el.clipRect.height/el.maxValue; el.modus="out";} 1565 else if (dir=="_inCenter") {el.HSteps=el.clipRect.width/el.maxValue; el.VSteps=el.clipRect.height/el.maxValue; el.modus="in";} 1566 else if (dir=="_outCenter") {el.HSteps=el.clipRect.width/el.maxValue; el.VSteps=el.clipRect.height/el.maxValue; el.modus="out";} 1567 if (el.modus=="") return; 1568 el.currentValue=0; 1569 el.glDir=action[3]; 1570 CSStartFunction(CSDoWipe,el); 1571} 1572function CSDoWipe (info) 1573{ 1574 var el = info.data; 1575 if (el==null) return false; 1576 if (el.currentValue==el.maxValue) { CSFinishWipe(el); return false; } 1577 var r = new CSRect(el.clipRect.left,el.clipRect.top,el.clipRect.width,el.clipRect.height); 1578 var dir=el.glDir; 1579 if (dir=="_inLeft") {r.left=r.width-el.currentValue*el.steps;} 1580 else if (dir=="_inTop") {r.top=r.height-el.currentValue*el.steps;} 1581 else if (dir=="_inRight") {r.width=el.currentValue*el.steps;} 1582 else if (dir=="_inBottom") {r.height=el.currentValue*el.steps;} 1583 else if (dir=="_outLeft") {r.width=r.width-el.currentValue*el.steps;} 1584 else if (dir=="_outTop") {r.height=r.height-el.currentValue*el.steps;} 1585 else if (dir=="_outRight") {r.left=el.currentValue*el.steps;} 1586 else if (dir=="_outBottom") {r.top=el.currentValue*el.steps;} 1587 else if (dir=="_inCenter") {r=CSCenterRectIn(el,r);} 1588 else if (dir=="_outCenter") {r=CSCenterRectOut(el,r);} 1589 CSSetLayerClip(el,r); 1590 el.currentValue+=1; 1591 return true; 1592} 1593function CSFinishWipe (el) 1594{ 1595 if (el.modus=="in") CSSetLayerClip(el,el.clipRect); 1596 else { 1597 el.clipRect=new CSRect(0,0,el.width,el.height); 1598 CSSetLayerClip(el,el.clipRect); 1599 CSSetStyleVis(el.layer,0); 1600 } 1601 CSDisposeTransElement(el); 1602} 1603function CSCenterRectIn(el,r) 1604{ 1605 var hValue= el.currentValue*el.HSteps/2; 1606 var vValue= el.currentValue*el.VSteps/2; 1607 r.left=Math.round(r.left+r.width/2-hValue); 1608 r.top=Math.round(r.top+r.height/2-vValue); 1609 r.width=Math.round(hValue*2); 1610 r.height=Math.round(vValue*2); 1611 return r; 1612} 1613function CSCenterRectOut(el,r) 1614{ 1615 var hValue= el.currentValue*el.HSteps/2; 1616 var vValue= el.currentValue*el.VSteps/2; 1617 r.left+=Math.round(hValue); 1618 r.top+=Math.round(vValue); 1619 r.width-=Math.round(hValue*2); 1620 r.height-=Math.round(vValue*2); 1621 return r; 1622} 1623function CSMoveTo(action) { CSSlideLayer(action[1],action[2],action[3],action[4]); } 1624function CSMoveBy(action) 1625{ 1626 x = CSGetStylePos(action[1], 0); 1627 y = CSGetStylePos(action[1], 1); 1628 x += parseInt(action[2]); 1629 y += parseInt(action[3]); 1630 x = CSSetStylePos(action[1], 0, x); 1631 y = CSSetStylePos(action[1], 1, y); 1632} 1633function CSSlideShowAuto(action) 1634{ 1635SSAfini=0 1636SSAnumimg=0 1637SSAmax=action[2] 1638SSAimgNom=action[1] 1639SSAtemps=action[3]*1000 1640if (action[4]==true) 1641 { 1642 SSAstop=true 1643 } 1644 else SSAstop=false 1645var SSAimg = null; 1646 if (document.images) {
1647 if (!IsIE()&&CSBVers<5) SSAimg = CSFindElement(SSAimgNom,0); 1648 else SSAimg = document.images[SSAimgNom]; 1649str=SSAimg.src 1650n=str.length 1651p=n-6 1652SSApstr=str.substring(0,p) 1653SSAnimg=str.substring(p,p+2) 1654SSAformat=str.substring(p+2,n) 1655if (SSAformat==".jpg" || SSAformat==".JPG" || SSAformat==".gif" || SSAformat==".GIF") 1656{} 1657else 1658{ 1659 alert("Image extension must be .jpg or .gif (case sensitive). Images must use 2 digit naming starting with 01, 02 ... plus extension") 1660} 1661if (SSAnimg.substring(0,1)=="0") 1662{ 1663SSAnumimg=Number(SSAnimg.substring(1,2)) 1664} 1665else 1666{SSAnumimg=Number(SSAnimg)} 1667SSAtempo(SSAmax,SSAimgNom,SSAtemps,SSAstop,SSApstr,SSAnimg,SSAformat) 1668} 1669} 1670function SSAtempo(SSAmax,SSAimgNom,SSAtemps,SSAstop,SSApstr,SSAnimg,SSAformat) 1671{ 1672setTimeout("slideAuto(SSAmax,SSAimgNom,SSAstop,SSApstr,SSAnimg,SSAformat)",SSAtemps) 1673} 1674function slideAuto(SSAmax,SSAimgNom,SSAstop,SSApstr,SSAnimg,SSAformat) 1675{ 1676if (SSAfini==1) { 1677SSAnumimg = SSAnumimg-2 1678CSSlideShowAutoPause() 1679} 1680else 1681{ 1682SSAmax=SSAmax-1 1683SSAsuite=SSAnumimg+1 1684 if (SSAnumimg>SSAmax) 1685 { 1686 SSAsuite=1 1687 if (SSAstop==true) SSAfini=1 1688 else 1689 SSAfini=0 1690 } 1691 if (SSAnumimg<1) SSAsuite=1 1692SSAnumimg=SSAsuite 1693if (SSAsuite<10) { 1694 SSAaller="0"+SSAsuite 1695 } 1696 else SSAaller=SSAsuite 1697SSAsource=SSApstr+SSAaller+SSAformat 1698var SSAimg = null; 1699 if (document.images) { 1700 if (!IsIE()&&CSBVers<5) SSAimg = CSFindElement(SSAimgNom,0); 1701 else SSAimg = document.images[SSAimgNom]; 1702 if (SSAimg) SSAimg.src = SSAsource; 1703 } 1704SSAtempo(SSAmax,SSAimgNom,SSAtemps,SSAstop,SSApstr,SSAnimg,SSAformat) 1705} 1706} 1707function CSSlideShowAutoPause() 1708{} 1709function CSSlideShowAutoStop(action) 1710{ 1711if (SSAfini==0) SSAfini=1 1712else SSAfini=0 ; SSAnumimg = SSAnumimg+2 ; slideAuto(SSAmax,SSAimgNom,SSAstop,SSApstr,SSAnimg,SSAformat) 1713} 1714function CSStopAll(action) { CSStopComplete (); } 1715function CSFlipMove(action) { 1716 if (action[1] == '') return; 1717 var curX = CSGetStylePos(action[1],0); var curY = CSGetStylePos(action[1],1); 1718 var x1 = action[2][0]; 1719 var y1 = action[2][1]; 1720 if ((x1 != curX) || (y1 != curY)) CSSlideLayer(action[1],action[2],action[4],action[5]); 1721 else CSSlideLayer(action[1],action[3],action[4],action[5]); 1722} 1723function CSShowHide(action) { 1724 if (action[1] == '') return; 1725 var type=action[2]; 1726 if(type==0) CSSetStyleVis(action[1],0); 1727 else if(type==1) CSSetStyleVis(action[1],1); 1728 else if(type==2) { 1729 if (CSGetStyleVis(action[1]) == 0) CSSetStyleVis(action[1],1); 1730 else CSSetStyleVis(action[1],0); 1731 } 1732} 1733function CSIdleObject (action) { 1734 this.conditionAction = action[2]; 1735 this.trueAction = action[3]; 1736 this.falseAction = action[4]; 1737 this.exitIdleIfTrue = action[1]; 1738 this.lastState = false; 1739} 1740function CSIdleAction(action) { 1741 idleObj = new CSIdleObject (action); 1742 CSStartFunction (CSDoIdle,idleObj); 1743} 1744function CSDoIdle (param) { 1745 idleObject=param.data; 1746 if (idleObject.conditionAction) { 1747 gCurrentIdleObject = idleObject; 1748 var result = CSAction(new Array(idleObject.conditionAction)); 1749 if (result == true && idleObject.lastState==false) { 1750 idleObject.lastState = result; 1751 if (idleObject.trueAction) { 1752 CSAction(new Array(idleObject.trueAction)); 1753 if (idleObject.exitIdleIfTrue == true) return false; 1754 } 1755 } else if (result == false && idleObject.lastState == true) { 1756 idleObject.lastState = false; 1757 if (idleObject.falseAction) { 1758 CSAction(new Array(idleObject.falseAction)); 1759 } 1760 } 1761 } 1762 return true; 1763} 1764function CSActionGroup (action) { 1765 for(var i=1;i<action.length;i++) { CSAction(new Array(action[i])); } 1766} 1767function CSCallAction(action) 1768{ 1769 CSAction(new Array(action[1])); 1770} 1771CSCurrentPressedKey = -1; 1772function CSKeyPress(ev) { 1773 var code; 1774 if(IsIE()) CSCurrentPressedKey = event.keyCode; 1775 else CSCurrentPressedKey = ev.which; 1776} 1777document.onkeypress = CSKeyPress; 1778function CSKeyCompare(condition) 1779{ 1780 var eq = (condition[1] == CSCurrentPressedKey); 1781 if(eq) 1782 CSCurrentPressedKey = -1; 1783 return eq; 1784} 1785function CSTimeout (condition) { 1786 var result = false;
1787 if (typeof (gCurrentIdleObject) == "undefined") return result; 1788 if (gCurrentIdleObject.lastTime) { 1789 var t=new Date(); 1790 if (t.getTime() >= gCurrentIdleObject.lastTime) { 1791 if (t.getTime() >= gCurrentIdleObject.nextTime) { 1792 gCurrentIdleObject.lastTime = t.getTime() + condition[1]*1000; 1793 gCurrentIdleObject.nextTime = gCurrentIdleObject.lastTime + condition[1]*1000; 1794 return false; 1795 } 1796 return true; 1797 } 1798 } else { 1799 var t=new Date(); 1800 gCurrentIdleObject.lastTime = t.getTime() + condition[1]*1000; 1801 gCurrentIdleObject.nextTime = gCurrentIdleObject.lastTime + condition[1]*1000; 1802 } 1803 return result; 1804} 1805function CSCallFunction(action) 1806{ 1807 var str = action[1]; 1808 str += "("; 1809 str += action[2]; 1810 str += ");" 1811 return eval(str); 1812} 1813function CSLayerIntersect (condition) 1814{ 1815 var l1,t1,r1,b1,l2,t2,r2,b2; 1816 if (IsIE()) { 1817 var layer1=document.all.tags("div")[condition[1]]; 1818 var layer2=document.all.tags("div")[condition[2]]; 1819 l1=layer1.style.pixelLeft; t1=layer1.style.pixelTop; r1=layer1.offsetWidth+l1; b1=layer1.offsetHeight+t1; 1820 l2=layer2.style.pixelLeft; t2=layer2.style.pixelTop; r2=layer2.offsetWidth+l2; b2=layer2.offsetHeight+t2; 1821 } else { 1822 var layer1=CSNSStyl(condition[1]); 1823 var layer2=CSNSStyl(condition[2]); 1824 if (CSBVers>=5) 1825 { 1826 CSIDOM(); 1827 l1=parseInt(layer1.left); t1=parseInt(layer1.top); r1=parseInt(layer1.width)+l1; b1=parseInt(layer1.height)+t1; 1828 l2=parseInt(layer2.left); t2=parseInt(layer2.top); r2=parseInt(layer2.width)+l2; b2=parseInt(layer2.height)+t2; 1829 } 1830 else 1831 { 1832 l1=layer1.x; t1=layer1.y; r1=layer1.clip.width+l1; b1=layer1.clip.height+t1; 1833 l2=layer2.x; t2=layer2.y; r2=layer2.clip.width+l2; b2=layer2.clip.height+t2; 1834 } 1835 } 1836 var w = (r1 < r2 ? r1 : r2) - (l1 > l2 ? l1 : l2) 1837 var h = (b1 < b2 ? b1 : b2) - (t1 > t2 ? t1 : t2) 1838 return ((w >= 0) && (h >= 0)); 1839} 1840function CSConditionAction(action) { 1841 if (action[1]) { 1842 if (CSAction(new Array(action[1])) == true) { 1843 if (action[2]) CSAction(new Array(action[2])); 1844 } else if (action[3]) CSAction(new Array(action[3])); 1845 } 1846} 1847function CSFixFct() { 1848 var d = document; var w = window;
1849 if (d.cs.csFix.w != w.innerWidth || d.cs.csFix.h != w.innerHeight) { 1850 d.location = d.location; } 1851} 1852function CSNSFix(action) { 1853 var d = document; var w = window; 1854 if ((navigator.appName == 'Netscape') && (parseInt(navigator.appVersion) == 4)) { 1855 if (typeof d.cs == 'undefined') { 1856 d.cs = new Object; 1857 d.cs.csFix = new Object; 1858 } else if (CSIsFrame (w) == true) CSFixFct(); 1859 d.cs.csFix.w = w.innerWidth; 1860 d.cs.csFix.h = w.innerHeight; 1861 window.onresize = CSFixFct; 1862 } 1863} 1864function CSIsFrame (window) { 1865 var rootWindow = window.parent; 1866 if (rootWindow == 'undefined') return false; 1867 for (i = 0; i < rootWindow.frames.length; i++) 1868 if (window == rootWindow.frames[i]) return true; 1869 return false; 1870} 1871function CSResizeWindow(action) { 1872 if(navigator.appVersion.charAt(0) >=4) { window.resizeTo (action[1],action[2]) } 1873} 1874function CSScrollstatus(action) { 1875phrase = action[1]; 1876speed = action[2]; 1877(action[3] != true) ? delay = setTimeout("CSScrollleftidle()",20) : delay = setTimeout("CSScrollrightidle()",20) 1878var thestring 1879leftphrase = " " + phrase 1880charnum = leftphrase.length; 1881stringnum = leftphrase.length; 1882size = leftphrase.length+1 1883} 1884function CSScrollrightidle() { 1885 stringnum--; 1886 (stringnum != 0) ? window.status = leftphrase.substring(charnum,stringnum) : stringnum = charnum 1887 delay = setTimeout("CSScrollrightidle()",speed); 1888 } 1889 1890function CSScrollleftidle() { 1891 thestring = leftphrase.substring(0,1); 1892 leftphrase += thestring 1893 leftphrase = leftphrase.substring(1,size); 1894 window.status = leftphrase.substring(0,size); 1895 delay = setTimeout("CSScrollleftidle()",speed); 1896} 1897function CSdigitalclock(action){ 1898img1 = CSGetImage(action[1]); 1899img2 = CSGetImage(action[2]); 1900img3 = CSGetImage(action[3]); 1901img4 = CSGetImage(action[4]); 1902usemilitary = action[5]; 1903giflocation = action[6]; 1904path = giflocation.substring(0, giflocation.length - 5); 1905extension = (giflocation.indexOf("jpg") != -1) ? (".jpg") : (".gif"); 1906digClock(); 1907} 1908function digClock() { 1909now = new Date(); 1910hours = now.getHours(); 1911theMonth = now.getMonth(); 1912if(navigator.appVersion.indexOf("MSIE 5.0; Macintosh") != -1) { 1913 if (theMonth <= 11 && theMonth >= 4) { hours = hours + 1 }; 1914 if (hours == 24) { hours = 0 }; 1915 } 1916minutes = now.getMinutes(); 1917hours = ((hours > 12 && usemilitary == false) ? hours -12 : hours); 1918if (hours >= 0 && hours <=9) hours = "0" + hours; 1919if (usemilitary == false && hours == 00) { hours = 12 }; 1920if (minutes >= 0 && minutes <=9) minutes = "0" + minutes; 1921hours = "" + hours; 1922minutes = "" + minutes; 1923hour1 = hours.substring(0,1); 1924hour2 = hours.substring(1,2); 1925minutes1 = minutes.substring(0,1); 1926minutes2 = minutes.substring(1,2); 1927updater(); 1928} 1929 1930function updater() { 1931img1.src = path + hour1 + extension; 1932img2.src = path + hour2 + extension; 1933img3.src = path + minutes1 + extension; 1934img4.src = path + minutes2 + extension; 1935theTimer = setTimeout("digClock()",1000); 1936} 1937function CSprintdocument(action){ 1938if (navigator.appName .indexOf("Microsoft") != -1 && navigator.platform.indexOf("Mac") != -1 || navigator.appVersion.indexOf("3.0") != -1) { 1939alert("Please use your browser\'s print command to print this document."); 1940 } else { 1941 (action[1] != "") ? (parent.frames[action[1]].print()) : (parent.print()); 1942 } 1943} 1944function CSScrollLeft(action){ 1945 if(navigator.appVersion.charAt(0) >=4) { 1946 var container = 0 1947 if (action[2] > 0) { 1948 while (container < action[1]) { 1949 window.scrollBy(-action[2],0); 1950 container = container + action[2]; 1951 } 1952 } 1953 } 1954} 1955function CSScrollRight(action){ 1956 if(navigator.appVersion.charAt(0) >=4) { 1957 var container = 0 1958 if (action[2] > 0) { 1959 while (container < action[1]) { 1960 window.scrollBy(action[2],0); 1961 container = container + action[2]; 1962 } 1963 } 1964 } 1965} 1966function CSScrollUp(action){ 1967 if(navigator.appVersion.charAt(0) >=4) { 1968 var container = 0 1969 if (action[2] > 0) { 1970 while (container < action[1]) { 1971 window.scrollBy(0,-action[2]); 1972 container = container + action[2]; 1973 } 1974 } 1975 } 1976} 1977function CSScrollDown(action){ 1978 if(navigator.appVersion.charAt(0) >=4) { 1979 var container = 0 1980 if (action[2] > 0) { 1981 while (container < action[1]) { 1982 window.scrollBy(0,action[2]); 1983 container = container + action[2]; 1984 } 1985 } 1986 } 1987} 1988function CSSearchEngine(action) { 1989var form = action[1] 1990var elem = action[2] 1991var theEntry 1992if(action[3]==true) { theEntry = action[4] } 1993else { theEntry = document.forms[form].elements[elem].value } 1994var type=action[5]; 1995if(type==0) engine="http://search.adobe.com/cgi-bin/query?mss=simple&pg=q&what=web&fmt=.&where=www_search_main&superq="+theEntry+"&rd=all&q="+theEntry+"&x=39&y=10" //Adobe.com 1996else if(type==1) engine="http://www.altavista.digital.com/cgi-bin/query?pg=q&what=web&fmt=.&q="+theEntry //Altavista 1997else if(type==2) engine="http://groups.google.com/groups?q="+theEntry+"&hl=en&lr=&safe=off&btnG=Google+Search&site=groups"; //Google Deja News (Usenet) 1998else if(type==3) engine="http://www.excite.com/search.gw?trace=a&search="+theEntry; //Excite 1999else if(type==4) engine="http://www.search.hotbot.com/hResult.html?SM=MC&MT="+theEntry+"&DV=7&RG=.com&DC=10&DE=2&OPs=MDRTP&_v=2&DU=days&SW=web&search.x=23&search.y=8"; //HotBot 2000else if(type==5) engine="http://www.google.com/search?q="+theEntry+"&btnG=Google+Search" //Google 2001else if(type==6) engine="http://search.msn.com/results.asp?RS=CHECKED&FORM=MSNH&v=1&q="+theEntry; //MSN 2002else if(type==7) engine="http://www.lycos.com/cgi-bin/pursuit?query="+theEntry+"&matchmode=and&cat=lycos&x=33&y=10"; //Lycos 2003else if(type==8) engine="http://shopper.cnet.com/shopping/search/results/1,10214,0-1257,00.html?tag=st%2Esh%2E1257%2Esbsr&qt="+theEntry+"&cn=&ca=1257" //Shopper.com 2004else if(type==9) engine="http://search.excite.com/search.gw?c=web&lk=webcrawler&onload=&s="+theEntry;//Webcrawler 2005else if(type==10) engine="http://search.yahoo.com/bin/search?p="+theEntry //Yahoo 2006if (theEntry=="") { alert("Please enter a search keyword!") } 2007else { newWindow=window.open(engine, action[6],"toolbar,location,directories,status,menubar,scrollbars,resizable=1") } 2008} 2009 2010function CSshowtimedateID(action) { 2011 (action[2] != "") ? (updateobject = action[2]) : (updateobject = action[1]) 2012 showtime = action[3] 2013 usemilitary = action[4] 2014 showdate = action[5] 2015 dateformat = action[6] 2016 showday = action[7] 2017 leadin = action[8] 2018 opentag = action[9] 2019 closetag = action[10]
2020 theTimer = setTimeout("theClockDate()",10); 2021} 2022function theClockDate() { 2023 now = new Date() 2024 theMonth = now.getMonth() + 1 2025 theDate = now.getDate() 2026 theYear = now.getFullYear() 2027 theDay = now.getDay() 2028 hours = now.getHours() 2029 if(navigator.appVersion.indexOf("MSIE 5.0; Macintosh") != -1) { 2030 if (theMonth <= 11 && theMonth >= 4) { hours = hours + 1} 2031 } 2032 ampm = ((hours >= 12) ? "PM" : "AM"); 2033 hours = ((hours > 12 && usemilitary == false) ? hours -12 : hours); 2034 if (hours == 0) hours = 12; 2035 if (hours >= 1 && hours <=9) hours = "0" + hours; 2036 minutes = now.getMinutes() 2037 if (minutes < 10) minutes = "0" + minutes; 2038 time = ""; 2039 (showtime == true) ? (time = " " + hours + ":" + minutes) : (time = "",ampm=""); 2040 (usemilitary == true) ? (ampm="") : (ampm=ampm); 2041 days = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"); 2042 today = days[theDay]; 2043 if (showdate == true) { 2044 if (dateformat == 0) todisplay = theMonth + "/" + theDate + "/" + theYear; 2045 if (dateformat == 1) todisplay = theDate + "/" + theMonth + "/" + theYear; 2046 if (dateformat == 2) todisplay = theYear + "/" + theMonth + "/" + theDate; 2047 if (dateformat == 3) todisplay = theYear + "/" + theDate + "/" + theMonth; 2048 } else {todisplay = "" } 2049 if (showday == true) todisplay = today + ", " + todisplay; 2050 if (document.all) { document.all(updateobject).innerHTML = opentag + leadin + todisplay + time + " " + ampm + closetag; } 2051 else { 2052 if (document.getElementById) { document.getElementById(updateobject).innerHTML = opentag + leadin + todisplay + time + " " + ampm + closetag; } 2053} 2054theTimer = setTimeout("theClockDate()",2000); 2055} 2056function CSshowtime(action) { 2057message = action[1] 2058military = action[2] 2059offset = action[3] 2060dst = action[4] 2061statuscheck = action[5] 2062formcheck = action[6] 2063form = action[7]; 2064elem = action[8]; 2065var dstoffset = 0 2066theTimer = setTimeout("theClock()",10); 2067} 2068 2069function theClock() { 2070clearTimeout(theTimer); 2071var now = new Date(); 2072var correct = now.toGMTString(); 2073time_string = correct.split(' '); 2074hm = time_string[4]; 2075hm_string = hm.split(':'); 2076var hours = hm_string[0] - 0; 2077var suffix = " A.M." 2078if (dst == true) dstoffset = 1 2079hours = hours + offset + dst; 2080 if (hours < 0) hours +=24 2081 if (hours > 11 && hours < 24) suffix = " P.M." 2082 if (hours > 12 && military == false) hours -=12; 2083 2084var minutes = now.getMinutes(); 2085var timeValue12 = "" + ((hours > 12) ? hours -12 : hours) 2086if (timeValue12 == 0) timeValue12 = 12 2087var timeValue24 = "" + ((hours > 23) ? hours -24 : hours) 2088timeValue12 += ((minutes < 10) ? ":0" : ":") + minutes 2089timeValue12 += suffix 2090timeValue24 += ((minutes < 10) ? ":0" : ":") + minutes 2091 if(military == false) { 2092 WorldTime = message + timeValue12; 2093 } else { 2094 WorldTime = message + timeValue24 2095 } 2096 if(statuscheck == true) window.status = WorldTime 2097 if(formcheck == true) document.forms[form].elements[elem].value = WorldTime 2098theTimer = setTimeout("theClock()",5000); 2099} 2100function CSSetBackColor(action) { document.bgColor = action[1]; } 2101// EOF
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.