function ini() {
	if ( document.getElementsByTagName ) {
		ro();
		nw();
		fb();
	}
}

function ro() {
	var images = document.getElementsByTagName("img");
	var inputs = document.getElementsByTagName("input");
	for ( var i=0; i < images.length; i++ ) {
		if ( images[i].getAttribute("src").match("_off.") ) {
			images[i].onmouseover = function() {
				this.setAttribute("src", this.getAttribute("src").replace("_off.", "_on."));
			}
			images[i].onmouseout = function() {
				this.setAttribute("src", this.getAttribute("src").replace("_on.", "_off."));
			}
		}
	}
}

function nw() {
	var anchors = document.getElementsByTagName("a");
	for ( var i=0; i < anchors.length; i++ ) {;
		if ( anchors[i].getAttribute("href") ) {
			if ( anchors[i].getAttribute("rel") == "news" ) {
				anchors[i].onclick = function() {
					openPop(this,615,550);
					return false;
				}
			}
			if ( anchors[i].getAttribute("rel") == "ref" ) {
				anchors[i].onclick = function() {
					var w = screen.width >= 850 ? 850 : screen.width;
					openPop(this,w,550);
					return false;
				}
			}
		}
	}
}

function openPop(anchor,w,h) {
	var prop = 'width='+w+',height='+h+',menubar=no,toolbar=no,location=no,status=yes,resizable=no,scrollbars=yes';
	var popup = window.open(anchor,'popup',prop);
	popup.focus();
}

function fb() {
	var anchors = document.getElementsByTagName("a");
	for ( var i=0; i < anchors.length; i++ ) {
		anchors[i].onfocus = function() {
			this.blur();
		}
	}
}

if ( window.addEventListener ) {
	window.addEventListener("load", ini, false);
}
else if ( window.attachEvent ) {
	window.attachEvent( "onload", ini );
}
