var processedToolbar = 0;
var quickFindLinksURL = new Array();
var quickFindLinksTitle = new Array();
var quickFindLinksi=0;
function processToolbarold(whichone)
{
var a=1;
a=2;
}
function processToolbar(whichone)
{
 if (whichone == '0')
 {
  if (!processedToolbar)
  document.images.LCCToolbar.src = "/pics/toolbar16.jpg";
  processedToolbar = 1;
 }
 if (whichone == '1')
 {
  if (processedToolbar == 1)
  document.images.LCCToolbar.src = "/pics/toolbar21-off.gif";
  processedToolbar = 0;
 }
 if (whichone == '3')
  {
  if (!processedToolbar)
   {
   document.images.LCCToolbar.src = "/pics/toolbar16.jpg";
   processedToolbar = 1;
   }
  else
   {
   document.images.LCCToolbar.src = "/pics/toolbar21-off.gif";
   processedToolbar = 0;
   }
  }
}


function displaySendMsg(firstPart,secondPart,thirdPart,subject,displayStr,className)
{
var outputStr="";
if (className!="nameOnly")
 {
  outputStr+="<a href=\"";
//  outputStr+="ma";
//  outputStr+="il";
//  outputStr+="to:";
  if (className=="byProgram")
   {
   outputStr+="mailto:";
   }
  else
   {
  outputStr+="/scripts/staffinfo.exe?";
   outputStr+="mailto=";
   }
  outputStr+=firstPart;
  outputStr+="@";
  outputStr+=secondPart;
  outputStr+=".";
  outputStr+=thirdPart;
  if (subject!="")
  {
   outputStr+="?subject=";
   outputStr+=subject;
  }
  outputStr+="\"";
  if (className!="" && className!="byWeb" && className!="byProgram")
  {
   outputStr+=" class=\""+className+"\"";
  }
 if (className=="byProgram")
  {
  outputStr+=" style=\"font-size:10px\"";
  }
  outputStr+=">";
 }
 if (className!="nameOnly2")
 {
 if (className=="byProgram")
 {
 outputStr+="alternate: use default e-mail program";
 }
 else if (secondPart!="lowercolumbia" && secondPart!="lcc.ctc")
  {
   outputStr+=firstPart;
   outputStr+="@";
   outputStr+=secondPart;
   outputStr+=".";
   outputStr+=thirdPart;
  }
  else
  {
   outputStr+=displayStr;
   outputStr+="@";
   outputStr+="lowercolumbia";
   outputStr+=".";
   outputStr+="edu";
  }
 }
 else
 {
  outputStr+="EMAIL";
 }
 if (className!="nameOnly")
 {
  outputStr+="</";
  outputStr+="a>";
 }
document.write(outputStr);
}

