﻿/*
Various Javascript functions.
To use these functions on a page use the cut the following text and paste it in the HEAD tag of the page.

<SCRIPT LANGUAGE="JavaScript" src=/jscript/helpers.js></SCRIPT>

*/


/*
getmail function 

Meant to obfuscate the email addresses to prevent them from being culled by bots.
To use this place the following text where you want the address to appear and change 
the username to the appropriate string.

<script language=javascript>getmail("username")</script>

*/
function getmail(usrnm)

{
  var domain = "kctcs.edu"
  document.write("<A CLASS=NoDecoration HREF=" + "mail" + "to:" + usrnm + "@" + domain + ">" + usrnm + "@" + domain + "</A>") 
}

function getmail2(usrnm,dm)
{
  var domain = dm
  document.write("<A CLASS=NoDecoration HREF=" + "mail" + "to:" + usrnm + "@" + domain + ">" + usrnm + "@" + domain + "</A>") 
}

function openWin( windowURL, windowName, windowFeatures ) 
{ 
  return window.open( windowURL, windowName, windowFeatures ) ; 
}

function insertPopmenu() 
{
  var popmenu
  popmenu = "<div id = \"popmenu\">\n"
  popmenu += "<a href=\"#\" onClick=\"window.print()\">print</a>\n"
  popmenu += "<a href=\"#\" onClick=\"window.close()\">close</a>\n"
  popmenu += "</div>"

  document.write(popmenu)
}

function redirect(newLocation) {
    window.location = newLocation;

}

function delayAndRedirect(newLocation, delay) {
    setTimeout('redirect("' + newLocation + '")', delay);
}
