<!--
function openwindow(page,width,height) {
  windowprops = "height=" + height + ",width=" + width + ",location=no,scrollbars=yes,menubars=yes,toolbars=no,resizable=no";
  window.open(page, "detail", windowprops);
}

// Extended Tooltip Javascript
// copyright 9th August 2002, 3rd July 2005
// by Stephen Chapman, Felgall Pty Ltd

// permission is granted to use this javascript provided that the below code is not altered
var DH = 0;var an = 0;var al = 0;var ai = 0;if (document.getElementById) {ai = 1; DH = 1;}else {if (document.all) {al = 1; DH = 1;} else { browserVersion = parseInt(navigator.appVersion); if ((navigator.appName.indexOf('Netscape') != -1) && (browserVersion == 4)) {an = 1; DH = 1;}}} function fd(oi, wS) {if (ai) return wS ? document.getElementById(oi).style:document.getElementById(oi); if (al) return wS ? document.all[oi].style: document.all[oi]; if (an) return document.layers[oi];}
function pw() {return window.innerWidth != null? window.innerWidth: document.body.clientWidth != null? document.body.clientWidth:null;}
function mouseX(evt) {if (evt.pageX) return evt.pageX; else if (evt.clientX)return evt.clientX + (document.documentElement.scrollLeft ?  document.documentElement.scrollLeft : document.body.scrollLeft); else return null;}
function mouseY(evt) {if (evt.pageY) return evt.pageY; else if (evt.clientY)return evt.clientY + (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop); else return null;}
function jfTip(evt,oi) {if (DH) {var wp = pw(); ds = fd(oi,1); dm = fd(oi,0); st = ds.visibility; if (dm.offsetWidth) ew = dm.offsetWidth; else if (dm.clip.width) ew = dm.clip.width; if (st == "visible" || st == "show") { ds.visibility = "hidden"; } else {tv = mouseY(evt) + 20; lv = mouseX(evt) - 90 - (ew/4); if (lv < 2) lv = 2; else if (lv + ew > wp) lv -= ew/2; if (!an) {lv += 'px';tv += 'px';} ds.left = lv; ds.top = tv; ds.visibility = "visible";}}}

var request = null;
/* Wrapper function for constructing a request object.
 Parameters:
  reqType: The HTTP request type, such as GET or POST.
  url: The URL of the server program.
  asynch: Whether to send the request asynchronously or not.
  respHandle: The name of the function that will handle the response.
  Any fifth parameters, represented as arguments[4], are the data a POST request is designed to send. */

function httpRequest(reqType,url,asynch,respHandle){
  //Mozilla-based browsers
  if(window.XMLHttpRequest){
    request = new XMLHttpRequest();
  } else if (window.ActiveXObject){
    request = new ActiveXObject("Msxml2.XMLHTTP");
    if (!request){
      request = new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
  //very unlikely, but we test for a null request
  //if neither ActiveXObject was initialized
  if(request){
    //if the reqType parameter is POST, then the 5th argument to the function is the POSTed data
    if(reqType.toLowerCase() != "post") {
      initReq(reqType,url,asynch,respHandle);
    } else {
      //the POSTed data
      var args = arguments[4];
      if(args != null && args.length > 0){
        initReq(reqType,url,asynch,respHandle,args);
      }
    }
  } else {
    alert("Your browser does not permit the use of all of this application's features!");
  }
}

/* Initialize a request object that is already constructed */
function initReq(reqType,url,bool,respHandle){
  try{
    /* Specify the function that will handle the HTTP response */
    request.onreadystatechange=respHandle;
    request.open(reqType,url,bool);
    //if the reqType parameter is POST, then the 5th argument to the function is the POSTed data
    if(reqType.toLowerCase() == "post"){
      request.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
      request.send(arguments[4]);
    } else {
      request.send(null);
    }
  } catch (errv) {
    alert("The application cannot contact the server at the moment. Please try again in a few seconds.\nError detail: "+errv.message);
  }
}

// Used for Glossary items
function jfPopGloss(word) {
  //AJAX call to PHP that will get the values from mysql
  var phpurl = 'http://www.soilsofcanada.ca/include/retrieve.php';
  var querystring = 'word='+word;
  httpRequest("POST",phpurl,true,jfPopGlossResp,querystring);
}
function jfPopGlossResp() {
  if(request.readyState == 4) {
    if(request.status == 200) {
      symbols = request.responseText.split("|");
      document.getElementById('gWord').innerHTML = symbols[0];
      document.getElementById('gDef').innerHTML = symbols[1];
    } else {
      alert("A problem occured with communicating between the XMLHttpRequest object and the server program.");
    }
  }
}

-->
