Object Pointers

Giganews Newsgroups
Subject: Object Pointers
Posted by:  Ralph?? (ravens…@stis.net)
Date: Fri, 04 Jul 2003

I'm trying to use object pointers to access/modify various properties of
various layers.
The problem i'm having is that pointers created within my functions dont
have world scope even though the variables used are world variables.

Script Example:
var lyr1, lyr2;
function initIE(){
    lyr1 = layer1.style;
    lyr2 = layer2.style;
    lyr1.z = lyr1.zIndex;
    lyr2.z = lyr2.zIndex;

function switcher(a){
    lyr1.z = 9;
    lyr2.z = 8;
    a.style.zIndex = 11;

Now when switcher(a) is called lines 1 & 2 do not effect the 2 layer's
z-index while line 3 does what I want it to.
So I'm assuming that the object pointers created in initIE() are not given
world scope.
How do I rectify this?