function compRequest(ID, type, clearID) {
	if (ID >= 0) {	
		if (clearID != false) {
			var arrID = clearID.split("_");
		}
		var prevHtml = jQuery('#comparison').html();
		jQuery('#comparison').html("<img src='/catalog/images/loading.gif'>");
		jQuery.ajax({
			type: "GET",
			url: "/catalog/compload.php",
			data: "comp_id=" + ID + "&type=" + type,
			success: function(response){
				if (response.match(/#type#/)) {
					jQuery('#comparefail').modal({
						closeHTML: "<a href='#' title='Close' class='modal-close'>x</a>",
						position: ["50%",],
						overlayId: 'simplemodal-overlay',
						containerId: 'comparefail-container'
					});
					jQuery('#comparison').html(prevHtml);					
				} else {
					if (response.match(/#empty#/)) {	
						jQuery('#compareTable').hide();	
					} else {
						jQuery('#comparison').html(response);
						jQuery('#compareTable').show();	
					}
					if (clearID != false) {		
						for ( var i = 0; i < arrID.length; i++) {
							jQuery('#compare_link_' + arrID[i]).html("Добавить к сравнению");
							jQuery('#compare_show_' + arrID[i]).html("");
						}
					} else {				
						if (jQuery('#compare_link_' + ID).html() == "Добавить к сравнению"){
							jQuery('#compare_link_' + ID).html("Удалить из сравнения");
							jQuery('#compare_show_' + ID).html("<a class=\"compare\" \"href=\"/catalog/comparison.php\">сравнить</a>");
						} else if (jQuery('#compare_link_' + ID).html() == "Удалить из сравнения") {
							jQuery('#compare_link_' + ID).html("Добавить к сравнению");
							jQuery('#compare_show_' + ID).html("");
						}
					}
				}
			}
		});
	}
}
