var pause=false;
var sPos=200;
var xTimer="";
var Aframe=4;

function logTip(i) {
	var X = 300;
	var Y = -5;
	$('tipBox').update('<br /><br /><br /><strong>Please log in to take this course</strong><br /><br /><br /><br />');
	Event.observe (
		$('rc_'+i),
		'mousemove',
		function(event) {
		var e1=Event.element(event);
		if (Event.pointerY(event) < 70 ) {
			Y = -5;
		}
		if (Event.pointerX(event) < 320 ) {
			X = -40;
		}
		$('tipBox').style.textAlign = 'center';
		$('tipBox').style.top = (Event.pointerY(event) - Y)  + 'px';
		$('tipBox').style.left = (Event.pointerX(event) - X) + 'px';
		})
}

function tip(i) {
	var X = 300;
	var Y = 295;
	var stars=0;
	var boxText = ""
	boxText=boxText + "<img src='http://images.tauniv.com/titleImages/" + CourseIDArray[i] + ".jpg' alt='' /><h3>";
	if (StatusArray[i]=="G") {
		boxText=boxText + "<img src='http://images.tauniv.com/grad_icon.jpg' width='24' height='17' alt='' border='0' /> ";
	}
	boxText=boxText + CourseNameArray[i] + "</h3>";
	boxText=boxText + CourseDescriptionArray[i];
	if (profile=="T") {
		boxText=boxText + "<h4>Rating based on your preferences</h4>";
		stars=Math.min(ProfileArray[i]*10,50);
	}
	if (profile=="F") {
		boxText=boxText + "<h4>Rating based on popularity</h4>";
		stars=Math.min((Math.round(ProfileArray[i]/1000)*10),50);
	}
	if (stars==0) {
		stars="00";
	}
	boxText=boxText + "<img src='http://images.tauniv.com/" + stars + "_stars.jpg' width='272' height='35' alt='' />";
	$('tipBox').update(boxText);
	Event.observe (
		$('rc_'+i),
		'mousemove',
		function(event) {
		var e1=Event.element(event);
		if (Event.pointerY(event) < 665 ) {
			Y = -5;
		}
		if (Event.pointerX(event) < 320 ) {
			X = -40;
		}
		$('tipBox').style.top = (Event.pointerY(event) - Y)  + 'px';
		$('tipBox').style.left = (Event.pointerX(event) - X) + 'px';
		Effect.Appear($('tipBox'),{from:0.0,to:1.0,duration:0.3});
		})
}
// popup for top scroll - adjust course index for overlap frames
function tip2(i) {
	pause=true;
	var j=i;
	if (i > 9) {
		j=j-10;
	}
	var X = 300;
	var Y = 295;
	var stars=0;
	var boxText = ""
	boxText=boxText + "<img src='http://images.tauniv.com/titleImages/" + CourseIDArray[j] + ".jpg' alt='' /><h3>";
	if (StatusArray[j]=="G") {
		boxText=boxText + "<img src='http://images.tauniv.com/grad_icon.jpg' width='24' height='17' alt='' border='0' /> ";
	}
	boxText=boxText + CourseNameArray[j] + "</h3>";
	boxText=boxText + CourseDescriptionArray[j];
	if (profile=="T") {
		boxText=boxText + "<h4>Rating based on your preferences</h4>";
		stars=Math.min(ProfileArray[j]*10,50);
	}
	if (profile=="F") {
		boxText=boxText + "<h4>Rating based on popularity</h4>";
		stars=Math.min((Math.round(ProfileArray[j]/1000)*10),50);
	}
	if (stars==0) {
		stars="00";
	}
	boxText=boxText + "<img src='http://images.tauniv.com/" + stars + "_stars.jpg' width='272' height='35' alt='' />";
	$('tipBox').update(boxText);
	Event.observe (
		$('s'+i),
		'mousemove',
		function(event) {
		var e1=Event.element(event);
		if (Event.pointerY(event) < 665 ) {
			Y = -5;
		}
		if (Event.pointerX(event) < 320 ) {
			X = -40;
		}
		$('tipBox').style.top = (Event.pointerY(event) - Y)  + 'px';
		$('tipBox').style.left = (Event.pointerX(event) - X) + 'px';
		Effect.Appear($('tipBox'),{from:0.0,to:1.0,duration:0.3});
		})
}

function closeTip(i) {
	$('tipBox').style.left = '-3000px';
}

function closeTip2(i) {
	$('tipBox').style.left = '-3000px';
	pause=false;
}

function Rewind() {
	sPos=sPos+500;
	if (sPos > 200) {
		sPos= -2620;
	}
}
function FForward() {
	sPos=sPos-500;
	if (sPos < -3120) {
		sPos=200;
	}
}
function RO(d,e) {
	$(d).src = 'images/' + e;
}

function RO2(d,e) {
	$(d).src = '../images/' + e;
}


function SliderLeft() {
	sPos--;
	$('slider').style.left = sPos + 'px';
}

function StartShow() {
	if (!pause) {
		SliderLeft();
		if (sPos<= -3120) {
			sPos=200;
		}
	}
	xTimer = setTimeout("StartShow();",18);
}

function LoadShow() {
	StartShow();
}


