/*
 * Copyright (c) 2002-2007 Julien WILK (http://LDDb.com/)
 * Not to be modified/reused without authorization.
 */

var CurrentMRx = 'MRS';

var ShopTimerRunning = false;
var ShopTimerID = null;
var ShopBackup = '';

function update_MRx_cb(contents)
{
	$('MRx').innerHTML = contents;
  new Effect.SlideDown('MRx', {duration:1.0, queue:{position:'end',scope:'MRx'} });
  new Effect.Fade("searching", {duration:0.5, queue:{position:'end',scope:'MRx'} });
}

function update_MRx(tab)
{
  if(CurrentMRx != tab)
  {
    $(CurrentMRx+"_selected").className = 'boxed_white';
    CurrentMRx = tab;
    $(CurrentMRx+"_selected").className = 'boxed_white_selected';
	  $("searching").style.display = '';
    new Effect.DropOut('MRx', {duration:1.0, queue:{position:'end',scope:'MRx'},afterFinish:function(){sajax_update_MRx(tab,update_MRx_cb);} });
  }
}

function fetch_tagline()
{
  setTimeout('new Ajax.Request(\'ajax.php?load=tagline\', {asynchronous:true, onSuccess:fetch_tagline_cb});',60*1000);
}

function fetch_tagline_cb(t)
{
	Effect.Fade('tagline',{duration:15.0,queue:{position:'end',scope:'tagline'}, afterFinish:function(){$('tagline').innerHTML = t.responseText;} });
	Effect.Appear('tagline',{duration:1.0,queue:{position:'end',scope:'tagline'}, afterFinish:function(){fetch_tagline();} });
}

function formats(fmt)
{
	$('ld').src = '/images/logo/format/ld_off.gif';
	$('hddvd').src = '/images/logo/format/hddvd_off.gif';
	$('ced').src = '/images/logo/format/ced_off.gif';
	$('vhd').src = '/images/logo/format/vhd_off.gif';
	$('dvhs').src = '/images/logo/format/dvhs_off.gif';

	switch(fmt)
	{
		case 'all':
			$('ld').src = '/images/logo/format/ld.gif';
			$('hddvd').src = '/images/logo/format/hddvd.gif';
			$('ced').src = '/images/logo/format/ced.gif';
			$('vhd').src = '/images/logo/format/vhd.gif';
			$('dvhs').src = '/images/logo/format/dvhs.gif';
		break;

		case 'ld':
		case 'hddvd':
		case 'ced':
		case 'vhd':
		case 'dvhs':
			$(fmt).src = '/images/logo/format/'+fmt+'.gif';
		break;
	}
}