function ToggleMode (who)
{
//var TogglePics = document.getElementById ('toggle_pics');
var ToggleProps = document.getElementById ('toggle_props');
var ToggleLong = document.getElementById ('toggle_long');
//var SwitchPics = document.getElementById ('switch_pics');
var SwitchProps = document.getElementById ('switch_props');
var SwitchLong = document.getElementById ('switch_long');

if (who.className == 'active') return;
//var isPics = 1;
var isLong = 1;

switch (who) {
	/*case TogglePics:
	TogglePics.className = 'active';
	ToggleProps.className = 'inactive';
	ToggleLong.className = 'inactive';
	isPics = 1; isProps = 0; isLong = 0;
	break*/
	
	case ToggleProps:
	//TogglePics.className = 'inactive';
	ToggleProps.className = 'active';
	ToggleLong.className = 'inactive';
	isPics = 0; isProps = 1; isLong = 0;
	break
	
	case ToggleLong:
	//TogglePics.className = 'inactive';
	ToggleProps.className = 'inactive';
	ToggleLong.className = 'active';
	isPics = 0; isProps = 0; isLong = 1;
	break
	
	default:
	break
}
//SwitchPics.style.display = isPics ? 'block' : 'none';
SwitchProps.style.display = isProps ? 'block' : 'none';
SwitchLong.style.display = isLong ? 'block' : 'none';
}

function successAddedToCompare(ret) {	
	$("#compare_block_" + ret['id']).hide();	
	//$("#compare_info_block_" + ret['id']).fadeIn("slow");	
	$("#compare_info_block_" + ret['id']).show();
	$("#compare_info_block_" + ret['id']).highlightFade({color:'#E0E0E0', speed: 500, end:'#F0F0F0'});	
}

function addToCompare(id) {
	$.ajax({
   		type: "POST",
   		url: "/compare/",
   		dataType: "json",
   		data: "action=add_to_compare&id="+id,
   		success: function(ret) {
   			successAddedToCompare(ret);
   		}   		
	});
}
