
/* toggle visibility */

function toggle( targetId ) {
  if (document.getElementById) {
  		target = document.getElementById( targetId );
  			if (target.style.display == "none"){
  				target.style.display = "";
  			} else {
  				target.style.display = "none";
  			}
  	}
}

/** global var for back count **/

var back_count = 0;


function goBack() {
	back_count = back_count + 1;
	history.back();
	/* activate forward button */
	if (document.getElementById) {
  		document.getElementById('bt_forward').className = "";
	}
}

function goForward() {
	back_count = back_count - 1;
	history.forward();
	/* deactivate forward button if this is the last page of the history */
	if ( back_count ==  0) { document.getElementById('bt_forward').className = 'inactif'; }
}

function doPlay(mode, id) {
	parent.parent.player.location.replace('player/player?mode='+mode+'&id='+id);
}
