/**
 * @author John Schneider
 * @copyright 2009 Reservoir Creative Group, LLC
 */

/**
 * Fills the now playing list.
 */
function FillNowPlayingList() {
	var text = ResAjax.GetText('nowplayinglist.php', false, false);
	document.getElementById('nowplayinglist').innerHTML = text;
}

/**
 * Gets the next item in the queue.
 */
function GetNextInQueue() {
	try {
		var listrow = document.getElementById('nowplayinglistrow').childNodes.item(document.getElementById('nowplayinglistrow').childNodes.length - 1);
		//var listrow = document.getElementById('nowplayinglistrow').childNodes[document.getElementById('nowplayinglistrow').childNodes.length - 1];
		var queueid = listrow.id.substr(9);
		var text = ResAjax.GetText('nowplayinglist.php?q=midid&id=' + queueid);
		document.getElementById('nowplayinglist').innerHTML = text;
	}
	catch (e) {
		
	}
}

/**
 * Gets the previous item in the queue.
 */
function GetPreviousInQueue() {
	try {
		var listrow = document.getElementById('nowplayinglistrow').childNodes.item(0);
		var queueid = listrow.id.substr(9);
		var text = ResAjax.GetText('nowplayinglist.php?q=midid&id=' + queueid);
		document.getElementById('nowplayinglist').innerHTML = text;
	}
	catch (e) {
		
	}
}


