function addEvent(obj, evType, fn){
 if (obj.addEventListener){
   obj.addEventListener(evType, fn, false);
   return true;
 } else if (obj.attachEvent){
   var r = obj.attachEvent("on"+evType, fn);
   return r;
 } else {
   return false;
 }
}

// SET THE STATUS BAR TEXT TO THE TITLE ATTRIB OF ANY LINK
function domLinkEnhance() {
	if (!document.body.getElementsByTagName) return false;
	var links = document.body.getElementsByTagName("a");
	var images = document.body.getElementsByTagName("img");
	for (var i=0; i<links.length; i++) {
		if (links[i].getAttribute("title") != "") {
			links[i].onmouseover = function() {	window.status=this.title;	return true; }
			links[i].onmouseout = function() { window.status=''; return false; }
		}
		if (links[i].getAttribute("class") == "popup") {
			links[i].onclick = function() {
				popUp(this.getAttribute("href"));
				return false;
			}
		}
	}
	for (var i=0; i<images.length; i++) {
		if (links[i].getAttribute("alt") != "") {
			images[i].onmouseover = function() {	window.status=this.alt;	return true; }
			images[i].onmouseout = function() { window.status=''; return false; }
		}
	}	
}
addEvent(window, 'load', domLinkEnhance, false);

// POPUP WINDOW FUNCTION - JUST ADD THE CLASS POPUP TO ANY LINK
function popUp(pagename)
{
	var popupWin = window.open (pagename, 'popup', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=600,height=400');
	popupWin.focus();
}

function checkEnter(e) {
	
	// literal character code will be stored in this variable
	var characterCode 
	
	if(e && e.which) { //if which property of event object is supported (NN4)
		e = e
		characterCode = e.which //character code is contained in NN4's which property
	}	else {
		e = event
		characterCode = e.keyCode //character code is contained in IE's keyCode property
	}

	if(characterCode == 13) { //if generated character code is equal to ascii 13 (if enter key)
		document.forms[0].submit() //submit the form
		return false
	}	else {
		return true
	}
}
