rem: songinfoArray[songinfoArray.length] = {name: 'artist', stub:'browsedb.html?hierarchy=album,track&level=1&contributor.id='}; 
context: function refreshPlugins(theData) {	var myData = theData.responseText;	var homeParsedData = parseData(myData);	// create Plugin links, if applicable	var pluginDivs = [ [% IF biography != "PLUGIN_BIOGRAPHY"; "'"; biography | replace('\s+', '_'); "',"; END; %] [% IF albumReview != "PLUGIN_ALBUMREVIEW"; "'"; albumReview | replace('\s+', '_'); "'"; END; %] ];	pluginDivs.each( function (thisDiv) {		if (homeParsedData[thisDiv].match(/\w/)) {			var linkName = thisDiv.replace('_',' ');			var streamDiv = "Stream"+thisDiv;			if ($(thisDiv)) {				$(thisDiv).innerHTML = '<a href = "[% webroot %]'+homeParsedData[thisDiv]+'player='+player+'">('+linkName+')</a>';			}			if ($(streamDiv)) {				$(streamDiv).innerHTML = '<a href = "[% webroot %]'+homeParsedData[thisDiv]+'player='+player+'">('+linkName+')</a>';			}		}	});}function refreshControls(theData) {	var parsedData = fillDataHash(theData);	// refresh control_display in songinfo section	refreshPlayerStatus(parsedData);	// refresh player controls	var selected=null;	if (parsedData['playmode'] == 0) {		selected = 'stop';	} else if (parsedData['playmode'] == 1) {		selected = 'play';	} else if (parsedData['playmode'] == 2) {		selected = 'pause';	}	playerButtonControl('player', selected, '', true);	// refresh shuffle controls	// refresh repeat controls	// refresh volume (?)	refreshVolumeControl(parsedData);}function refreshVolumeControl(theData) {	var parsedData = fillDataHash(theData);	var levels = [0, 20, 35, 50, 75, 80, 85, 90, 95, 100];	levels.each( function(thisLevel) {		var key = 'bar_'+thisLevel;		var activeKey = 'bar_active_'+thisLevel;		var turnOn = null;		var turnOff = null;		var intVolume = parseInt(parsedData['volume'], 10);		if (intVolume == 0 && thisLevel == 0) {			turnOn = activeKey;			turnOff = key;		} else if (thisLevel == 0) {			turnOn = key;			turnOff = activeKey;		} else if (intVolume >= thisLevel) {			turnOn = activeKey;			turnOff = key;		} else {			turnOn = key;			turnOff = activeKey;		}		if ($(turnOff)) {			Element.hide(turnOff);		}		if ($(turnOn)) {			Element.show(turnOn);		}	});}function refreshPlayerStatus(theData) {	var parsedData = fillDataHash(theData);	var controls = ['playtextmode', 'thissongnum', 'songcount'];	controls.each(function(key) {		if ($(key)) {			refreshElement(key, parsedData[key]);		}	});	if (!intervalID) {		progressUpdate();	}}function volumeControl(level, param) {	getStatusData(param,refreshVolumeControl);}// called from onClick on repeat or shuffle controlsfunction playerButtonControl(playerRepeatOrShuffle, selected, param, noRequest) {	// make the image selected 'active'	// make the rest not active	var controls = ['off', 'song', 'album', 'playlist', 'play', 'pause', 'stop'];	var turnOn = null;	var turnOff = null;	controls.each(function(thisControl) {		if (thisControl == selected) {			turnOn = playerRepeatOrShuffle+'control_active_'+thisControl;			turnOff = playerRepeatOrShuffle+'control_'+thisControl;		} else {			turnOn = playerRepeatOrShuffle+'control_'+thisControl;			turnOff = playerRepeatOrShuffle+'control_active_'+thisControl;		}		if ($(turnOff)) {			Element.hide(turnOff);		}		if ($(turnOn)) {			// still haven't figured this out, but prototype's Element.show here kills the progress bar. Bizarre			//Element.show(turnOn);			// go with this instead			document.getElementById(turnOn).style.display = "block";		}	});	if (selected == 'stop') {		resetProgressBar();	}	if (noRequest) {		return true;	} else if (selected == 'prev' || selected == 'next') {		$('playercontrol_prev').src = 'html/images/larger/prev.gif';		$('playercontrol_next').src = 'html/images/larger/next.gif';		getStatusData(param, refreshAll);	} else if (playerRepeatOrShuffle == 'player') {		getStatusData(param, refreshAll);	} else if (playerRepeatOrShuffle == 'shuffle') {		getStatusData(param, refreshAll);	} else {		getStatusData(param, refreshNothing);	}}// called from onClick on play/pause/stop/prev/next controlsfunction playerControl(selected, param) {	// make the image selected 'active'	// make the rest not active	var imgStub = 'html/images/larger/';	var controls = ['play', 'pause', 'stop'];	controls.each(function(thisControl) {		var imgSrc = null;		if (thisControl == selected) {			imgSrc = imgStub + thisControl + '_active.gif';		} else {			imgSrc = imgStub + thisControl + '.gif';		}		var key = 'playercontrol_'+thisControl;		if ($(key)) {			$(key).src = imgSrc;		}	});}function refreshOtherElements(theData) {	var parsedData = fillDataHash(theData);	// refresh cover art	if ($('albumhref')) {		$('albumhref').href = 'browsedb.html?hierarchy=album,track&level=2&album.id='+parsedData['albumid']+'&amp;player='+player;	}	if ($('coverartpath')) {		var coverPath = null;		if (parsedData['coverartpath'].match('cover') || parsedData['coverartpath'].match('radio')) {			coverPath = parsedData['coverartpath'];		} else {			coverPath = '/music/'+parsedData['coverartpath']+'/cover.jpg';		}		$('coverartpath').src = coverPath;	}	// refresh song info	var songinfoArray = new Array();	songinfoArray[songinfoArray.length] = {name: 'songtitle', stub:'songinfo.html?item='};	songinfoArray[songinfoArray.length] = {name: 'artist', stub:'browsedb.html?hierarchy=album,track&level=1&contributor.id='};	songinfoArray[songinfoArray.length] = {name: 'album', stub:'browsedb.html?hierarchy=album,track&level=2&album.id='};	songinfoArray[songinfoArray.length] = {name: 'genre', stub:'browsedb.html?hierarchy=genre,album,track&level=1&genre.id='};	songinfoArray.each(function(key) {		var thisName = key.name;		var thisStub = key.stub;		refreshElement(thisName, parsedData[thisName], 50);		var linkIdKey = thisName + '_link';		var linkKey = thisName + 'id';		var newHref = thisStub + parsedData[linkKey] + '&amp;player=' + player;		refreshHref(linkIdKey, newHref);	});	if (parsedData['streamtitle']) {		refreshElement('streamtitle', parsedData['streamtitle'], 50);	}	// refresh links in song info section	// refresh playlist	var playlistArray = ['previoussong', 'currentsong', 'nextsong' ];	playlistArray.each(function(key) {		if ($(key)) {			var value;			if (parsedData[key]) {				value = parsedData[key];			} else {				value = '(ssh...it\'s a secret)';			}			refreshElement(key, value, 40);		} 	});	// refresh player ON/OFF}window.onload= function() {	getStatusData(args, refreshAll);	progressUpdate();	globalOnload();}
meta: 6551	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/6551/91a58ec56655e9caf3d9a3c4fc0486aac704ff33/status.js/buggy/HTML/Nokia770/status.js