function ClearCompareList()
{
	$.ajax({  
	url: "/add_on_scripts/ajax_add_product_compare.php?id=-1",  
	cache: false,  
	success: function(html){  
	$("#compare_div").html(html);  
	}  
	});  
}

function trim(string)
{
return string.replace(/(^\s+)|(\s+$)/g, "");
}

function RemoveProductCompare(id)
{
	$.ajax({  
	url: "/add_on_scripts/ajax_add_product_compare.php?remove_id="+id,  
	cache: false,  
	success: function(html){
	
	if (trim(html) != '')
	{
	$("#show_compare_products_div").html(html);  
	}
	else
	{
	$("#show_compare_products_div").hide();
	$("#dark_background").remove();
	
	  
	}
	
	$.ajax({  
	url: "/add_on_scripts/ajax_add_product_compare.php?id=update",  
	cache: false,  
	success: function(html){  
	$("#compare_div").html(html);  
	}  
	}); 
	
	}  
	});  
	
}

function ShowCompareProductsList(count)
{
	if (count != 0)
	{
	$.ajax({  
	url: "/add_on_scripts/ajax_add_product_compare.php?id=all",  
	cache: false,  
	success: function(html){
	$("#document_body").append('<div onclick="CloseProductsList();" id="dark_background" style="filter:progid:DXImageTransform.Microsoft.Alpha(opacity=60); height: 100%; width: 100%; position: fixed; z-index: 110; left: 0px; top: 0px; opacity: 0.6; background: none repeat scroll 0% 0% rgb(0, 0, 0);"></div>');
	$("#show_compare_products_div").show();
	$("#show_compare_products_div").html(html);  
	}  
	});  
	}
}

function CloseProductsList()
{
	$("#show_compare_products_div").hide();
	$("#dark_background").remove();
}
