////////////////////////////////////////////////////
//marquee procedures


/////////////
//purpose: gets the actual width of an element (not based on style0
//parameter: id of element
//returns: element width
function getWidth(id) {
	var myObject = document.getElementById(id);
	return myObject.clientWidth;
}

/////////////
//purpose: moves an element to specific location
//parameters: 
//		ele - element object
//		start - start position
//returns: nothing
function moveElement(ele, start) {
	ele.style.left = start + "px";
}

/////////////
//purpose: moves an element left 2 px
//parameters: 
//		ele - element object
//		cur - current position
//		end - end position
//		start - start position
//returns: nothing
function moveLeft(ele, cur, end, start) {
	pos = cur - 2;
	if (pos < end) {
		pos = start;
	}
	ele.style.left = pos + "px";
}

/////////////
//purpose: scrolls an element horizontally through it's container from right to left one pixel at a time
//parameters: 
//		eleId - id of element
//		conId - id of container
//returns: nothing
function scrollElementLeft(eleId, conId) {
	//variables declared within a function without var keyword are global
	ele = document.getElementById(eleId);						//get element of interest as an object
	var con = document.getElementById(conId);					//get element's container as an object
	start = con.clientWidth - 20;									//start position is 5 px inside container (plus 15px for padding)
	end = - ele.clientWidth;										//end position is element moved out of container entirely
	pos = start;														//initialize current position
	//moveElement(ele, start);										//for testing start position
	setInterval("moveLeft(ele, pos, end, start);", 10);	//this function runs globally regardless of where it's called from
}
