I am using the script below for to move some divs in and out of view. It works fine in every browser i can find but ie.


the full script is below but ie crappy debugging leads me to think it may be to do with this function.


function movein()
{
if (parseInt(document.getElementById(layerin).style.left) >= inpos)
{
currposs = parseInt(document.getElementById(layerin).style.left);
newpos = currposs - speed;
document.getElementById(layerin).style.visibility ="visible";
document.getElementById(layerin).style.left = newpos +"px";
setTimeout('movein()',delay);
}
else
{
countin = 0;
}

}



rest of script is here

var version = " ";
var pos = "";

var styleSwitch = " ";
var layerin = " ";
var layerout = " ";
var countin = 0;
var plan = " ";
var i = " ";
var l = " ";
var arr = " ";
var c=0;
var t;
var newpos = " ";
var currposs = " ";
var findMeText = " ";
var layerRef="document.getElementById";
var speed = 38;
var delay = 1;
var outpos = 760;
var inpos = 380;
var pause = 2000;
var rotatedivs = "";



function find_div_class() {
var divCollection = document.getElementsByName("rotate");
rotatedivs = new Array();
for (var i=0; i<divCollection.length; i++) {
if(divCollection[i].getAttribute("name") == "rotate") {

findMeText = divCollection[i].getAttribute("id");
rotatedivs[i] = findMeText;

}

}

}

function initlayers()
{
arr=rotatedivs;

l = arr.length;
for (i=0; i <= l-1; i++)
{
eval(layerRef+'(["'+arr[i]+'"]).style.left = "798px"');
eval(layerRef+'(["'+arr[i]+'"]).style.visibility="hidden"');

}
}


function pauseit(div) {
moveinout(div);
if (t !== null) {
clearTimeout(t);
t = null;
}
}


function playit() {
if (t === null) {
t = setTimeout('rotatelayers()', 1000);
}
}




function movein()
{
if (parseInt(document.getElementById(layerin).style.left) >= inpos)
{
currposs = parseInt(document.getElementById(layerin).style.left);
newpos = currposs - speed;
document.getElementById(layerin).style.visibility ="visible";
document.getElementById(layerin).style.left = newpos +"px";
setTimeout('movein()',delay);
}
else
{
countin = 0;
}

}











function moveout()
{

if (parseInt(document.getElementById(layerout).style.left) <= outpos)
{
curpos = parseInt(document.getElementById(layerout).style.left);
newpos = curpos + speed;
document.getElementById(layerout).style.left = newpos +"px";
setTimeout('moveout()', delay );
}
else
{
document.getElementById(layerout).style.visibility ="hidden";
movein();
}

}






function moveinout(div)
{

if (countin === 0)
{
countin = 1;
layerout = layerin;
layerin = div;

if (layerout != " ")
{

moveout();
}
else
{

movein();
}
}
}


function rotatelayers()

{

arr = new Array();
arr=rotatedivs;
l = arr.length;



moveinout(arr[c]);

c=c+1;

if(c == l)
{
c=0;

}

t=setTimeout("rotatelayers()",pause);

}


function StartCCTVportfolio()
{

find_div_class();
//showlayers("logos");
initlayers();

rotatelayers();

}