function WindowOpenWindowCentered(url, name, width, height, resizable, scrollbars){ var w = 800, h = 600; if (document.all) { /* the following is only available after onLoad */ w = document.body.clientWidth; h = document.body.clientHeight; } else if (document.layers) { w = window.innerWidth; h = window.innerHeight; } var popW = width, popH = height; var leftPos = (w-popW)/2, topPos = (h-popH)/2; var win = window.open( url, name, 'width=' + popW + ',height=' + popH + ',top=' + topPos+',left=' + leftPos + ',resizable=' + resizable + ',scrollbars=' + scrollbars ); win.focus(); } function WindowOpenScreenCentered(url, name, width, height, resizable, scrollbars){ var w = 800, h = 600; if (document.all || document.layers) { w = screen.availWidth; h = screen.availHeight; } var popW = width, popH = height; var leftPos = (w-popW)/2, topPos = (h-popH)/2; var win = window.open( url, name, 'width=' + popW + ',height=' + popH + ',top=' + topPos+',left=' + leftPos + ',resizable=' + resizable + ',scrollbars=' + scrollbars ); win.focus(); } 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