function icon_over($id) {
	document.getElementById('icon_'+$id).src = '/school/images/infocenter_button_on.gif';
}

function icon_out($id) {
	document.getElementById('icon_'+$id).src = '/school/images/infocenter_button_off.gif';
}

// Info Center Toggle Function
function ic_icon($OnState) {
	// Reset All Icons and Content Items
	for(var $i = 1; $i < 4; $i++) {
		document.getElementById('icon_'+$i).src = '/school/images/infocenter_button_off.gif';
		document.getElementById('toggle_'+$i).style.display = 'none';
	}

	// Set the Current State
	document.getElementById('icon_'+$OnState).src = '/school/images/infocenter_button_on.gif';
	document.getElementById('toggle_'+$OnState).style.display = '';
}

// video stuff

// swfobject functions to hide video when stopped or finished
function stateTracker(obj) {
	if(obj.newstate == 'COMPLETED' || obj.newstate == 'IDLE') {
		$('#video-image').show();
		$('#video').hide();
	}
};

var player;

//Watch for state of video
function playerReady(obj) {
	var id = obj['id'];
	var version = obj['version'];
	var client = obj['client'];
	player = document.getElementById(id);
	player.addModelListener("STATE","stateTracker");
};

function playVideo(id, width, height, desc, path) {
	var so = new SWFObject('http://www.harvest.org/flash/jwplayer.swf','video'+id, width, height,'9');
		so.addParam('allowscriptaccess','always');
		so.addParam('allowfullscreen','true');
		so.addParam('bgcolor','#000000');
		so.addParam('flashvars','&author=Harvest Ministries&description='+desc+'&file='+path+'&backcolor=000000&frontcolor=FFFFFF&lightcolor=888888&screencolor=000000&controlbar=over&autostart=true');
		so.write('player');
};

//Get the video
function getVideo(id, width, height, desc, path) {
	$('#video-image').hide();
	$('#video').show();
	playVideo(id, width, height, desc, path);
}