var mouseOvers = new Array();
var mouseOuts = new Array();

function mainNavRollovers()
{
	if (!(document.createElement && document.getElementsByTagName)) return;
	var nav = document.getElementById('MainNav');
	var imgs = nav.getElementsByTagName('img');
	for (var i=0;i<imgs.length;i++)
	{
		imgs[i].onmouseover = mouseGoesOver;
		imgs[i].onmouseout = mouseGoesOut;
		var suffix = imgs[i].src.substring(imgs[i].src.lastIndexOf('.'));
		mouseOuts[i] = new Image();
		mouseOuts[i].src = imgs[i].src;
		mouseOvers[i] = new Image();
	  	if (imgs[i].src.indexOf("_over") > 0) { mouseOvers[i].src = imgs[i].src; }
		else { mouseOvers[i].src = imgs[i].src.substring(0,imgs[i].src.lastIndexOf('.')) + "_over" + suffix; }
		imgs[i].number = i;
	}
}

function mouseGoesOver() { this.src = mouseOvers[this.number].src; }
function mouseGoesOut() { this.src = mouseOuts[this.number].src; }

function addEvent(obj, evType, fn, useCapture) {
  if (obj.addEventListener){
    obj.addEventListener(evType, fn, useCapture);
    return true;
  } else if (obj.attachEvent){
    var r = obj.attachEvent("on"+evType, fn);
    return r;
  }
}

addEvent(window, 'load', mainNavRollovers);

function popUp(url,w,h,t,l)
{
  window.open(url, "_blank", "width="+w+", height="+h+", titlebar=no, menubar=no, tollbar=no, location=no, scrollbars=yes, status=no, top="+t+", left="+l+"");
}

function smail(maila) {
	    	mailw = window.open("/comm/send_mail.aspx?to="+maila,"mailw","width=450, height=430, titlebar=no, menubar=no, tollbar=no, location=no, scrollbars=no,status=no, left=300, top=300");
}
