var ready_to_go = true; function get_object_position(obj) { var curleft = curtop = 0; if (obj.offsetParent) { curleft = obj.offsetLeft curtop = obj.offsetTop while (obj = obj.offsetParent) { curleft += obj.offsetLeft curtop += obj.offsetTop } } //alert(curleft+' '+curtop); return [curleft,curtop]; } function close(div_id) { document.getElementById(div_id).style.display = 'none'; } function get_analysis(obj,div_id) { if (http_request.readyState == 4) { if (http_request.status == 200) { show_response(http_request.responseText,obj,div_id); } } } function show_analysis(obj,id,div_id){ if (document.ready_to_go = true) { document.ready_to_go = false; url = 'www/a_recommendation_analysis.php?id='+id; make_request('GET',url,true,function () {get_analysis(obj,div_id)}); } } function show_response(resp,obj,div_id) { var position; position = get_object_position(obj); position_left = position[0]; position_top = position[1]; belka = '
zamknij
'; // document.getElementById(div_id).style.width = '200px'; //document.getElementById('analysis').style.height = '100px'; document.getElementById(div_id).style.display = 'block'; document.getElementById(div_id).style.left = '400px'; // document.getElementById(div_id).style.align = 'center'; document.getElementById(div_id).style.top = position_top+'px'; document.getElementById(div_id).innerHTML = belka + '
'+resp+'
'; // alert(document.getElementById(div_id).style.height); }