// JavaScript Document
/****** Slider Object Definition ******/
function Slider( sliderDivId, selfName )
{
	this.selfname = selfName;
	var sliderDiv = document.getElementById( sliderDivId );
	this.width = eval( sliderDiv.style.width.substring( 0, sliderDiv.style.width.length - 2 ) );

	this.childImages = sliderDiv.getElementsByTagName( 'img' );
	
	this.left = 0;
	this.direction = 0;

	this.slideIntervalID = null;
	this.slide = slide;
	this.bang = trigger;
	
}

function slide()
{
	this.left = this.left + this.direction;
	if ( this.left < 1 || this.left > this.width - 1 ) clearInterval( this.slideIntervalID );
	this.childImages[0].style.left = this.left + "px";
	this.childImages[1].style.left = this.left + "px";
}

function trigger()
{
	// if the images are styled to be offset by the same as width
	// then our direction control will be negative: moving right to left
	// else positive direction
	this.left = eval( this.childImages[ 0 ].style.left.substring( 0, this.childImages[ 0 ].style.left.length - 2 ) );
	this.direction = ( this.left == this.width ) ? -1 : 1;
	this.slideIntervalID = setInterval( this.selfname + '.slide()', 10 );
}
/****** END: Slider Object Code ******/

/****** Function for help text MO  ******/
function textplanation( text )
{
 	var textplanationObj = document.getElementById( "textplanation" );
	var textplanationP = textplanationObj.getElementsByTagName( "p" )[0];
	textplanationP.innerHTML = text + "&nbsp;";
	return true;
}

/****** Functions for Menubar Mouseovers  ******/
function toggleMenu( styledObject, state )
{
	styledObject.style.color = ( state ) ? "#95a0a9" : "#29292b"; 
	var ulObject = styledObject.getElementsByTagName( 'ul' )[ 0 ];
	if ( ulObject !== undefined )
	{
		ulObject.style.display = ( state ) ? "block" : "none";
	}
	return true;
}
function toggleHover( styledObject, state )
{
	styledObject.className = ( state ) ? "hover" : "";
	return true;
}


