function rotatorObject()
{
	
/*
Accepts no parameters	
Declare as e.g. Var rot = new rotatorObject();
	
*/
this.imgName = null;
this.pause = false;
this.testStr='';
this.objCollection = new Array();
this.pointer = 0;
this.timer = 2000; //2 sec default

this.ok = true;


this.buildImage = build;
this.rotate= _rotate;


}

function build(imageSrc, altText)
{
/* STRING PARAMETERS */
	
		
	this.objCollection[this.objCollection.length] = new _imageObj(imageSrc, altText)
	this.testStr += this.objCollection.length+' link: '+this.objCollection[this.objCollection.length-1].linkTo+'\n';
	
	if(typeof(imageSrc) == "string" &&  typeof(altText)== "string")
	{
		if( imageSrc == "" || altText == "")
		{
			this.ok = false;
			alert("DEBUG:\nEmpty string given to rotator build declaration "+this.objCollection.length+".\n");
		}
	}
	else
	{	
		this.ok = false;
		alert("String parameters must be passed to the rotator object. Check build: "+this.objCollection.length+".\n")
		
	}
}
function _imageObj(imageSrc, altText)
{
this.imageSrc = imageSrc;
this.altText = altText;

}

function _rotate()
{
	with(this)
	{
		if(ok)
		{
			//var randSelect = (Math.round(Math.random()*objCollection.length )+1);
			pointer++;
			if(pointer >= objCollection.length || pointer < 0)
				pointer = 0;
			
			eval("document.images."+imgName+".src = objCollection[pointer].imageSrc");
			eval("document.images."+imgName+".alt = objCollection[pointer].altText");
			
		}
	}
}

function top_nav_highlight(special,highlight,_id)
{
	/*
	- Called from links in top nav bar
	- Highlights blue nav bar with orange over each link by re-assigning class names
	- special is only true from the home link because the background image is curved
	*/

	if(!special)
	{
		if(highlight)
			document.getElementById(_id).className = "span_on";
		else
			document.getElementById(_id).className = "span_off";
	}
	else
	{
		if(highlight)
			document.getElementById(_id).className = "home_on";
		else
			document.getElementById(_id).className = "home_off";
	}
	 document.returnValue = true;

}
