function initTabs() { var cards = new Array(10); var i = 0; divs = document.getElementsByTagName("div"); for (j = 0; j < divs.length; j++) { div = divs[j]; if (div.className.indexOf('indexcard') >= 0) { cards[i] = div; i++; } } for (j = 1; j < i; j++) { cards[j].className += " hide"; } initTabsOldOnload(); } function showcard(hide,show) { document.getElementById(hide).className += " hide"; s = document.getElementById(show); i = document.getElementById(show).className.indexOf("hide"); if (i != -1) { s.className = s.className.substr(0,i) + s.className.substr(i+4); } // IE doesn't redraw the lower corners of the card-containing box automatically, so force it to // first find s's ancestor with class box while (s.className.indexOf('box') < 0) { s = s.parentNode; } // then find box's child with class box_corners_lower and hide and show it for (j = 0; j < s.childNodes.length; j++) { if (s.childNodes[j].className && s.childNodes[j].className.indexOf('box_corners_lower') >= 0) { s.childNodes[j].className += " hide"; i = s.childNodes[j].className.indexOf("hide"); if (i != -1) { s.childNodes[j].className = s.childNodes[j].className.substr(0,i) + s.childNodes[j].className.substr(i+4); } } } // done return false; } initTabsOldOnload = window.onload; window.onload=function(){initTabs();};