function wczytaj(www,target) {
	if (www.href) www= www.href;
	mint.Request(www,null,function() { parseAjaxResult(this.responseText,target,www);}, function(){alert("BLAD"+this.responseText);} )

}

function parseAjaxResult(text) {
	text = trim(text);
	if (text.substr(0,6)=="error:") {
		msg = text.substr(6,text.length);
		if (msg) alert(msg)
	} else {
		$("ajax_porownywarka").innerHTML=text;
	}
}

function addCompare(id) {wczytaj('comp.php?action=add&id='+id);}
function delCompare(slot) {wczytaj('comp.php?action=remove&id='+slot);}
function removeCompare() {wczytaj('comp.php?action=clear&id=1');}
function trim(str) {return str.replace(/^\s+|\s+$/g,"");}
