function do_submit(form_id)
{
  document.getElementById(form_id).submit();
  return false;
}

function set_external_links()
{
  if (!document.getElementsByTagName) {
    return;
  }
  var anchors = document.getElementsByTagName('a');
  for (var i = 0; i < anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute('href') && anchor.getAttribute('rel') == 'external') {
     anchor.target = "_blank";
   }
  }
}

window.onload = set_external_links;

///////////////////////////////////////////////////////////

function navigate(box_id) {
    if (box_id) {
        box_id_global = box_id;
		var url = 'navigation_box.php?box_id=' + box_id;
        if(window.XMLHttpRequest) {
                req = new XMLHttpRequest();
        } else if(window.ActiveXObject) {
                req = new ActiveXObject("Microsoft.XMLHTTP");
        }
        req.open("GET", url, true);
        req.onreadystatechange = callback;
        req.send(null);
    }
}

function callback() {
        if(req.readyState == 4) {
                if(req.status == 200) {
                        response = req.responseText;
                        document.getElementById('navigation_box').innerHTML = response;
                } else {
                        alert("There was a problem retrieving the data:\n" + req.statusText);
                }
        }
}

////////////////////////////////////////////////////////