var style = ((NS4 && document.test) || IE4) ? 1 : 0;
var timerID = null;
var padding = 3; // < 4 recommended
var bgcolor = "beige";
var borWid = 1; // for no border, assign null
var borCol = "#0000cc";
var borSty = "solid";
var str = "<STYLE TYPE='text/css'>";

str += ".tooltip {";
str += "position: absolute;";
str += "visibility: hidden;";
str += "left: 0; top: 0;";

if (borWid > 0) { // if a border is specified

  str += "border-width: " + borWid + ";";
  str += "border-color: " + borCol + ";";
  str += "border-style: " + borSty + ";";

}

if (NS4) {

  if (borWid > 0 && padding <= 3) {
    str += "padding: 0;";
    str += "layer-background-color: " + bgcolor + ";"; } 
    
    else if (borWid > 0 && padding > 3) {
    str += "padding: " + (padding - 3) + ";";
    str += "background-color: " + bgcolor + ";";

  } else if (borWid == 0) {
    str += "padding: " + padding + ";";
    str += "layer-background-color: " + bgcolor + ";";

  }

} else {
  str += "padding: " + padding + ";";
  str += "background-color: " + bgcolor + ";";
}

str += "}";
str += "</STYLE>";


if (style) {
  document.write(str);
  if (NS4) window.onload = init;
}

/**************************Making your tooltip text here*********************/

makeEl("out", 180, "<font size=2>SAS output data file</font>");
makeEl("dbms", 240, "<font size=2>For specifying the type of data to import.</font>");
makeEl("delimiter", 200, "<font size=2>Specify the delimiter used in the input file</font>");
makeEl("tab1", 180, "<font size=2>For a tab delimited file</font>");
makeEl("dlm", 180, "<font size=2>For a delimited file</font>");
makeEl("gname", 230, "<font size=2>Specify if column names exist.</font>");
makeEl("rep", 260, "<font size=2>If output file already exists, PROC IMPORT will not overwrite it unless replace option is set. </font>");
makeEl("tabs1", 220, "<font size=2>'09'x is the hexidecimal value for tab.</font>");
makeEl("dataset", 200, "<font size=2>The SAS data set to be written out</font>");
makeEl("outfile", 180, "<font size=2>Specify the path and name for the permanent file</font>");
makeEl("xls", 200, "<font size=2>PROC IMPORT knows that it is an Excel file if the file extension is .xls.</font>");
makeEl("sheet", 240, "<font size=2>Specify the name of the sheet to be read in.</font>");
makeEl("v8", 220, "<font size=2>Specify to use SAS version 8 engine.</font>");
makeEl("libref", 220, "<font size=2>The logical name, also known as LIBREF, associated with the directory, is assigned by user.</font>");
makeEl("path", 210, "<font size=2>The physical location, i.e. the directory for the permanent data set.</font>");
makeEl("csv", 200, "<font size=2>For comma-separated-variable files</font>");
makeEl("drow", 220, "<font size=2>Specify the row number to start to read.</font>");



/* the above tooltips are for tab*.htm, space*.htm, excel*.htm, comma*.htm */

/*************************End of making tooltip text*************************/

function init() {
  setTimeout("window.onresize = redo", 1000);
}

function redo() {
  window.location.reload();
}

function makeEl(id, width, code) {
  if (!style) return;

  var str = "<STYLE TYPE='text/css'>";
  str += "#" + id + " {";
  str += "width: " + width + ";";
  str += "}";
  str += "</STYLE>";
  str += "<DIV CLASS='tooltip' ID='" + id + "'><center>" + code + "</center></DIV>";
   
  document.write(str);
}

function displayEl(left, top) {

  if (NS4) document.releaseEvents(Event.MOUSEMOVE);
  document.onmousemove = null;
  var whichEl = (NS4) ? document[active] : document.all[active].style;
  whichEl.left = left;
  whichEl.top = top;;
  whichEl.visibility = (NS4) ? "show" : "visible";
}

function clearEl() {

  if (!style) return;

  var whichEl = (NS4) ? document[active] : document.all[active].style;
  whichEl.visibility = (NS4) ? "hide" : "hidden";
  active = null;

  if (timerID) clearTimeout(timerID);
  if (NS4) document.releaseEvents(Event.MOUSEMOVE);
  document.onmousemove = null;

}

function activateEl(id, e) {

  if (!style) return;
  active = id;

  if (NS4) document.captureEvents(Event.MOUSEMOVE);
  document.onmousemove = checkEl;
  checkEl(e);

  }

function checkEl(e) {
  if (timerID) clearTimeout(timerID);
  var left = (NS4) ? e.pageX : event.clientX + document.body.scrollLeft;
  var top = (NS4) ? e.pageY + 20 : event.clientY + document.body.scrollTop + 20;
  timerID = setTimeout("displayEl(" + left + ", " + top + ")", 300);
}


