/* --- insertAfter and addClass -------- by JEREMY KEITH http://www.adactio.com -----------------------------------*/ function insertAfter(newElement, targetElement){ var parent = targetElement.parentNode; if(parent.lastChild == targetElement){parent.appendChild(newElement);}else{ parent.insertBefore(newElement, targetElement.nextSibling); } } function addClass(element,value) { if (!element.className) { element.className = value; } else { newClassName = element.className; newClassName+= " "; newClassName+= value; element.className = newClassName; } } /* end scripts by JK */ /* ----- addLoadEvent ----- by SIMON WILLISON http://simon.incutio.com -----------------------------------*/ function addLoadEvent(func){ var oldonload = window.onload; if(typeof window.onload != 'function'){ window.onload = func; }else{ window.onload = function(){ oldonload(); func(); } } } /* end scripts by SW */ /* ----- getElementsByClassName ----- by SCOTT SCHILLER http://www.schillmania.com -----------------------------------*/ function getElementsByClassName(className,oParent) { var doc = (oParent||document); var matches = []; var nodes = doc.all||doc.getElementsByTagName('*'); for (var i=0; i