why doesnt this work?
//I removed the 'for loops' for a second and then the script does something, what wrong with the loops?//
var openWindows= new Array[50]();
function resize(x){
//changed boolean to var var open = false;
for(var i = 0; i < openWindows.length; i++){
if(openWindows[i] == x){
open = true;
openWindows[i] = "";
}
}
if(open == false){
for(var i = 0; i < openWindows.length; i++){
if(openWindows[i] == ""){
openWindows[i] = x;
break;
}
}
var t = setTimeout("document.getElementById('" + x + "').style.height='200px'",20);
var t = setTimeout("document.getElementById('" + x + "').style.height='220px'",40);
var t = setTimeout("document.getElementById('" + x + "').style.height='240px'",60);
var t = setTimeout("document.getElementById('" + x + "').style.height='260px'",80);
var t = setTimeout("document.getElementById('" + x + "').style.height='280px'",100);
var t = setTimeout("document.getElementById('" + x + "').style.height='300px'",120);
var t = setTimeout("document.getElementById('" + x + "').style.height='320px'",140);
var t = setTimeout("document.getElementById('" + x + "').style.height='340px'",160);
var t = setTimeout("document.getElementById('" + x + "').style.height='360px'",180);
var t = setTimeout("document.getElementById('" + x + "').style.height='380px'",200);
var t = setTimeout("document.getElementById('" + x + "').style.height='400px'",220);
var t = setTimeout("document.getElementById('" + x + "').style.height='420px'",240);
var t = setTimeout("document.getElementById('" + x + "').style.height='440px'",260);
var t = setTimeout("document.getElementById('" + x + "').style.height='460px'",280);
var t = setTimeout("document.getElementById('" + x + "').style.height='480px'",300);
var t = setTimeout("document.getElementById('" + x + "').style.height='500px'",320);
var t = setTimeout("document.getElementById('" + x + "').style.height='520px'",340);
var t = setTimeout("document.getElementById('" + x + "').style.height='540px'",360);
var t = setTimeout("document.getElementById('" + x + "').style.height='560px'",380);
var t = setTimeout("document.getElementById('" + x + "').style.height='580px'",400);
}else{
var t = setTimeout("document.getElementById('" + x + "').style.height='560px'",40);
var t = setTimeout("document.getElementById('" + x + "').style.height='540px'",60);
var t = setTimeout("document.getElementById('" + x + "').style.height='520px'",80);
var t = setTimeout("document.getElementById('" + x + "').style.height='500px'",100);
var t = setTimeout("document.getElementById('" + x + "').style.height='480px'",120);
var t = setTimeout("document.getElementById('" + x + "').style.height='460px'",140);
var t = setTimeout("document.getElementById('" + x + "').style.height='440px'",160);
var t = setTimeout("document.getElementById('" + x + "').style.height='420px'",180);
var t = setTimeout("document.getElementById('" + x + "').style.height='400px'",200);
var t = setTimeout("document.getElementById('" + x + "').style.height='380px'",220);
var t = setTimeout("document.getElementById('" + x + "').style.height='360px'",240);
var t = setTimeout("document.getElementById('" + x + "').style.height='340px'",160);
var t = setTimeout("document.getElementById('" + x + "').style.height='320px'",260);
var t = setTimeout("document.getElementById('" + x + "').style.height='300px'",280);
var t = setTimeout("document.getElementById('" + x + "').style.height='280px'",300);
var t = setTimeout("document.getElementById('" + x + "').style.height='260px'",320);
var t = setTimeout("document.getElementById('" + x + "').style.height='240px'",340);
var t = setTimeout("document.getElementById('" + x + "').style.height='220px'",360);
var t = setTimeout("document.getElementById('" + x + "').style.height='200px'",380);
var t = setTimeout("document.getElementById('" + x + "').style.height='180px'",400);
}
}