function revistaOnline(ed, path)
{
	if (!path) path='';
	return !window.open(path + 'revista.php?rvc=' + ed, 'revistaonline', 'left=0,top=0,width=' + screen.width + ',height=' + screen.height);
}

var tOut=null;

function switchDest(id)
{
	var i=0;
	while(true)
	{
		var cObj=$('#dest-' + i);
		if (!cObj.get(0)) break;
		
		var cNav=$('#dest-nav-' + i); 
		
		cObj.css('display', (i == id ? 'block' : 'none'));
		if (i == id)
			cNav.addClass('selected');
		else
			cNav.removeClass('selected');
		
		i++;
	}
	
	try
	{
		clearTimeout(tOut);
	}catch(e) {}
}

function switchDestTimer(id, total, timer)
{
	switchDest(id);
	
	id++;	
	if (id >= total) id=0;
	
	tOut=setTimeout('switchDestTimer(' + id + ',' + total + ',' + timer + ')', timer);
}

$(document).ready(function() {
	$('#materia img').each(function() {
		$(this).mousedown(function(e) {	
			if (!e) e = event;
			
			if (e.button == 2)
				window.alert("Todos direitos reservados à revista Rodovias&Vias");
		});
	});
});

jQuery(document).ready(function() {
	$("#subscribe").fancybox({
			'autoScale'     	: false,
			'transitionIn'		: 'none',
			'transitionOut'		: 'none',
			'type'				: 'iframe'
		});
});
