/* This script and many more are available free online at The JavaScript Source!! http://javascript.internet.com Created by: Patrick Hunlock | http://www.hunlock.com/Licensed under: Public Domain */ function getElementsByClass (searchClass) { // This function returns an array of all HTML objects with the // specified className. Tag is optional var returnArray = []; var els = document.getElementsByTagName('*'); var pattern = new RegExp('(^|\\s)'+searchClass+'(\\s|$)'); for (var i = 0; i < els.length; i++) { if ( pattern.test(els[i].className) ) { returnArray.push(els[i]); } } return returnArray; } function popVideo(vid, darken) { // This function accepts a division ID (vid), either a string or the actual // object itself. vid is mandatory. darken is optional, if it's true // the page will be greyed out under the video. var videos = getElementsByClass('video'); // Get all the videos on the page. var isplaying=null; for(i=0; i