SRC and name attribute in PHP

i have an iframe which i need to change to div but without changing its src and name attribute which are being used in other scripts is it possible to write the same in php code.

Below is the IFrame code.

<iframe src='top_nav.php' name='top_nav' class="daemon" scrolling="auto" frameborder='0' height='100%' width="100%"></iframe>

Those would be meaningless on a div. What is your real aim here?

There are many scripts working in iframe are dependent on each other their javaqueries are created in one file top_nav.php, its being used for nav purpose on left side but to take from left to top i will need to ramove frames, by doing so other scripts working in their frames will stop working, i just need to know how to move further in the direction of removing frames?

The code for menus generation is below:

function genTreeLink($frame, $name, $title, $mono=false) {
  global $primary_docs, $disallowed;
  if (empty($disallowed[$name])) {
   $id = $name . $primary_docs[$name][1];
   echo "<li><a href='' id='$id' onclick=\"";
   if ($mono) {
    if ($frame == 'RTop')
     echo "forceSpec(true,false);";
    else
     echo "forceSpec(false,true);";
   }
   echo "return loadFrame2('$id','$frame','" .
        $primary_docs[$name][2] . "')\">" . $title . ($name == 'msg' ? ' <span id="reminderCountSpan" class="bold"></span>' : '')."</a></li>";
  }
 }

In other words how to load content of frame in a div, like the one to be changed below for loading content into the div.

function loadFrame(fname, frame, url) {
  top.restoreSession();
  var i = url.indexOf('{PID}');
  if (i >= 0) url = url.substring(0,i) + active_pid + url.substring(i+5);
  top.frames[frame].location = '<?php echo "$web_root/interface/" ?>' + url;
  if (frame == 'RTop') topName = fname;
 }

 // Load the specified url into a frame to be determined, with the specified
 // frame as the default; the url must be relative to interface.
 function loadFrame2(fname, frame, url) {
  var usage = fname.substring(3);
  if (active_pid == 0 && usage > '0') {
   alert('<?php xl('You must first select or add a visitor.','e') ?>');
   return false;
  }
  if (active_encounter == 0 && usage > '1') {
   alert('<?php xl('You must first select or create an encounter.','e') ?>');
   return false;
  }
  if (encounter_locked && usage > '1') {
   alert('<?php echo xls('This encounter is locked. No new forms can be added.') ?>');
   return false;
  }
  var f = document.forms[0];
  top.restoreSession();
  var i = url.indexOf('{PID}');
  if (i >= 0) url = url.substring(0,i) + active_pid + url.substring(i+5);
  if(f.sel_frame)
   {
	  var fi = f.sel_frame.selectedIndex;
	  if (fi == 1) frame = 'RTop'; else if (fi == 2) frame = 'RTop';
   }
  if (!f.cb_bot.checked) frame = 'RTop';
  top.frames[frame].location = '<?php echo "$web_root/interface/" ?>' + url;
  if (frame == 'RTop') topName = fname;
  return false;
 }
 
 function loadFrame3(fname, frame, url) {
  var f = document.forms[0];
  top.restoreSession();
  var i = url.indexOf('{PID}');
  if (i >= 0) url = url.substring(0,i) + active_pid + url.substring(i+5);
  if(f.sel_frame)
   {
	  var fi = f.sel_frame.selectedIndex;
	  if (fi == 1) frame = 'RTop';
   }
  if (!f.cb_bot.checked) frame = 'RTop';
  top.frames[frame].location = '<?php echo "$web_root/interface/" ?>' + url;
  if (frame == 'RTop') topName = fname;
  return false;
 }