1/******************************************************************* 2* 3* File : JSFX_Browser.js © JavaScript-FX.com 4* 5* Created : 2000/07/15 6* 7* Author : Roy Whittle www.Roy.Whittle.com 8* 9* Purpose : To create a cross browser "Browser" object. 10* JSFX.Browser library will allow scripts to query parameters 11* about the current browser window. 12* 13* History 14* Date Version Description 15* 2001-03-17 2.0 Converted for javascript-fx 16***********************************************************************/ 17if(!window.JSFX) 18 JSFX=new Object(); 19 20if(!JSFX.Browser) 21 JSFX.Browser = new Object(); 22 23if(navigator.appName.indexOf("Netscape") != -1) 24{ 25 JSFX.Browser.getCanvasWidth = function() {return innerWidth;} 26 JSFX.Browser.getCanvasHeight = function() {return innerHeight;} 27 JSFX.Browser.getWindowWidth = function() {return outerWidth;} 28 JSFX.Browser.getWindowHeight = function() {return outerHeight;} 29 JSFX.Browser.getScreenWidth = function() {return screen.width;} 30 JSFX.Browser.getScreenHeight = function() {return screen.height;} 31 JSFX.Browser.getMinX = function() {return(pageXOffset);} 32 JSFX.Browser.getMinY = function() {return(pageYOffset);} 33 JSFX.Browser.getMaxX = function() {return(pageXOffset+innerWidth);} 34 JSFX.Browser.getMaxY = function() {return(pageYOffset+innerHeight);} 35 36} 37else if(document.all) { 38 JSFX.Browser.getCanvasWidth = function() {return document.body.clientWidth;} 39 JSFX.Browser.getCanvasHeight = function() {return document.body.clientHeight;} 40 JSFX.Browser.getWindowWidth = function() {return document.body.clientWidth;} 41 JSFX.Browser.getWindowHeight = function() {return document.body.clientHeight;} 42 JSFX.Browser.getScreenWidth = function() {return screen.width;} 43 JSFX.Browser.getScreenHeight = function() {return screen.height;} 44 JSFX.Browser.getMinX = function() {return(document.body.scrollLeft);} 45 JSFX.Browser.getMinY = function() {return(document.body.scrollTop);} 46 JSFX.Browser.getMaxX = function() { 47 return(document.body.scrollLeft 48 +document.body.clientWidth); 49 } 50 JSFX.Browser.getMaxY = function() { 51 return(document.body.scrollTop 52 +document.body.clientHeight); 53 } 54} 55/*** End ***/ 56/******************************************************************* 57* File : JSFX_Layer.js © JavaScript-FX.com 58* Created : 2001/04/11 59* Author : Roy Whittle ([email protected]) www.Roy.Whittle.com 60* Purpose : To create a cross browser dynamic layers. 61* History 62* Date Version Description 63* 2001-03-17 3.0 Completely re-witten for use by javascript-fx 64***********************************************************************/ 65if (!window.JSFX) 66 JSFX = new Object(); 67 68JSFX.layerNo = 0; 69/**********************************************************************************/ 70JSFX.createElem = function (htmlStr, x, y) { 71 var elem = null; 72 73 if (document.layers) { 74 elem = new Layer(2000); 75 elem.document.open(); 76 elem.document.write(htmlStr); 77 elem.document.close(); 78 elem.moveTo(x, y); 79 elem.innerHTML = htmlStr; 80 } 81 else 82 if (document.all) { 83 var xName = "xLayer" + JSFX.layerNo++; 84 var txt = "<DIV ID='" + xName 85 + "' STYLE=\"position:absolute;" 86 + "left:" + x + ";"
87 + "top:" + y + ";" 88 + "visibility:hidden\">" 89 + htmlStr 90 + "</DIV>"; 91 92 document.body.insertAdjacentHTML("BeforeEnd", txt); 93 94 elem = document.all[xName]; 95 } 96 else 97 if (document.getElementById) { 98 var xName = "xLayer" + JSFX.layerNo++; 99 var txt = "" 100 + "position:absolute;" 101 + "left:" + x + "px;" 102 + "top:" + y + "px;" 103 + "visibility:hidden"; 104 105 var newRange = document.createRange(); 106 107 elem = document.createElement("DIV"); 108 elem.setAttribute("style", txt); 109 elem.setAttribute("id", xName); 110 111 document.body.appendChild(elem); 112 113 newRange.setStartBefore(elem); 114 strFrag = newRange.createContextualFragment(htmlStr); 115 elem.appendChild(strFrag); 116 } 117 118 return elem; 119} 120/**********************************************************************************/ 121JSFX.Layer = function (newLayer, x, y) { 122 if (!newLayer) 123 return; 124 125 if (x == null) x = 0; 126 if (y == null) y = 0; 127 128 if (typeof newLayer == "string") 129 this.elem = JSFX.createElem(newLayer, x, y); 130 else 131 this.elem = newLayer; 132 133 if (document.layers) { 134 this.images = this.elem.document.images; 135 this.style = this.elem; 136 } 137 else { 138 this.images = document.images; 139 this.style = this.elem.style; 140 } 141} 142/**********************************************************************************/ 143JSFX.findLayer = function (theDiv, d) { 144 if (document.layers) { 145 var i; 146 if (d == null) d = document; 147 var theLayer = d.layers[theDiv]; 148 if (theLayer != null) 149 return (theLayer); 150 else 151 for (i = 0 ; i < d.layers.length ; i++) { 152 theLayer = JSFX.findLayer(theDiv, d.layers[i].document); 153 if (theLayer != null) 154 return (theLayer); 155 } 156 return ("Undefined...."); 157 } 158 else 159 if (document.all) 160 return (document.all[theDiv]); 161 else 162 if (document.getElementById) 163 return (document.getElementById(theDiv)); 164 else 165 return ("Undefined....."); 166} 167var ns4 = (navigator.appName.indexOf("Netscape") != -1 && !document.getElementById); 168 169/**********************************************************************************/ 170/*** moveTo (x,y) ***/ 171JSFX.Layer.prototype.moveTo = function (x, y) { 172 this.style.right = x + "px"; 173 this.style.top = y + "px"; 174} 175if (ns4) 176 JSFX.Layer.prototype.moveTo = function (x, y) { this.elem.moveTo(x, y); } 177/**********************************************************************************/ 178/*** show()/hide() Visibility ***/ 179JSFX.Layer.prototype.show = function () { this.style.visibility = "visible"; } 180JSFX.Layer.prototype.hide = function () { this.style.visibility = "hidden"; } 181JSFX.Layer.prototype.isVisible = function () { return this.style.visibility == "visible"; } 182if (ns4) { 183 JSFX.Layer.prototype.show = function () { this.style.visibility = "show"; } 184 JSFX.Layer.prototype.hide = function () { this.style.visibility = "hide"; } 185 JSFX.Layer.prototype.isVisible = function () { return this.style.visibility == "show"; } 186} 187/**********************************************************************************/ 188/*** zIndex ***/ 189JSFX.Layer.prototype.setzIndex = function (z) { this.style.zIndex = z; } 190JSFX.Layer.prototype.getzIndex = function () { return this.style.zIndex; } 191/**********************************************************************************/ 192/*** BackGround Color ***/ 193JSFX.Layer.prototype.setBgColor = function (color) { this.style.backgroundColor = color == null ? 'transparent' : color; } 194if (ns4) 195 JSFX.Layer.prototype.setBgColor = function (color) { this.elem.bgColor = color; } 196/**********************************************************************************/ 197/*** BackGround Image ***/ 198JSFX.Layer.prototype.setBgImage = function (image) { this.style.backgroundImage = "url(" + image
198+ ")"; } 199if (ns4) 200 JSFX.Layer.prototype.setBgImage = function (image) { this.style.background.src = image; } 201/**********************************************************************************/ 202/*** set Content***/ 203JSFX.Layer.prototype.setContent = function (xHtml) { this.elem.innerHTML = xHtml; } 204if (ns4) 205 JSFX.Layer.prototype.setContent = function (xHtml) { 206 this.elem.document.open(); 207 this.elem.document.write(xHtml); 208 this.elem.document.close(); 209 } 210 211/**********************************************************************************/ 212/*** Clipping ***/ 213JSFX.Layer.prototype.clip = function (x1, y1, x2, y2) { this.style.clip = "rect(" + y1 + " " + x2 + " " + y2 + " " + x1 + ")"; } 214if (ns4) 215 JSFX.Layer.prototype.clip = function (x1, y1, x2, y2) { 216 this.style.clip.top = y1; 217 this.style.clip.left = x1; 218 this.style.clip.bottom = y2; 219 this.style.clip.right = x2; 220 } 221/**********************************************************************************/ 222/*** Resize ***/ 223JSFX.Layer.prototype.resizeTo = function (w, h) { 224 this.style.width = w + "px"; 225 this.style.height = h + "px"; 226} 227if (ns4) 228 JSFX.Layer.prototype.resizeTo = function (w, h) { 229 this.style.clip.width = w; 230 this.style.clip.height = h; 231 } 232/**********************************************************************************/ 233/*** getX/Y ***/ 234JSFX.Layer.prototype.getX = function () { return parseInt(this.style.left); } 235JSFX.Layer.prototype.getY = function () { return parseInt(this.style.top); } 236if (ns4) { 237 JSFX.Layer.prototype.getX = function () { return this.style.left; } 238 JSFX.Layer.prototype.getY = function () { return this.style.top; } 239} 240/**********************************************************************************/ 241/*** getWidth/Height ***/ 242JSFX.Layer.prototype.getWidth = function () { return this.elem.offsetWidth; } 243JSFX.Layer.prototype.getHeight = function () { return this.elem.offsetHeight; } 244if (!document.getElementById) 245 JSFX.Layer.prototype.getWidth = function () { 246 //Extra processing here for clip 247 return this.elem.scrollWidth; 248 } 249 250if (ns4) { 251 JSFX.Layer.prototype.getWidth = function () { return this.style.clip.right; } 252 JSFX.Layer.prototype.getHeight = function () { return this.style.clip.bottom; } 253} 254 255/******************************************************************* 256* File : FloatingCartObjKopaLayer.js © JavaScript-FX.com 257* Created : 2001/04/11 258* Author : Roy Whittle ([email protected]) www.Roy.Whittle.com 259* Purpose : To create a cross browser dynamic layers. 260* History 261* Date Version Description 262* 2001-03-17 3.0 Completely re-witten for use by javascript-fx 263* 2001-09-08 3.1 Added the ability for child layers 264* 2001-09-23 3.2 Save a reference so we can use a self referencing timer 265* 2001-09-28 3.3 Add a width for Netscape 4.x 266* 2001-09-28 3.4 Remove width for Netscape 4.x create layer (Not needed) 267* 2002-01-21 3.5 Declare only one instance of variables in createLayer 268***********************************************************************/ 269var ns4 = (navigator.appName.indexOf("Netscape") != -1 && !document.getElementById); 270 271if (!window.FloatingCartObj) 272 FloatingCartObj = new Object(); 273 274FloatingCartObj.layerNo = 0; 275/**********************************************************************************/ 276FloatingCartObj.createLayer = function (htmlStr, parent) { 277 //Declare all variables first 278 var elem = null; 279 var xName; 280 var txt; 281 282 if (document.layers) { 283 xName = "xLayer" + FloatingCartObj.layerNo++; 284 if (parent == null) 285 elem = new Layer(2000); 286 else 287 elem = new Layer(2000, parent.elem); 288 289 elem.document.open(); 290 elem.document.write(htmlStr); 291 elem.document.close(); 292 elem.moveTo(0, 0); 293 elem.innerHTML = htmlStr; 294 } 295 else 296 if (document.all) { 297 if (parent == null) 298 parent = document.body; 299 else 300 parent = parent.elem; 301 302 xName = "xLayer" + FloatingCartObj.layerNo++; 303 txt = '<DIV ID="' + xName + '"' 304 + ' STYLE="position:absolute;
304left:0;top:0;visibility:hidden">' 305 + htmlStr 306 + '</DIV>'; 307 308 parent.insertAdjacentHTML("BeforeEnd", txt); 309 310 elem = document.all[xName]; 311 } 312 else 313 if (document.getElementById) { 314 if (parent == null) 315 parent = document.body; 316 else 317 parent = parent.elem; 318 319 xName = "xLayer" + FloatingCartObj.layerNo++; 320 txt = "" 321 + "position:absolute;left:0px;top:0px;visibility:hidden"; 322 323 var newRange = document.createRange(); 324 325 elem = document.createElement("DIV"); 326 elem.setAttribute("style", txt); 327 elem.setAttribute("id", xName); 328 329 parent.appendChild(elem); 330 331 newRange.setStartBefore(elem); 332 strFrag = newRange.createContextualFragment(htmlStr); 333 elem.appendChild(strFrag); 334 } 335 336 return elem; 337} 338/**********************************************************************************/ 339FloatingCartObj.Layer = function (newLayer, parent) { 340 if (!newLayer) 341 return; 342 343 if (typeof newLayer == "string") 344 this.elem = FloatingCartObj.createLayer(newLayer, parent); 345 else 346 this.elem = newLayer; 347 348 if (document.layers) { 349 this.images = this.elem.document.images; 350 this.parent = parent; 351 this.style = this.elem; 352 if (parent != null) 353 this.style.visibility = "inherit"; 354 } 355 else { 356 this.images = document.images; 357 this.parent = parent; 358 this.style = this.elem.style; 359 } 360 window[this.elem.id] = this; //save a reference to this 361} 362/**********************************************************************************/ 363FloatingCartObj.findLayer = function (theDiv, d) { 364 if (document.layers) { 365 var i; 366 if (d == null) d = document; 367 var theLayer = d.layers[theDiv]; 368 if (theLayer != null) 369 return (theLayer); 370 else 371 for (i = 0 ; i < d.layers.length ; i++) { 372 theLayer = FloatingCartObj.findLayer(theDiv, d.layers[i].document); 373 if (theLayer != null) 374 return (theLayer); 375 } 376 return ("Undefined...."); 377 } 378 else 379 if (document.all) 380 return (document.all[theDiv]); 381 else 382 if (document.getElementById) 383 return (document.getElementById(theDiv)); 384 else 385 return ("Undefined....."); 386} 387 388/**********************************************************************************/ 389/*** moveTo (x,y) ***/ 390FloatingCartObj.Layer.prototype.moveTo = function (x, y) { 391 this.style.left = x + "px"; 392 this.style.top = y + "px"; 393} 394if (ns4) 395 FloatingCartObj.Layer.prototype.moveTo = function (x, y) { this.elem.moveTo(x, y); } 396/**********************************************************************************/ 397/*** show()/hide() Visibility ***/ 398FloatingCartObj.Layer.prototype.show = function () { this.style.visibility = "visible"; } 399FloatingCartObj.Layer.prototype.hide = function () { this.style.visibility = "hidden"; } 400FloatingCartObj.Layer.prototype.isVisible = function () { return this.style.visibility == "visible"; } 401if (ns4) { 402 FloatingCartObj.Layer.prototype.show = function () { this.style.visibility = "show"; } 403 FloatingCartObj.Layer.prototype.hide = function () { this.style.visibility = "hide"; } 404 FloatingCartObj.Layer.prototype.isVisible = function () { return this.style.visibility == "show"; } 405} 406/**********************************************************************************/ 407/*** zIndex ***/ 408FloatingCartObj.Layer.prototype.setzIndex = function (z) { this.style.zIndex = z; } 409FloatingCartObj.Layer.prototype.getzIndex = function () { return this.style.zIndex; } 410/**********************************************************************************/ 411/*** ForeGround (text) Color ***/ 412FloatingCartObj.Layer.prototype.setColor = function (c) { this.style.color = c; } 413if (ns4) 414 FloatingCartObj.Layer.prototype.setColor = function (c) { 415 this.elem.document.write("<FONT COLOR='" + c + "'>" + this.elem.innerHTML + "</FONT>"); 416 this.elem.document.close(); 417 } 418/**********************************************************************************/ 419/*** BackGround Color ***/
420FloatingCartObj.Layer.prototype.setBgColor = function (color) { this.style.backgroundColor = color == null ? 'transparent' : color; } 421if (ns4) 422 FloatingCartObj.Layer.prototype.setBgColor = function (color) { this.elem.bgColor = color; } 423/**********************************************************************************/ 424/*** BackGround Image ***/ 425FloatingCartObj.Layer.prototype.setBgImage = function (image) { this.style.backgroundImage = "url(" + image + ")"; } 426if (ns4) 427 FloatingCartObj.Layer.prototype.setBgImage = function (image) { this.style.background.src = image; } 428/**********************************************************************************/ 429/*** set Content***/ 430FloatingCartObj.Layer.prototype.setContent = function (xHtml) { this.elem.innerHTML = xHtml; } 431if (ns4) 432 FloatingCartObj.Layer.prototype.setContent = function (xHtml) { 433 this.elem.document.write(xHtml); 434 this.elem.document.close(); 435 this.elem.innerHTML = xHtml; 436 } 437 438/**********************************************************************************/ 439/*** Clipping ***/ 440FloatingCartObj.Layer.prototype.clip = function (x1, y1, x2, y2) { this.style.clip = "rect(" + y1 + " " + x2 + " " + y2 + " " + x1 + ")"; } 441if (ns4) 442 FloatingCartObj.Layer.prototype.clip = function (x1, y1, x2, y2) { 443 this.style.clip.top = y1; 444 this.style.clip.left = x1; 445 this.style.clip.bottom = y2; 446 this.style.clip.right = x2; 447 } 448/**********************************************************************************/ 449/*** Resize ***/ 450FloatingCartObj.Layer.prototype.resizeTo = function (w, h) { 451 this.style.width = w + "px"; 452 this.style.height = h + "px"; 453} 454if (ns4) 455 FloatingCartObj.Layer.prototype.resizeTo = function (w, h) { 456 this.style.clip.width = w; 457 this.style.clip.height = h; 458 } 459/**********************************************************************************/ 460/*** getX/Y ***/ 461FloatingCartObj.Layer.prototype.getX = function () { return parseInt(this.style.left); }
462FloatingCartObj.Layer.prototype.getY = function () { return parseInt(this.style.top); } 463if (ns4) { 464 FloatingCartObj.Layer.prototype.getX = function () { return this.style.left; } 465 FloatingCartObj.Layer.prototype.getY = function () { return this.style.top; } 466} 467/**********************************************************************************/ 468/*** getWidth/Height ***/ 469FloatingCartObj.Layer.prototype.getWidth = function () { return this.elem.offsetWidth; } 470FloatingCartObj.Layer.prototype.getHeight = function () { return this.elem.offsetHeight; } 471if (!document.getElementById) 472 FloatingCartObj.Layer.prototype.getWidth = function () { 473 //Extra processing here for clip 474 return this.elem.scrollWidth; 475 } 476 477if (ns4) { 478 FloatingCartObj.Layer.prototype.getWidth = function () { return this.style.clip.right; } 479 FloatingCartObj.Layer.prototype.getHeight = function () { return this.style.clip.bottom; } 480} 481/**********************************************************************************/ 482/*** Opacity ***/ 483if (ns4) { 484 FloatingCartObj.Layer.prototype.setOpacity = function (pc) { return 0; } 485} 486else if (document.all) { 487 FloatingCartObj.Layer.prototype.setOpacity = function (pc) { 488 if (this.style.filter == "") 489 this.style.filter = "alpha(opacity=100);"; 490 this.elem.filters.alpha.opacity = pc; 491 } 492} 493else { 494 /*** Assume NS6 ***/ 495 FloatingCartObj.Layer.prototype.setOpacity = function (pc) { this.style.MozOpacity = pc + '%' } 496} 497/**************************************************************************/ 498/*** Event Handling - Start ***/ 499/*** NS4 ***/ 500if (ns4) { 501 FloatingCartObj.eventmasks = { 502 onabort: Event.ABORT, onblur: Event.BLUR, onchange: Event.CHANGE, 503 onclick: Event.CLICK, ondblclick: Event.DBLCLICK, 504 ondragdrop: Event.DRAGDROP, onerror: Event.ERROR, 505 onfocus: Event.FOCUS, onkeydown: Event.KEYDOWN, 506 onkeypress: Event.KEYPRESS, onkeyup: Event.KEYUP, onload: Event.LOAD, 507 onmousedown: Event.MOUSEDOWN, onmousemove: Event.MOUSEMOVE, 508 onmouseout: Event.MOUSEOUT, onmouseover: Event.MOUSEOVER, 509 onmouseup: Event.MOUSEUP, onmove: Event.MOVE, onreset: Event.RESET, 510 onresize: Event.RESIZE, onselect: Event.SELECT, onsubmit: Event.SUBMIT,
511 onunload: Event.UNLOAD 512 }; 513 FloatingCartObj.Layer.prototype.addEventHandler = function (eventname, handler) { 514 this.elem.captureEvents(FloatingCartObj.eventmasks[eventname]); 515 var xl = this; 516 this.elem[eventname] = function (event) { 517 event.clientX = event.pageX; 518 event.clientY = event.pageY; 519 event.button = event.which; 520 event.keyCode = event.which; 521 event.altKey = ((event.modifiers & Event.ALT_MASK) != 0); 522 event.ctrlKey = ((event.modifiers & Event.CONTROL_MASK) != 0); 523 event.shiftKey = ((event.modifiers & Event.SHIFT_MASK) != 0); 524 return handler(xl, event); 525 } 526 } 527 FloatingCartObj.Layer.prototype.removeEventHandler = function (eventName) { 528 this.elem.releaseEvents(FloatingCartObj.eventmasks[eventName]); 529 this.elem[eventName] = null; 530 } 531} 532 /**************************************************************************/ 533 /** IE 4/5+***/ 534else 535 if (document.all) { 536 FloatingCartObj.Layer.prototype.addEventHandler = function (eventName, handler) { 537 var xl = this; 538 this.elem[eventName] = function () { 539 var e = window.event; 540 e.cancelBubble = true; 541 if (document.getElementById) { 542 e.layerX = e.offsetX; 543 e.layerY = e.offsetY; 544 } 545 else { 546 /*** Work around for IE 4 : clone window.event ***/ 547 ev = new Object(); 548 for (i in e) 549 ev[i] = e[i]; 550 ev.layerX = e.offsetX; 551 ev.layerY = e.offsetY; 552 e = ev; 553 } 554 555 return handler(xl, e); 556 } 557 } 558 FloatingCartObj.Layer.prototype.removeEventHandler = function (eventName) { 559 this.elem[eventName] = null; 560 } 561 } 562 /**************************************************************************/ 563 /*** Assume NS6 ***/ 564 else { 565 FloatingCartObj.Layer.prototype.addEventHandler = function (eventName, handler) { 566 var xl = this; 567 this.elem[eventName] = function (e) { 568 e.cancelBubble = true; 569 return handler(xl, e); 570 } 571 } 572 FloatingCartObj.Layer.prototype.removeEventHandler = function (eventName) { 573 this.elem[eventName] = null; 574 } 575 } 576/*** Event Handling - End ***/ 577/**************************************************************************/ 578FloatingCartObj.Layer.prototype.setTimeout = function (f, t) { 579 setTimeout("window." + this.elem.id + "." + f, t); 580} 581 582/****************************************************************** 583* File : FloatingCartObjSlide.js © JavaScript-FX.com 584* Created : 2002/03/14 585* Author : Roy Whittle ([email protected]) www.Roy.Whittle.com 586* Purpose : To create a cross browser sliding layer. 587* History 588* Date Version Description 589* 2001-09-08 1.0 Extended from FloatingCartObj.Layer 590***********************************************************************/ 591if (window.opera) { 592 /*** moveTo (x,y) ***/ 593 FloatingCartObj.Layer.prototype.moveTo = function (x, y) { 594 this.style.left = x; 595 this.style.top = y; 596 } 597} 598/**********************************************************************************/ 599//Class FloatingCartObj.LeftSlidingDiv extends Layer 600FloatingCartObj.LeftSlidingDiv = function (newLayer, x, y, isStatic) { 601 if (!newLayer) 602 return; 603 this.superC = FloatingCartObj.Layer; 604 this.superC(newLayer); 605 606 this.startX = x; 607 this.startY = y; 608 this.endX = 0; 609 this.x = x; 610 this.y = isStatic ? y : -200; 611 this.inStep = 35; 612 this.outStep = 10; 613 this.state = "OFF"; 614 this.isStatic = isStatic; 615 616 this.moveTo(this.x, this.y); 617 this.addEventHandler("onmouseover", this.slideIn); 618 this.addEventHandler("onmouseout", this.slideOut); 619 this.setTimeout("animate()", 30); 620} 621FloatingCartObj.LeftSlidingDiv.prototype = new FloatingCartObj.Layer; 622
623FloatingCartObj.LeftSlidingDiv.prototype.slideInImg = function (theEvent) { 624 theLayer = this.nav; 625 theLayer.slideIn(theLayer, theEvent); 626} 627FloatingCartObj.LeftSlidingDiv.prototype.slideIn = function (theLayer, theEvent) { 628 if (theLayer.state == "OFF") { 629 theLayer.state = "SLIDING_IN"; 630 } 631 else if (theLayer.state == "SLIDING_IN") { 632 } 633 else if (theLayer.state == "SLIDING_IN_OUT") { 634 theLayer.state = "SLIDING_IN"; 635 } 636 else if (theLayer.state == "SLIDING_OUT") { 637 theLayer.state = "SLIDING_IN"; 638 } 639 else if (theLayer.state == "ON") { 640 } 641 642 return false; 643} 644FloatingCartObj.LeftSlidingDiv.prototype.slideOutImg = function (theEvent) { 645 theLayer = this.nav; 646 theLayer.slideOut(theLayer, theEvent); 647} 648FloatingCartObj.LeftSlidingDiv.prototype.slideOut = function (theLayer, theEvent) { 649 if (theLayer.state == "ON") { 650 theLayer.state = "SLIDING_OUT"; 651 } 652 else if (theLayer.state == "SLIDING_OUT") { 653 } 654 else if (theLayer.state == "SLIDING_IN_OUT") { 655 } 656 else if (theLayer.state == "OFF") { 657 } 658 else if (theLayer.state == "SLIDING_IN") { 659 theLayer.state = "SLIDING_IN_OUT"; 660 } 661 662 return false; 663} 664FloatingCartObj.LeftSlidingDiv.prototype.getTop = function () { 665 if (this.isStatic) 666 { return 0; } 667 else if (typeof pageYOffset != "undefined") 668 { return pageYOffset; } 669 else if (document.body && typeof document.body.scrollTop != "undefined") 670 { return document.body.scrollTop; } 671 else 672 { return 0; } 673} 674FloatingCartObj.LeftSlidingDiv.prototype.animate = function () { 675 var sliding = false; 676 var ty; 677 678 if (this.state == "SLIDING_IN") { 679 this.x += this.inStep; 680 if (this.x >= this.endX) { 681 this.x = this.endX; 682 this.state = "ON"; 683 } 684 else { 685 sliding = true; 686 } 687 } 688 else if (this.state == "SLIDING_OUT") { 689 this.x -= ((this.x - this.startX) / 8) + 1; 690 if (this.x <= this.startX) { 691 this.x = this.startX; 692 this.state = "OFF"; 693 } 694 else 695 sliding = true; 696 } 697 else if (this.state == "SLIDING_IN_OUT") { 698 this.x += this.inStep; 699 if (this.x >= this.endX) { 700 this.x = this.endX; 701 this.state = "SLIDING_OUT"; 702 } 703 sliding = true; 704 } 705 var pY = this.getTop(); 706 this.moveTo(this.x, this.y += (pY + this.startY - this.y) / 8); 707 this.setTimeout("animate()", 30); 708} 709 710 711 712function UpdCartfloatingItem(CartItemID, ActionType) { 713 if (ActionType == "1") //Delete Item 714 { SetInnerHTMLFromAjaxResponse("../inc/FloatingCart/FloatingCart.asp?DelId=" + CartItemID, "SlidingCart"); } 715 if (ActionType == "2") //Update Quantity down 716 { SetInnerHTMLFromAjaxResponse("../inc/FloatingCart/FloatingCart.asp?UpdDownId=" + CartItemID, "SlidingCart"); } 717 if (ActionType == "3") //Update Quantity up 718 { SetInnerHTMLFromAjaxResponse("../inc/FloatingCart/FloatingCart.asp?UpdUpId=" + CartItemID, "SlidingCart"); } 719 RenderAllCarts(1); 720 721} 722 723 724document.addEventListener("DOMContentLoaded", function () { 725 726 const slidingCart = document.getElementById("SlidingCart"); 727 728 slidingCart.addEventListener("mouseenter", function () { 729 // Open the cart 730 slidingCart.style.left = "0px"; // Adjust to the visible position 731 slidingCart.style.transition = "left 0.5s ease-in-out"; // Smooth animation 732 }); 733 734 slidingCart.addEventListener("mouseleave", function () { 735 // Close the cart 736 slidingCart.style.left = "-400px"; // Adjust to the hidden position 737 slidingCart.style.transition = "left 0.5s ease-in-out"; // Smooth animation 738 }); 739}); 740 741 742function FloatingCartObj_StartEffects() { 743 /* 744 var top = 0; 745 var step = 30; 746 myFloatingBasket = new FloatingCartObj.LeftSlidingDiv(FloatingCartObj.findLayer("SlidingCart"), -400, top += step); 747 748 */ 749 const slidingCart = document.getElementById("SlidingCart"); 750 751 // Slide the cart out of view 752 slidingCart.style.left = "-400px"; 753 754} 755 756
757function OpenFloatingCart() { 758 759 if ( $('#mobile_minicart').is(":visible") ) 760 { 761 762 } 763 else 764 { 765 const slidingCart = document.getElementById("SlidingCart"); 766 767 // Slide the cart into view 768 slidingCart.style.left = "0"; 769 770 // Optional: Start other effects after the cart is fully open 771 setTimeout(FloatingCartObj_StartEffects, 3000); // 3 seconds after the cart slides in 772 773 /* 774 775 var top = 0; 776 var step = 30; 777 new FloatingCartObj.LeftSlidingDiv(FloatingCartObj.findLayer("SlidingCart"), 0, top += step); 778 setTimeout('FloatingCartObj_StartEffects()', 3000); 779 */ 780 } 781} 782 783 784 785/******************************************************************* 786* 787* File : JSFX_FloatingLayer.js © JavaScript-FX.com 788* 789* Created : 2001/03/16 790* 791* Author : Roy Whittle www.Roy.Whittle.com 792* 793* Purpose : To make and positional div float to 794* one plave on the page and stay there. 795* 796* History 797* Date Version Description 798* 799* 2001-03-17 2.0 Converted for javascript-fx 800***********************************************************************/ 801JSFX.FloatingLayer = function (theDiv, x, y) { 802 //Call the superclass constructor 803 this.superC = JSFX.Layer; 804 this.superC(JSFX.findLayer(theDiv), x, y); 805 806 this.baseX = x; 807 this.baseY = y; 808 this.x = x; 809 this.y = y; 810 this.moveTo(x, y); 811 this.show(); 812 813} 814JSFX.FloatingLayer.prototype = new JSFX.Layer; 815 816JSFX.FloatingLayer.prototype.animate = function () { 817 var targetX; 818 var targetY; 819 if (this.baseX > 0) 820 targetX = JSFX.Browser.getMinX() + this.baseX; 821 else 822 targetX = JSFX.Browser.getMaxX() + this.baseX; 823 824 if (this.baseY > 0) 825 targetY = JSFX.Browser.getMinY() + this.baseY; 826 else 827 targetY = JSFX.Browser.getMaxY() + this.baseY; 828 829 var dx = (targetX - this.x) / 8; 830 var dy = (targetY - this.y) / 8; 831 this.x += dx; 832 this.y += dy; 833 834 this.moveTo(this.x, this.y); 835} 836JSFX.MakeFloatingLayer = function (theDiv, x, y) { 837 JSFX.MakeFloatingLayer.floaters[JSFX.MakeFloatingLayer.floaters.length] = new JSFX.FloatingLayer(theDiv, x, y); 838} 839JSFX.MakeFloatingLayer.floaters = new Array(); 840JSFX.MakeFloatingLayer.animate = function () { 841 var i; 842 for (i = 0 ; i < JSFX.MakeFloatingLayer.floaters.length ; i++) 843 JSFX.MakeFloatingLayer.floaters[i].animate(); 844} 845setInterval("JSFX.MakeFloatingLayer.animate()", 30);
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.