/* popup window links for videos - apply the 'videolink' class
   to a link and it will load the href of that link in a popup */

		document.getElementsByClassName = function(sClassName){
		    var aReturn = [];
		    var re = new RegExp('(^| )'+sClassName+'( |$)');
		    var aAll = this.getElementsByTagName("*");
		    for(var i=0,j=aAll.length; i<j; i++)
		        if(re.test(aAll[i].className))aReturn.push(aAll[i]);
		    return aReturn;
		}
		
		function popUp(theURL,winName,features) {
			window.open(theURL,winName,features);
		}
		
		function findPopUpLinks() {
			winName = "drcvideo";
			features = "width=320,height=320,top=150,left=150,scrollbars=0,resizable=1"
			linksArray = document.getElementsByClassName("videolink");
			for(i=0; i<linksArray.length; i++) {
				if(linksArray[i].href) {
					popUp(this.href,winName,features);
					return false;
				} else {
					linksArrayChildren = linksArray[i].getElementsByTagName("a");
					for(j=0; j<linksArrayChildren.length; j++) {
						linksArrayChildren[j].onclick=function() {
							popUp(this.href,winName,features);
							return false;
						}
					}
				}
			}
		}
		if (window.attachEvent) {	
			window.attachEvent("onload", findPopUpLinks);
		} else if (window.addEventListener){
			window.addEventListener("load", findPopUpLinks, false); 
		} else if (document.addEventListener){ 
			document.addEventListener('load', findPopUpLinks, false);
		}