function over () {
	if ( this != active ) {
		this . src = this . src . replace ( '_off' , '_on' ) ;
		this . style . background = '#D00600' ;
		if ( menuDivs [ this . index + 1 ] ) menuDivs [ this . index + 1 ] . style . backgroundImage = 'none' ;
		if ( this . index > 0 ) menuDivs [ this . index ] . style . backgroundImage = 'none' ;
	}
}

function out () {
	if ( this != active ) {
		this . src = this . src . replace ( '_on' , '_off' ) ;
		this . style . background = 'none' ;
		if ( menuDivs [ this . index + 1 ] ) menuDivs [ this . index + 1 ] . style . background = menuDiv ;
		if ( this . index > 0 ) menuDivs [ this . index ] . style . background = menuDiv ;
	}
}

function preloadImages ( ) { //v3.0
	var d = document ;
	if( d . images ) {
		if ( !d.MM_p ) d.MM_p = new Array ( ) ;
		var i , j = d . MM_p . length , a = preloadImages . arguments ;
		for( i = 0 ; i < a . length ; i ++ ) {
			if ( a [ i ] . indexOf ( "#" ) != 0 ) {
				d . MM_p [ j ] = new Image ; d . MM_p [ j++ ] . src = a [ i ] ;
			}
		}
  	}
}

function initRollovers ( menuId )  {
	var menu = document . getElementById ( menuId ) ;
	menuItems = menu . getElementsByTagName ( 'img' ) ;
	menuDivs = menu . getElementsByTagName ( 'div' ) ;
	for ( i = 0 ; i < menuItems . length ; i ++ ) {
		menuItems [ i ] . onmouseover = over ;
		menuItems [ i ] . onmouseout  = out ;
		menuItems [ i ] . index = i ;
		if ( menuItems [ i ] . src . indexOf ( '_on.' ) >= 0 ) {
			active = menuItems [ i ]
			active . style . background = '#D00600' ;
			preloadImages ( active . src . replace ( '_on' , '_off' ) ) ;
		} else {
			preloadImages ( menuItems [ i ] . src . replace ( '_off' , '_on' ) )
		}
	}
}

var active ;
var menuItems = Array () ;
var menuDivs = Array () ;
var menuDiv = 'url(images/menu/star.gif) no-repeat 8px 33px' ;
