var mo_selectedId = "_over.";
var mo_overId = "_over.";
var mo_outId = "_out.";
var mo_selected = - 1;
var mo_firstLink = 0;

function mo_init( _firstLink, _nofLinks, _selectedEnabled ) {
	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;

			if ( _selectedEnabled ) {
				document. images[ imgCount ]. selected = new Image;
				document. images[ imgCount ]. selected. src = urlFront + mo_selectedId + urlBack;
				document. links[ linkCount ]. onclick = mo_doOnclick;
				}//if

			document. links[ linkCount ]. imgId = imgCount;

			linkCount++;
			}//if
		}//for
	}//mo_init()

function mo_doOnmouseover() {
	document. images[ this. imgId ]. src = document. images[ this. imgId ]. over. src;
	}//mo_doOnmouseover()


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;
	}//mo_doOnmouseout()


function mo_doOnclick() {
	mo_doSelect( this. imgId);
	}//mo_doOnclick()


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;
	}//mo_doSelect()


function mo_select( _linkId ) {
	if ( _linkId < 0)
		mo_doSelect( -1 );
	else
		mo_doSelect( document. links[ mo_firstLink + _linkId ]. imgId )
	}//mo_select()


// Selected vanuit pagina's
function page_doSelect(module) {alert('ja')
	mo_doSelect( module );
	}//page_doSelect()
	

var newwin;

function launchwin(winurl,winname,winfeatures)
{
	newwin = window.open(winurl,winname,winfeatures);
}
