function makeRequest(url, param) {
var http_request = false;
if (window.XMLHttpRequest) { // Mozilla, Safari, ...
http_request = new XMLHttpRequest();
if (http_request.overrideMimeType) {
http_request.overrideMimeType('text/xml');
// Читайте ниже об этой строке
}
} else if (window.ActiveXObject) { // IE
try {
http_request = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
http_request = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {}
}
}
if (!http_request) {
alert('Не вышло :( Невозможно создать экземпляр класса XMLHTTP ');
return false;
}
http_request.onreadystatechange = function() { alertContents(http_request, param); };
http_request.open('GET', url, true);
http_request.send(null);
}


function alertContents(http_request, param) {
if (http_request.readyState == 4) {
if (http_request.status == 200) {

	dst = document.getElementById("status_comp");

	if (param == false) {
		dst.innerHTML = 'Товар удален из сравнения';
		dst.style.backgroundColor = '#000000';
		dst.style.color = '#FFCD11';
		dst.style.border = '1px #FFCD11 solid';
	} else {
		dst.innerHTML = 'Товар добавлен к сравнению';
		dst.style.backgroundColor = '#FFCD11';
		dst.style.color = '#000000';
		dst.style.border = '1px #000000 solid';
	}

	dst.style.visibility = 'visible';
	setTimeout("fadeout('status_comp')", 3000);

//var xmldoc = http_request.responseXML;
//var root_node = xmldoc.getElementsByTagName('root').item(0);
//alert(root_node.firstChild.data);
} else {
alert('С запросом возникла проблема.');
}
}
}



function fadeout(id)
{
   var dst = document.getElementById(id);

         dst.style.visibility="hidden";

      return;
}


function ImgShw(ID, width, height, alt)
{
    var scroll = "no";
    var top=0, left=0;
    if(width > screen.width-10 || height > screen.height-28) scroll = "yes";
    if(height < screen.height-28) top = Math.floor((screen.height - height)/2-14);
    if(width < screen.width-10) left = Math.floor((screen.width - width)/2-5);
    width = Math.min(width, screen.width-10);
    height = Math.min(height, screen.height-28);
    var wnd = window.open("","","scrollbars="+scroll+",resizable=no,width="+width+",height="+height+",left="+left+",top="+top);
    wnd.document.write("<html><head>\n");
    wnd.document.write("<"+"script language='JavaScript'>\n");
    wnd.document.write("<!--\n");
    wnd.document.write("function KeyPress()\n");
    wnd.document.write("{\n");
    wnd.document.write("    if(window.event.keyCode == 27)\n");
    wnd.document.write("        window.close();\n");
    wnd.document.write("}\n");
    wnd.document.write("//-->\n");
    wnd.document.write("</"+"script>\n");
    wnd.document.write("<title>"+(alt == ""? "????????":alt)+"</title></head>\n");
    wnd.document.write("<body topmargin=\"0\" leftmargin=\"0\" marginwidth=\"0\" marginheight=\"0\" onKeyPress=\"KeyPress()\" onClick=\"window.close()\">\n");
    wnd.document.write("<a href=\"javascript:void(0)\">\n");
    wnd.document.write("<img src=\""+ID+"\" border=\"0\" alt=\""+alt+"\">");
    wnd.document.write("</a>");
    wnd.document.write("</body>");
    wnd.document.write("</html>");
    wnd.document.close();
    
    //return wnd;
}

