function dvdloc()
{
	var obj;
	//for all content types
  this.ctype = content_type;//content type
  obj = document.getElementById("cntBody");
  if (obj)
  	this.scroll = obj.scrollTop;
  else
  	this.scroll = 0;//scroll offset of content <div>
  	
  this.viewopt = viewoptions;//display options
  this.ipp = itemsperpage;
  this.sropt = searchOptions;
  //for search result pages
  this.sType = searchType;//search type
  this.sValue = searchValue;//search value
  this.sr_sort = sr_sort_mode;//sort type
  this.sr_cache = searchresult;//search result cache
  this.sr_first = sr_show_first;//first item to view
}

dvdloc.prototype.isEqual = function(loc)
{
  return (this.ctype==loc.ctype)&&(this.sType==loc.sType)&&(this.sValue==loc.sValue);
}

function dvdhist()
{
  this.maxlocs = 20;
  this.prevlocs = [];//history of content locations
  this.nextlocs = [];
  this.enabled = false;
}

dvdhist.prototype.updateControls = function()
{
	var btd = document.getElementById("back_but");
	var ftd = document.getElementById("frwd_but");
	if (this.prevlocs.length == 0)
		btd.innerHTML = "<img class='nomar' src='data/img/back_ds.png' border='0'/>";
	else
		btd.innerHTML = "<a href='javascript:dvdhistory.prev()'><img class='nomar' src='data/img/back_ov.png' border='0'/></a>";
	if (this.nextlocs.length == 0)
		ftd.innerHTML = "<img class='nomar' src='data/img/forward_ds.png' border='0'/>";
	else
		ftd.innerHTML = "<a href='javascript:dvdhistory.next()'><img class='nomar' src='data/img/forward_ov.png' border='0'/></a>";
}

dvdhist.prototype.save = function()
{
	if (!this.enabled) return;
	//saves current position to history
	var obj = new dvdloc();
	if (this.prevlocs.length == this.maxlocs)
		this.prevlocs.shift();
	this.prevlocs.push(obj);
	this.nextlocs = [];
	this.updateControls();
}

dvdhist.prototype.next = function()
{
  if (this.nextlocs.length == 0) return;
  this.prevlocs.push(new dvdloc());
  var loc = this.nextlocs.shift();//next loc
  this.updateControls();
  this.setLoc(loc);
}

dvdhist.prototype.prev = function()
{
  if (this.prevlocs.length == 0) return;
  this.nextlocs.splice(0, 0, new dvdloc());
	var loc = this.prevlocs.pop();//prev loc
	this.updateControls();
	this.setLoc(loc);
}

dvdhist.prototype.setLoc = function(loc)
{
	var div = document.getElementById("cntBody");
	if (div)
  	div.scrollTop = loc.scroll;
  	
  setViewOptions(loc.viewopt, loc.ipp);
  searchOptions = loc.sropt;
  sr_sort_mode = loc.sr_sort;//sort type
  
  setContentType(content_types[loc.ctype].name);
  switch (loc.ctype)
  {
  	case 0:
  	case 1:
  	case 2:
  		searchType = loc.sType;//search type
  		searchValue = loc.sValue;//search value
  		searchresult = loc.sr_cache;
  		sr_show_first = loc.sr_first;//first item to view
		  displaySearchResult(loc.scroll);
  		break;
  	case 3:
  		setHomeContent(loc.scroll);
  		break;
  	case 4:
  		genAuthorsHtml(loc.scroll);
  		break;
  	case 5:
  		genCompaniesHtml(loc.scroll);
  		break;
  	case 6:
  		genSymposiumHtml(loc.scroll);
  		break;
  	case 7:
  		genTimeTableHtml(loc.scroll);
  		break;
  }
  
}