
var hrStartingPoint = 285;
var hrOffset = 0


var pushDistance = 130; 
var firstTime = 0;
var timexCoord = 25;
var timeyCoord = 210;
var fontSize = "150%";
var fontType = "sans-serif";


// new time incrementor
var nti = 0;
// hr incrementer
var hrCount = 0;

var hrArray = new Array();

function startScroll(minutes){

		alert("minutes is: " + minutes);
		var theTime;
		var theMinutes;
		var theSeconds;
		
		// Formatting time to look right
		
		if(minutes == -1)
			theMinutes = ( getCurrentMinutes() < 10 ? "0" : "" ) + getCurrentMinutes();
		else
			theMinutes = minutes;
			
		theSeconds = "00";

		//puts it all together
		theTime= getCurrentHours() + ":" + theMinutes + ":" + theSeconds;
	
		

		//alert(" rest of the times");
		var placeToAdd = document.getElementById("timeScrollBar"); ;
		var newTime = document.createElement("div");
		var newTimeIdName = nti;
		
		//timeyCoord = timeyCoord + pushDistance;
		

		
		newTime.setAttribute('id', 'time' + nti);
		newTime.style.position = "absolute";
		newTime.style.fontSize = fontSize;
		//newTime.style.fontFamily = fontType;
		newTime.style.left = timexCoord + "px";
		newTime.style.top  = timeyCoord + "px";
		newTime.innerHTML = theTime;
		
		//document.getElementById('newDivName').style.left = 300;
		
		/*before we add element to the top of the page we need to push down everything else .. time position and tag positions.. everrrything.. */
		pushDownTagsDos(); 
		pushDownHr();
		
		//alert("nti is " + nti);
		//if(nti > 0){ /* want to only move stuff down after the first time element */
			for(var i = 0; i < nti; i++){
				var tempIDName = 'time' + i;
				var holdTop = document.getElementById(tempIDName).style.top;
				holdTop = parseInt(holdTop) + pushDistance;
				document.getElementById(tempIDName).style.top = holdTop;
			}
	
		
		placeToAdd.appendChild(newTime);
		addHr(placeToAdd);
		
		//increment the incrementor so each id is unique
		nti = nti + 1;
		

	//}

}	

function addHr(placeToAdd){

	newHR= document.createElement("img");
	newHR.setAttribute("src", "/~jlintern/dottedBlackBox.bmp");
	newHR.style.position = "absolute";
	newHR.style.width = '60%'; 
	newHR.style.height = '2px'; 
	newHR.style.left = "100px";
	newHR.style.top  = hrStartingPoint + "px";
	newHR.setAttribute('id', 'hr' + hrCount);	
	placeToAdd.appendChild(newHR);
	
	hrArray[hrCount] = newHR;

	hrCount = hrCount + 1; 
}

function pushDownHr(){
    
		for( var i = 0; i < hrArray.length; i++){
			var tempIDName = 'hr' + i;
			var holdTop = document.getElementById(tempIDName).style.top;
			holdTop = parseInt(holdTop) + pushDistance + hrOffset;
			document.getElementById(tempIDName).style.top = holdTop;
		}
	
}

/*
function timeTester(){

	var placeToAdd1 = document.getElementById("clockTesterPlace");
	var placeToAdd2 = document.getElementById("ttt1");
	var placeToAdd3 = document.getElementById("ttt2");
	var tt1 = document.createElement("div");
	var tt2 = document.createElement("div");
	var tt3 = document.createElement("div");

	tt1.innerHTML = getTime();
	tt3.innerHTML = getInitialTime();
	tt2.innerHTML = getCurrentOffset();

	tt1.style.position = "absolute";	
	tt2.style.position = "absolute";	
	tt3.style.position = "absolute";	

	
	
	tt1.style.left = 600 + "px";
	tt1.style.top  = 20 + "px";

	tt2.style.left = 600 + "px";
	tt2.style.top  = 50 + "px";

	tt3.style.left = 0 + "px";
	tt3.style.top  = 60+ "px";

	placeToAdd3.appendChild(tt1)
	placeToAdd2.appendChild(tt2);
	placeToAdd1.appendChild(tt3);


}
*/


//document.getElementById("clock").style.top = 345;
//document.getElementById("clock").style.left = 345;