function buildQuickFindLinksTable()
{
quickFindLinksi=0;
quickFindLinksTitle[quickFindLinksi]="A-Z List";
quickFindLinksURL[quickFindLinksi++]="http://lowercolumbia.edu/nr/exeres/BC73AB4B-1AF6-4E63-BF5C-792CCE2CF181";

quickFindLinksTitle[quickFindLinksi]="Advising";
quickFindLinksURL[quickFindLinksi++]="http://lowercolumbia.edu/nr/exeres/A5617AD6-78AC-4199-B8B2-556508CAAE35";

quickFindLinksTitle[quickFindLinksi]="ANGEL";
quickFindLinksURL[quickFindLinksi++]="https://angel.lcc.ctc.edu";

quickFindLinksTitle[quickFindLinksi]="Apply Online";
quickFindLinksURL[quickFindLinksi++]="http://lowercolumbia.edu/nr/exeres/DF992606-E1C7-4B32-9476-8D1D2F70EDB0";

quickFindLinksTitle[quickFindLinksi]="Arts & Entertainment";
quickFindLinksURL[quickFindLinksi++]="http://lowercolumbia.edu/nr/exeres/F8F0D9BA-305E-4E8F-8EC2-A70E427D991B";

quickFindLinksTitle[quickFindLinksi]="Bookstore";
quickFindLinksURL[quickFindLinksi++]="http://lowercolumbia.edu/nr/exeres/C587802F-5FB3-42A8-BA4D-CAA6D3B8234C";

quickFindLinksTitle[quickFindLinksi]="Class Schedule";
quickFindLinksURL[quickFindLinksi++]="http://lowercolumbia.edu/nr/exeres/B9A09900-A5CA-403A-8F4D-3B30801B48E8";

quickFindLinksTitle[quickFindLinksi]="Continuing Education";
quickFindLinksURL[quickFindLinksi++]="http://lowercolumbia.edu/nr/exeres/06E50F00-3125-4EED-AEF5-03D6E9801209";

quickFindLinksTitle[quickFindLinksi]="Course Catalog";
quickFindLinksURL[quickFindLinksi++]="http://lowercolumbia.edu/students/academics/catalog";

quickFindLinksTitle[quickFindLinksi]="Directory";
quickFindLinksURL[quickFindLinksi++]="http://lcc.ctc.edu/employees";

quickFindLinksTitle[quickFindLinksi]="E-mail";
quickFindLinksURL[quickFindLinksi++]="https://mail.lowercolumbia.edu/owa";

quickFindLinksTitle[quickFindLinksi]="Events Calendar";
quickFindLinksURL[quickFindLinksi++]="http://lcc.ctc.edu/calendar/";

quickFindLinksTitle[quickFindLinksi]="Fields of Study";
quickFindLinksURL[quickFindLinksi++]="http://lowercolumbia.edu/students/academics/fields-of-study/";

quickFindLinksTitle[quickFindLinksi]="Financial Aid";
quickFindLinksURL[quickFindLinksi++]="http://lowercolumbia.edu/nr/exeres/9A7709F7-D4B3-475C-B1A7-2566421D45BB";

quickFindLinksTitle[quickFindLinksi]="Foundation";
quickFindLinksURL[quickFindLinksi++]="http://lowercolumbia.edu/Common/lcc-foundation/";

quickFindLinksTitle[quickFindLinksi]="Getting Started";
quickFindLinksURL[quickFindLinksi++]="http://lowercolumbia.edu/nr/exeres/DF992606-E1C7-4B32-9476-8D1D2F70EDB0";

quickFindLinksTitle[quickFindLinksi]="Internal";
quickFindLinksURL[quickFindLinksi++]="http://lowercolumbia.edu/nr/exeres/B827EA21-5048-4EE5-A4EE-5FC8F8545E09";

quickFindLinksTitle[quickFindLinksi]="Jobs at LCC";
quickFindLinksURL[quickFindLinksi++]="http://lowercolumbia.edu/nr/exeres/4F77232E-3293-4BC5-885B-0E902E1CE00E";

quickFindLinksTitle[quickFindLinksi]="Kiosk";
quickFindLinksURL[quickFindLinksi++]="http://lowercolumbia.edu/nr/exeres/F130629E-0B3E-4B0B-A963-EB588CB0C748";


quickFindLinksTitle[quickFindLinksi]="Library";
quickFindLinksURL[quickFindLinksi++]="http://lowercolumbia.edu/nr/exeres/40D51AC4-17C4-403E-B49F-3AE4670D2616";

quickFindLinksTitle[quickFindLinksi]="Maps/Directions";
quickFindLinksURL[quickFindLinksi++]="http://lcc.ctc.edu/maps/";

quickFindLinksTitle[quickFindLinksi]="Online Learning";
quickFindLinksURL[quickFindLinksi++]="http://lowercolumbia.edu/lcconline";

quickFindLinksTitle[quickFindLinksi]="Registration";
quickFindLinksURL[quickFindLinksi++]="http://lowercolumbia.edu/students/student-kiosk/";

quickFindLinksTitle[quickFindLinksi]="Student Portal";
quickFindLinksURL[quickFindLinksi++]="https://lowercolumbia.edu/studentPortal";

quickFindLinksTitle[quickFindLinksi]="Tuition";
quickFindLinksURL[quickFindLinksi++]="http://lowercolumbia.edu/nr/exeres/9AD0AD17-3E15-43F9-A67A-ECADCC145534";

quickFindLinksTitle[quickFindLinksi]="Tutoring Services";
quickFindLinksURL[quickFindLinksi++]="http://lowercolumbia.edu/nr/exeres/2392A52F-0229-4421-BB8C-5F157446AF61";
}
function insertOption(objectId,toWhere,theValue,theText)
{
  if (document.getElementById(objectId).selectedIndex >= 0) {
    var elOptNew = document.createElement('option');
    elOptNew.text = theText;
    elOptNew.value = theValue;
    var elOptOld = document.getElementById(objectId).options[document.getElementById(objectId).selectedIndex];  
    try {
      document.getElementById(objectId).add(elOptNew, elOptOld); // standards compliant; doesn't work in IE
    }
    catch(ex) {
      document.getElementById(objectId).add(elOptNew, toWhere); // IE only
    }
  }
}

