home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
theapplecollection.com
/
www.theapplecollection.com.tar
/
www.theapplecollection.com
/
nav
/
scriptsubmit.js
< prev
next >
Wrap
Text File
|
2004-08-23
|
5KB
|
218 lines
// Script Copyright (C) 2001 www.dvdesign.com
// All part of this JavaScript is Copyrighted. Do not use without permission.
Agent = window.navigator.userAgent;
Version = parseInt(Agent.charAt(Agent.indexOf("/")+1),10);
var visLayers = new Array();
var lastSubLayer = null;
var numVisLayers = -1;
var retrunSrcImage = null;
var retrunNameImage = null;
var timerName = null;
preloadImages ();
/*********************************/
function IsIE() { return Agent.indexOf("MSIE") > 0; }
function IEStyl(s) { return document.all.tags("div")[s].style; }
function NSStyl(s) { return FindElement(s,0); }
/*********************************/
function cleanUpLayers ()
{
if (numVisLayers == -1)
return;
if (retrunSrcImage != null)
{
SetImageURL (retrunNameImage, retrunSrcImage);
retrunSrcImage = null;
retrunNameImage = null;
}
for (i = 0; i <= numVisLayers; i ++)
{
var item = visLayers[i];
if (IsIE())
IEStyl(item).visibility = "hidden";
else
NSStyl(item).visibility = "hidden";
visLayers[i] = null;
}
numVisLayers = -1;
lastSubLayer = null;
}
/*********************************/
function hideLastLayer ()
{
temp = visLayers[numVisLayers];
var item = null;
if (IsIE())
IEStyl(temp).visibility = "hidden";
else
NSStyl(temp).visibility = "hidden";
visLayers[numVisLayers] = null;
numVisLayers--;
lastSubLayer = null;
}
/*********************************/
function showLayer(s, doClear, imageName, origPath, newPath)
{
if (doClear == 1)
cleanUpLayers ();
if (IsIE())
IEStyl(s).visibility = "visible";
else
NSStyl(s).visibility = "visible";
if (origPath != "")
{
SetImageURL(imageName, newPath);
retrunSrcImage = origPath;
retrunNameImage = imageName;
}
addToArray (s);
stopTimeOut();
}
/*********************************/
function showSubLayer(s)
{
if (lastSubLayer != null)
hideLastLayer();
var item = null;
if (IsIE())
IEStyl(s).visibility = "visible";
else
NSStyl(s).visibility = "visible";
addToArray (s);
lastSubLayer = s;
}
/*********************************/
function addToArray (item)
{
var found = false;
if (numVisLayers == -1)
{
visLayers[++numVisLayers] = item;
return;
}
for (i = 0; i <= numVisLayers; i ++)
{
if (visLayers[i] == item)
found = true;
}
if (! found)
visLayers[++numVisLayers] = item;
}
/*********************************/
function hideLayer(s)
{
if (IsIE()) { IEStyl(s).visibility = "hidden"; }
else { NSStyl(s).visibility = "hidden"; }
}
/*********************************/
function button_over (name, path, classid )
{
showLayer( classid , 0);
//SetImageURL (name, path);
return true;
}
/*********************************/
function button_out(name, path, classid )
{
hideLayer( classid );
//SetImageURL (name, path);
return true;
}
/*********************************/
function SetImageURL (name, path)
{
var img = null;
if (document.images)
{
if (!IsIE()) { img = FindElement(name, 0); }
else { img = document.images[name]; }
if (img)
{
img.src = path;
}
}
}
/*********************************/
function startTimeOut() {
timerName = setTimeout ("timeProc()", 200);
}
/*********************************/
function stopTimeOut() {
if (timerName != null) {
clearTimeout (timerName);
timerName = null;
}
}
/*********************************/
function timeProc () {
cleanUpLayers();
timerName = null;
}
function preloadImages () {
if (document.images) {
Image1 = new Image();
Image2 = new Image();
Image3 = new Image();
Image4 = new Image();
Image5 = new Image();
Image6 = new Image();
Image7 = new Image();
Image8 = new Image();
Image9 = new Image();
Image10 = new Image();
Image11 = new Image();
Image12 = new Image();
Image13 = new Image();
Image14 = new Image();
Image1.src = '/images/nav2004/home2.gif';
Image2.src = '/images/nav2004/desktop2.gif';
Image3.src = '/images/nav2004/collection2.gif';
Image4.src = '/images/nav2004/news2.gif';
Image5.src = '/images/nav2004/proto2.gif';
Image6.src = '/images/nav2004/ecard2.gif';
Image7.src = '/images/nav2004/books2.gif';
Image8.src = '/images/nav2004/shop2.gif';
Image9.src = '/images/nav2004/links2.gif';
Image10.src = '/images/nav2004/forum2.gif';
Image11.src = '/images/nav2004/var2.gif';
Image12.src = '/images/nav2004/submit2.gif';
Image13.src = '/images/nav2004/help2.gif';
Image14.src = '/images/nav2004/copy2.gif';
}
}
/*********************************/
function FindElement (n,ly)
{
if (Version < 4)
return document[n];
var curDoc = ly ? ly.document : document;
var elem = curDoc[n];
if (!elem)
{
for (var i=0;i<curDoc.layers.length;i++)
{
elem = FindElement(n,curDoc.layers[i]);
if (elem)
return elem;
}
}
return elem;
}