// JavaScript Document
function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	}
	else {
		window.onload = function() {
			oldonload();
			func();
		}
	}
}

	function getElementsByClass(searchClass,node,tag) {
		var classElements = new Array();
		if ( node == null )
			node = document;
		if ( tag == null )
			tag = '*';
		var els = node.getElementsByTagName(tag);
		var elsLen = els.length;
		var pattern = new RegExp('(^|\\s)'+searchClass+'(\\s|$)');
		for (i = 0, j = 0; i < elsLen; i++) {
			if ( pattern.test(els[i].className) ) {
				classElements[j] = els[i];
				j++;
			}
		}
		return classElements;
	}



function popmeup(){
	var ditem = document.getElementById('downloadwall');
	var _width = 800+20;
	var _height = 600+20;
	

	
	


var popUpWin = 0;
function popUpWindow(URLStr, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}


	function popup (){
	var url = this.href;
	var wint = (screen.height - _height) / 3;
	var	winl = (screen.width - _width) / 2;
		popUpWindow(url, winl, wint, _width,_height);
	
	
		 

		return false;
		}


		
			var links = ditem.getElementsByTagName('a');
			for (var y=0; y<links.length; y++){
				links[y].onclick = popup;
				}
			
			
}
	
	addLoadEvent(popmeup);
