var mo_selectedId="_a";
var mo_overId="_a";
var mo_outId="_i";
var mo_selected=-1;
var mo_firstLink=0;

function mo_init(_firstLink, _nofLinks) {
  mo_firstLink=_firstLink;
  var linkCount=mo_firstLink;
  for(var imgCount=0; linkCount < (_nofLinks + mo_firstLink) ; imgCount++) {
    var outUrl=document.images[imgCount].src;
    var outIdIndex=outUrl.lastIndexOf(mo_outId);
    if(outIdIndex >=  0) {
      var urlFront=outUrl.substring(0, outIdIndex);
      var urlBack=outUrl.substring(outIdIndex + mo_outId.length, outUrl.length);
      document.images[imgCount].out=new Image;
      document.images[imgCount].out.src=outUrl;
      document.links[linkCount].onmouseout=mo_doOnmouseout;
      document.images[imgCount].over=new Image;
      document.images[imgCount].over.src=urlFront + mo_overId + urlBack;
      document.links[linkCount].onmouseover=mo_doOnmouseover;
      document.links[linkCount].imgId=imgCount;
      linkCount++;
    }
  }
}

function mo_doOnmouseover() {
  document.images[this.imgId].src=document.images[this.imgId].over.src;
}

function mo_doOnmouseout() {
  if(this.imgId != mo_selected)
    document.images[this.imgId].src=document.images[this.imgId].out.src;
  else
    document.images[this.imgId].src=document.images[this.imgId].selected.src;
}

function mo_doOnclick() {
  mo_doSelect(this.imgId);
}

function mo_doSelect(_imgId) {
  if (mo_selected >= 0)
    document.images[mo_selected].src=document.images[mo_selected].out.src;
  mo_selected=_imgId;
  if (mo_selected >= 0)
    document.images[mo_selected].src=document.images[mo_selected].selected.src;
}

function mo_select(_linkId) {
  if (_linkId < 0)
    mo_doSelect(-1);
  else
		mo_doSelect(document.links[mo_firstLink + _linkId].imgId)
}

function resizeOuter(w,h) {
	if (parseInt(navigator.appVersion)>3) {
		if (navigator.appName=="Netscape") {
			top.outerWidth=w;
			top.outerHeight=h;
		} else
			top.resizeTo(w,h);
	}
}

