// Cool CSS Menu- By JavaScriptKit.com (http://www.javascriptkit.com)
// For this and over 400+ free scripts, visit JavaScript Kit- http://www.javascriptkit.com/
// Fading routine based on Dynamic Drive script: http://www.dynamicdrive.com/dynamicindex4/highlightgrad.htm
// This notice must stay intact for use

var baseopacity=0

function showtext(thetext){
if (!document.getElementById)
return
textcontainerobj=document.getElementById("tabledescription")
browserdetect=textcontainerobj.filters? "ie" : typeof textcontainerobj.style.MozOpacity=="string"? "mozilla" : ""
instantset(baseopacity)
document.getElementById("tabledescription").innerHTML=thetext
highlighting=setInterval("gradualfade(textcontainerobj)",50)
}

function hidetext(){
cleartimer()
instantset(baseopacity)
}

function instantset(degree){
if (browserdetect=="mozilla")
textcontainerobj.style.MozOpacity=degree/100
else if (browserdetect=="ie")
textcontainerobj.filters.alpha.opacity=degree
else if (document.getElementById && baseopacity==0)
document.getElementById("tabledescription").innerHTML=""
}

function cleartimer(){
if (window.highlighting) clearInterval(highlighting)
}

function gradualfade(cur2){
if (browserdetect=="mozilla" && cur2.style.MozOpacity<1)
cur2.style.MozOpacity=Math.min(parseFloat(cur2.style.MozOpacity)+0.2, 0.99)
else if (browserdetect=="ie" && cur2.filters.alpha.opacity<100)
cur2.filters.alpha.opacity+=20
else if (window.highlighting)
clearInterval(highlighting)
}

function openURL()
{ 
// grab index number of the selected option
selInd = document.theForm.aaa.selectedIndex; 

// get value of the selected option
goURL = document.theForm.aaa.options[selInd].value;

// redirect browser to the grabbed value (hopefully a URL)
top.location.href = goURL; 

<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

var maxOneNo = 3
var oneNo
var myOne = new Array()

myOne[0] = '<img src="../images/header1.gif" alt="CSSAC Header" width="700" height="214" border="0" usemap="#Map"></a>'
myOne[1] = '<img src="../images/header2.gif" alt="CSSAC Header" width="700" height="214" border="0" usemap="#Map"></a>'
myOne[2] = '<img src="../images/header3.gif" alt="CSSAC Header" width="700" height="214" border="0" usemap="#Map"></a>'
myOne[3] = '<img src="../images/header4.gif" alt="CSSAC Header" width="700" height="214" border="0" usemap="#Map"></a>'
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//-->

function firstFocus() {
   // Sets the focus to a designated control object. All templates name the search box,
   // but some pages may also have a firstControl object that will override this.
   // This function is called from the body onload event.

	try{document.getElementById('searchBox').focus();} catch(e) {}
	try{document.getElementById('firstControl').focus();} catch(e) {}
   }


  function breadcrumbs(){
    sURL = new String;
    bits = new Object;
    names = new Object;
    var x = 0;
    var stop = 0;
    var output = "<A HREF=\"/cssac/\">CSSAC home</A> | ";

    var skipLastBit = 0;

    sURL = location.href;
    if (sURL.substr(0,13) == 'http://author') sURL = sURL.slice(30,sURL.length);
    else sURL = sURL.slice(23,sURL.length);
    chunkStart = sURL.indexOf("/");
    sURL = sURL.slice(chunkStart+1,sURL.length)

    while(!stop){
      chunkStart = sURL.indexOf("/");
      if (chunkStart != -1) {
          bits[x] = sURL.slice(0,chunkStart)
          names[x] = bits[x];
          switch (bits[x]) {
            case 'General_Information': names[x] = 'General Information'; break;
            case 'cssac':            names[x] = 'CSSAC'; break;
            case 'Employee_Relations':  names[x] = 'Employee Relations'; break;
            default:                    names[x] = bits[x]; break;
          }
          sURL = sURL.slice(chunkStart+1,sURL.length);
          if (sURL=='index.html' || sURL=='Welcome.html' || sURL=='') skipLastBit=1;
          
      }else{
        stop = 1;
      }
      x++;
    }

    for(var i in bits){
      if (!skipLastBit || i!=x-2) {
        output += '<A HREF="';
        for (y = 1; y < x - i; y++){
          output += '../';
        }
        output += bits[i] + '/">' + names[i] + '</A> | ';
      }
    }

    document.write(output + document.title);
}
function FP_jumpMenu(el,frm,sel) {//v1.0
 var href=el.options[el.selectedIndex].value; if(sel) el.selectedIndex=0;
 if('_new'==frm) open(href); else eval(frm+".location='"+href+"'");
}

//To use the printSpecial function:
//	1. Add a div tag around the printable range of code:
// 		<div id=printReady>  PRINTABLE RANGE   </div>
//	2. Add a hyperlink with href="javascript:void(printSpecial())"

function printSpecial()
{
 var gAutoPrint = true;        // Flag for whether or not to automatically call the print function
 var showCustomTitle = true;   // Flag for whether or not to print a special title for printable view
 if (document.getElementById != null)
 {
  var html = '<html>\n<head>\n';
  if (document.getElementsByTagName != null)
  {
   var headTags = document.getElementsByTagName("head");
   if (headTags.length > 0) html += headTags[0].innerHTML;
  }
  html += '\n</he' + 'ad>\n<bo' + 'dy>\n';
  
  if (showCustomTitle)
  {
   html += '<table width=100% height=100% cellpadding=0 cellspacing=0 border=0>\n';
   html += ' <tr height=14 valign=top>\n';
   html += '  <td align=right>Human Resource Services<br>\n';
   html += '    <a href=/cssac/>http://www.purdue.edu/cssac/</a></td>\n';
   html += ' </tr>\n';
   html += ' <tr height=* valign=top><td>\n\n';
  }

  var printReadyElem = document.getElementById('printReady');
  if (printReadyElem != null)
  {
   html += printReadyElem.innerHTML;
  }
  else
  {
   alert('Could not find the print ready section on this page.\nPlease use your browser\'s print function instead.');
   return;
  }

  if (showCustomTitle) {
    var d = new Date();
    var dateString = new String();
    dateString = (d.getMonth() * 1 + 1) + '/' + d.getDate() + '/' + d.getFullYear();
    html += '</td></tr>\n';
    html += '<tr><td>\n';
    html += '  <br><hr size=1 style=color:silver>\n';
    html += '  <a href="' + document.location + '">' + document.location + '</a><br>\n';
    html += '  ' + dateString;
    html += '</td></tr>\n';
    html += '</table>';
  }
  html += '\n</BO' + 'DY>\n</HT' + 'ML>';

  var printWin = window.open('','printSpecial','location=yes, toolbar=yes, status=yes, menubar=yes, resizable=yes, scrollbars=yes, fullscreen=no');
  printWin.document.open();
  printWin.document.write(html);
  printWin.document.close();
  if (gAutoPrint) printWin.print();
 }
 else
 {
  alert('Sorry, the printable view feature is not available for this browser.\nPlease use your browser\'s print function instead.');
 }
}
