
function equalHeight() {

    var val1 = document.getElementById('equ1').offsetHeight;
    var val2 = document.getElementById('equ2').offsetHeight;
    var val3 = document.getElementById('equ3').offsetHeight;
    var max = val1;
    if(val2 > max) max = val2;
    if(val3 > max) max = val3;
    document.getElementById('equ1').style.height = max + 'px';
    document.getElementById('equ2').style.height = max + 'px';
    document.getElementById('equ3').style.height = max + 'px';
}

function buy(id) {}

function mbuy(id) {}

function yp(id, t) {}

function myp(id) {}

function click_common(id, t) {

    img = new Image();
    img.src = 'http://hotline.ua/img/stat/common.phtml?id=' + id + '&t=' + t;
}

function click_new(id, cardid, special) {

    img = new Image();
    r = Math.round((Math.random() * (10000000 - 1)));
    img.src = 'http://hotline.ua/img/stat/click.phtml?id=' + id + '&cardid=' + cardid + '&special=' + special + '&r=' + r;
//    pageTracker._ trackPageview ('/click/');
    setTimeout('return', 500);
}

// новая функция, которая поддерживает филиалы.
function click_remade(id, cardid, special, firmid) {

    img = new Image();
    r = Math.round((Math.random() * (10000000 - 1)));
    img.src = 'http://hotline.ua/img/stat/click.phtml?id=' + id + '&cardid=' + cardid + '&special=' + special + '&firmid=' + firmid + '&r=' + r;
//    img.src = 'http://www.googleadservices.com/pagead/conversion/1065689709/?value=0,15&amp;label=WJkLCP-72gEQ7cSU_AM&amp;guid=ON&amp;script=0';
    setTimeout('return', 100);
}

var old_tooltip_id = 'i1';

function getposOffset(overlay, offsettype) {

    var totaloffset = (offsettype == 'left') ? (overlay.offsetLeft - 100) : (overlay.offsetTop + 17);
    var parentEl = overlay.offsetParent;
    while (parentEl != null) {

	totaloffset = (offsettype == 'left') ? totaloffset + parentEl.offsetLeft : totaloffset + parentEl.offsetTop;
	parentEl = parentEl.offsetParent;
    }
    return totaloffset;
}

function overlay(curobj, subobj) {

    overlayclose(old_tooltip_id);
    old_tooltip_id = subobj;
    if (document.getElementById) {

	var subobj = document.getElementById(subobj);
	subobj.style.left = getposOffset(curobj, 'left') + 'px';
	subobj.style.top = getposOffset(curobj, 'top') + 'px';
	subobj.style.display = 'block';
	return false
    } else
	return true
}

function overlayclose(subobj) {

    document.getElementById(subobj).style.display = 'none';
}

function createRequestObject() {

    var ro;
    var browser = navigator.appName;
    if(browser == "Microsoft Internet Explorer") {

        ro = new ActiveXObject("Microsoft.XMLHTTP");

    } else {

        ro = new XMLHttpRequest();
    }
    return ro;
}

var http = createRequestObject();
