/* a set of generic functions for use in Rivista */ /* creates a queue to load scripts on the onload event */ function addLoadEvent(func) { var oldonload = window.onload; if (typeof window.onload != 'function') { window.onload = func; } else { window.onload = function() { oldonload(); func(); } } } /* the get elements by class name function */ /* getElementsByClassName from: http://www.robertnyman.com/2005/11/07/the-ultimate-getelementsbyclassname */ function getElementsByClassName(oElm, strTagName, oClassNames){ var arrElements = (strTagName == "*" && oElm.all)? oElm.all : oElm.getElementsByTagName(strTagName); var arrReturnElements = new Array(); var arrRegExpClassNames = new Array(); if(typeof oClassNames == "object"){ for(var i=0; i