/*
+--------------------------------------------------------------------
| Version	Date		Comment
| 1.01		2005/03/31	initial version
|
| Copyright (c) 2005 Rosman (http://www.rosman.co.at)
+--------------------------------------------------------------------
| Purpose
| asign mouseover events to navigation
+--------------------------------------------------------------------
| Usage
| -
+--------------------------------------------------------------------
| Appl. Dependencies:  -
+--------------------------------------------------------------------
| Author(s): Johan Rosman <johan@rosman.co.at>
+--------------------------------------------------------------------

+--------------------------------------------------------------------
| Version History:
+--------------------------------------------------------------------
| Version	Date		Comment
+--------------------------------------------------------------------
| 1.01		2005/03/31	initial version
+--------------------------------------------------------------------
*/

if ( !window._navigation_js ) {

	// variable to enable dependency / multiple calls check
	var _navigation_js = true;

	function nav_mouseover() {
		_type = this.src.substr ( this.src.length - 9, 5 );
		if ( ( _type != '_curr' ) && ( _type != '_over' ) ) {
			this.src = this.src.substr(0, this.src.length-4) + '_over.gif'
		}
	}

	function nav_mouseout() {
		_type = this.src.substr ( this.src.length - 9, 5 );
		if ( _type == '_over' ) {
			this.src = this.src.substr(0, this.src.length-9) + '.gif'
		}
	}

	function nav_init() {
		if ( _nav_onload ) {
			_nav_onload();
		}
		if (!document.getElementsByTagName) return;
		var _imgs = document.getElementsByTagName('img');
		for ( _i=0; _i<_imgs.length; _i++) {
			if ( _imgs[_i].className == 'navimg' ) {
				_imgs[_i].onmouseover = nav_mouseover;
				_imgs[_i].onmouseout = nav_mouseout;
			}
		}
	}

	/* cascade onload */
	if ( window.onload ) {
		var _nav_onload = window.onload;
	}
	window.onload = nav_init;
	
}
