// JavaScript Document
function save_favorite(element, page) {

  // definovanie objektu XMLHttpRequest aby pracoval korektne aj v IE
  var xmlhttp = (window.XMLHttpRequest ? new XMLHttpRequest : (window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : false));
  var document_element = document.getElementById(element).innerHTML;

  xmlhttp.open('GET', page);
  xmlhttp.onreadystatechange = function() {
      spracuj(xmlhttp);
  };
  xmlhttp.send(document_element);

    function spracuj(xmlhttp) {
      if (xmlhttp.readyState == 4) {
          if (xmlhttp.status == 200) {
              alert(xmlhttp.responseText);
          } // end if.. else..
      } // end if..
    } // end function spravuj

} // end function load element