/*
  This function can be used to transfer data from one docuemnt to another.
*/
function safeTransferToParent(sourcediv, destinationdiv){
  safeTransferToParent(sourcediv, destinationdiv, 500, 0);
}

function safeTransferToParent(sourcediv, destinationdiv, maxcount){
  safeTransferToParent(sourcediv, destinationdiv, maxcount, 0);
}

function safeTransferToParent(sourcediv, destinationdiv, maxcount, currentcount){
  if (maxcount>currentcount){
    try{
      data=sourcediv;
      target=destinationdiv;

      target.innerHTML = data.innerHTML;
    } catch (e){
      window.setTimeout("safeTransferToParent", 500, sourcediv, destinationdiv, maxcount, currentcount++);
    }
  }
}