function displayQuickFindLinksTable(flag,objectId,adjustFlag)
{
var displayStr="";
var looper=0;
var objectSelection=null;
var objectSelectionNew=null;
for (looper=0;looper<quickFindLinksi;looper++)
{
 if (flag==0)
 {
 if (looper>0)
 displayStr+="<br>";
 displayStr+="<a style=\"font-size:11px;line-height:16px\" href=\""+quickFindLinksURL[looper]+"\"> "+quickFindLinksTitle[looper]+"</a>";
 }
 if (flag==1)
 {
document.getElementById(objectId).options[looper+adjustFlag] = new Option(quickFindLinksTitle[looper],quickFindLinksURL[looper]);
//insertOption(objectId,looper+adjustFlag,quickFindLinksURL[looper],quickFindLinksTitle[looper]);
 }
}
if (flag!=1)
document.write(displayStr);
if (flag==1)
document.getElementById(objectId).selectedIndex=0;
}

function hideContact(firstPart,secondPart,thirdPart,showStr,subjectStr,displayColor)
{
displayStr="<a href=\"http://lcc.ctc.edu/scripts/staffinfo.exe?contactCard="+firstPart+"@"+secondPart+"."+thirdPart;
if (subjectStr!="")
displayStr+="?subject="+subjectStr;
displayStr+="\"";
if (displayColor!="")
displayStr+=" style=\"color:"+displayColor+"\"";
displayStr+=">";
if (showStr=="")
displayStr+=firstPart+"@"+secondPart+"."+thirdPart;
else
displayStr+=showStr;
displayStr+="</a>";
document.write(displayStr);
}

function checkClear(flag,dateValue)
{
// flag
// 0 - clear if mm/dd/yyyy
// 1 - clear if filter text
switch (flag)
{
case 0:
if (dateValue.value=="mm/dd/yyyy")
dateValue.value="";
break;
case 1:
if (dateValue.value=="filter text")
dateValue.value="";
break;
}
}


