
/**
 * Sets the content based on the referrer.
 */
function setContent(referrer) {
	// the first button should not have any left margin
	// (IE6 does not honor the :first-child in the CSS file)
	$('div.main div.bottom :first-child').css('margin-left', '0px').css('margin-right', '1px');

	// show the specified tab
	if (referrer && referrer.indexOf('probe') >= 0) {
		showTab('probe');
	}
	else if (referrer && referrer.indexOf('easycharts') >= 0) {
		showTab('easycharts');
	}
	else {
		showTab('opinio');
	}
}


/**
 * The tab is clicked and marked for display.
 */
function showTab(tab) {
	// clear current tab
	$('.productTabs span').removeClass('active probe probeBack easycharts easychartsBack opinio opinioBack');
	$('div.main').hide();
	
	// show the new tab
	if (tab.id == 'probe' || tab == 'probe') {
		$('.productTabs span:eq(1)').addClass('active probeBack');
		$('.productTabs img.logo').attr('src', '/skin/images/logo_probe.gif');
		$('div#probe').show();
		$('#probeMain').show();
	}
	else if (tab.id == 'easycharts' || tab == 'easycharts') {
		$('.productTabs span:eq(2)').addClass('active easychartsBack');
		$('.productTabs img.logo').attr('src', '/skin/images/logo_easycharts.gif');
		$('div#easycharts').show();
		$('div#easychartsMain').show();
	}
	else {
		$('.productTabs span:eq(0)').addClass('active opinioBack');
		$('.productTabs img.logo').attr('src', '/skin/images/logo_opinio.gif');
		$('div#opinio').show();
		$('div#opinioMain').show();
	}
}

