window.onload = function() {
	setLinks ('wrapper');
} 

function setLinks (ID) {
	if (document.getElementById(ID).getElementsByTagName('a')) {
		var linkItems = document.getElementById(ID).getElementsByTagName('a');
		for (var i=0; i<linkItems.length; i++) {
			if (linkItems[i].className == 'mailpopup') {
				linkItems[i].onclick = function(){
				popUp(this.href,'fixed',485,490);return false;				
				}
			}
			else if (linkItems[i].className == 'closewindow') {
				linkItems[i].onclick = function(){
				closeWindow();	
				}
			}
		}
	}
}
function popUp(strURL,strType,strHeight,strWidth) {
	var strOptions=""; 
	if (strType=="console") strOptions="resizable,height="+strHeight+",width="+strWidth;
	if (strType=="fixed") strOptions="status,height="+strHeight+",width="+strWidth;
	if (strType=="elastic") strOptions="toolbar,menubar,scrollbars,status,resizable,location,height="+strHeight+",width="+strWidth;
	window.open(strURL, 'newWin', strOptions);
}
function closeWindow () {
	window.close();
}