function checkDate(flag,dateValue)
{
// flag
// 1 - make sure year is 4 digits
var returnVal=true;
var looper=0;
var checkMonth="";
var checkDate="";
var checkYear="";
var onPortion=0;
var returnStr="";
var tempStr="";
for (looper=0;looper<dateValue.value.length;looper++)
{
checkChar = dateValue.value.charAt(looper);
if (checkChar=='/')
{
onPortion++;
}
else
{
if (returnVal==true && ((checkChar<'0' || checkChar>'9') && checkChar!='/'))
returnVal=false;
if (returnVal!=false)
{
switch (onPortion)
{
case 0:
if (checkMonth.length>1) returnVal=false;
if (returnVal==true)
{
tempStr=checkMonth+checkChar;
if (returnVal==true && tempStr<1) returnVal=false;
if (returnVal==true && tempStr>12) returnVal=false;
if (returnVal==true) checkMonth=tempStr;
}
break;
case 1:
if (checkDate.length>1) returnVal=false;
tempStr=checkDate+checkChar;
if (returnVal==true && tempStr<1) returnVal=false;
if (returnVal==true && tempStr>30 && (checkMonth==4 || checkMonth==6 || checkMonth==9 || checkMonth==11)) returnVal=false;
if (returnVal==true && tempStr>31 && (checkMonth==1 || checkMonth==3 || checkMonth==5 || checkMonth==7 || checkMonth==8 || checkMonth==10 || checkMonth==12)) returnVal=false;
if (returnVal==true && tempStr>29 && checkMonth==2) returnVal=false;
if (returnVal==true) checkDate=tempStr;
break;
case 2:
if (checkYear.length>3) returnVal=false;
tempStr=checkYear+checkChar;
if (returnVal==true) checkYear=tempStr;
break;
}
}
}
}
if (flag==1 && checkYear.length>0 && checkYear.length<4) returnVal=false;
if (returnVal==false)
{
alert("Invalid date format entered.  Please use the following standard.\n\nmonth/date/year\nexample: 12/6/2007");
returnStr="";
dateValue.value=returnStr;
dateValue.focus();
}
}


function checkInput(flag, numberValue)
{
// flag
// 0 - numbers  only
// 1 - a-z,A-Z,0-9,space
// 2 - a-z,A-Z,0-9,space,' (apostrophe)
var returnVal=true;
var looper=0;
var checkMonth="";
var checkDate="";
var checkYear="";
var onPortion=0;
var returnStr="";
var tempStr="";
for (looper=0;looper<numberValue.value.length && returnVal==true;looper++)
 {
  checkChar = numberValue.value.charAt(looper);
 if (flag==0)
  {
  if (checkChar<'0' || checkChar>'9')
   {
   returnVal=false;
   }
  }
 if (flag==1)
  {
  if ((checkChar>='0' && checkChar<='9') || (checkChar>='a' && checkChar<='z')  || (checkChar>='A' && checkChar<='Z') || checkChar==' ')
   returnVal=true;
else
returnVal=false;
  }
 if (flag==2)
  {
  if ((checkChar>='0' && checkChar<='9') || (checkChar>='a' && checkChar<='z')  || (checkChar>='A' && checkChar<='Z') || checkChar==' ' || checkChar=='\'')
   returnVal=true;
else
returnVal=false;
  }
 if (returnVal==false)
  {
  if (flag==0)
   {
   alert("Invalid number format entered.  Please use only numbers.");
   }
  if (flag==1)
   {
   alert("Invalid value entered.  Please use only a-z,A-Z,0-9 and spaces.");
   }
  if (flag==2)
   {
   alert("Invalid value entered.  Please use only a-z,A-Z,0-9,space, or apostrophe.");
   }
  returnStr="";
  numberValue.value=returnStr;
  }
 }
}


function stopBotForm()
{
var looper;
var stopBotsAutoValue="";
for (looper=0;looper<2;looper++)
{
stopBotsAutoValue+=Math.round(Math.random()*9)+"";
}
document.write("<input type=\"hidden\" name=\"spambotCodeMaster\" value=\""+stopBotsAutoValue+"\">");
document.write("Please type <b>"+stopBotsAutoValue+"</b> into this box <input type=\"text\" name=\"spamBotCode\" value=\"\" size=5>");
document.write("&nbsp;<a href=\"JavaScript:alert('Unfortunately, some programmers like to write auto-bots that spider the web looking for forms to automatically submit information and spam sites.  This is a way to stop those bots.')\">Why?</a>");
}

