function EmbedSWF(swf,w,h,id,flshVer){	flshVer = (!flshVer) ? 8 : flshVer;	document.write('<div id="swfDIV_'+id+'" style="display:none"><object id="'+id+'" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+flshVer+',0,0,0" width="'+w+'" height="'+h+'" align="middle">');	document.write('<param name="allowScriptAccess" value="always" />');	document.write('<param name="movie" value="'+swf+'" />');	document.write('<param name="quality" value="high" />');	document.write('<param name="bgcolor" value="#000000" />');	document.write('<param name="menu" value="false"/>');	document.write('<param name="wmode" value="transparent"/>');	document.write('<embed wmode="transparent" SWLIVECONNECT=true menu=false id="'+id+'"  src="'+swf+'" quality="high" bgcolor="#000000" width="'+w+'" height="'+h+'" name="bottom" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');	document.write('</object></div>');	document.getElementById("swfDIV_"+id).style.display="inline";	document.getElementById("swfDIV_"+id).id = "SWF_Embedded";}function html_SWF(swf,w,h,flshVer){	flshVer = (!flshVer) ? 8 : flshVer;	str = "";	str = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+flshVer+',0,0,0" width="'+w+'" height="'+h+'" align="middle">';	str += '<param name="allowScriptAccess" value="always" />';	str += '<param name="movie" value="'+swf+'" />';	str += '<param name="quality" value="high" />';	str += '<param name="bgcolor" value="#000000" />';	str += '<param name="menu" value="true"/>';	str += '<param name="wmode" value="transparent"/>';	str += '<embed wmode="transparent" SWLIVECONNECT=true menu=true src="'+swf+'" quality="high" bgcolor="#000000" width="'+w+'" height="'+h+'" name="bottom" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';	str += '</object>';	return str; }function RequireNumber(frmFld,sMsg){	if(isNaN(frmFld.value))	{		alert(sMsg);		frmFld.value="";		frmFld.focus();	}	return;}function SpawnUtilityChild(url){ SpawnChild(url,450,500); }function SpawnChild(url,w,h){	win=open(url,'win'+w+h,'width='+w+',height='+h+',scrollbars=yes,resizable=yes,menubar=no,titlebar=no,toolbars=no,status=no');	win.focus();}if(window.opener){ window.focus();}function InfopopUp(URL) {	day = new Date();	id = day.getTime();	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=300,height=300,left = 650,top = 450');");}function PopupWindow(page, width, height, windowName, allowScrolling, useModal) {  scrollFlag     = (allowScrolling) ? "yes" : "no"; openParameters = "width="+width+",height="+height+",resizable=yes,scrollbars="+scrollFlag+",menubars=no,toolbar=yes,directories=no"; funcWindow = window.open(page, windowName, openParameters); return funcWindow;} function Redirect(URL){  if(URL != "") {   window.location.href=URL; }}function GetCookie(cookieName) {   search = cookieName + "="   if (document.cookie.length > 0)   {    offset = document.cookie.indexOf(search)     if (offset != -1)    {      offset += search.length;      end = document.cookie.indexOf(";", offset);      if (end == -1) { end = document.cookie.length; }      cookieValue = unescape(document.cookie.substring(offset, end))      return cookieValue    }     else { return ""; }   }}function setCookie(cookieName, cookieValue, cookieLife){   expirationDate = new Date();   if(cookieLife == null || cookieLife != -1)   {    cookieLife = 365*86400000;    expirationDate.setTime(expirationDate.getTime() + cookieLife);    document.cookie = escape(cookieName) + "=" + escape(cookieValue) + ";expires=" + expirationDate.toGMTString() + ";path=/";   }   else   {    document.cookie = escape(cookieName) + "=" + escape(cookieValue) + ";path=/";   }}  function FormatMoney(num,wantDollarSign) {   tensCount = 1;   money     = "";   num       = (num+"").replace(/\$|\,/g,"");   numArr    = num.split(".");   // dollars   if(numArr[0].length > 3){    for(x=numArr[0].length-1;x>=0;x--)    {      if(tensCount == 3 && x != 0){ comma = ","; tensCount = 0;} else { comma = ""; }      money = comma + numArr[0].substr(x,1) + money;  	  tensCount++;    }   }   else { money=numArr[0]; }   // cents   if(numArr[1]){money += "." + numArr[1].substr(0,2); }     // dollar sign?   if(wantDollarSign) { money = "$"+money; }     return money; }function IsDigit(){   return ( (event.keyCode >= 48) && (event.keyCode <= 57) || (event.keyCode ==46)); }// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//// NOTE: Only for JS 1.2 + //// api_DateTime.asp //// author   : Jason M. Barnett <barnett@unext.com>// // what?    : this script has all functions that have to do with calculating, manipulating,//            or figuring out date and/or time stuff.// // sections ://   SECTION I  = Global Variables//   SECTION II = Date / Time Functions//// created  : 3/31/00// updated  : 5/20/01//// notes    : 3/31/00 JMB - finished writing comments for all functions.//// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++////// SECTION I // --------- ////// //////////////////////////////////////////////////////////////////////////////////////////////////// Global Variables//// These are variables that are global to any script if this file is included.// // // ////////////////////////////////////////////////////////////////////////////////////////////// // --> days of the week [index 0..6] // var days   = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"); // --> name of months [index 1..12] // var months = new Array("","January","February","March","April","May","June","July",                        "August","September","October","November","December");////// SECTION II// ----------////// //////////////////////////////////////////////////////////////////////////////////////////////////// Date / Time  Functions// // These functions are specifically for Dates or Time manipulation or computation.////// //////////////////////////////////////////////////////////////////////////////////////////////// FUNCTION ************************************************************************************//// GetDaysBetweenDates//// Returns the number of days between two dates...//// Input  : fromDate [date object], toDate [date object]//// Output : numberOfDays [integer]//// *********************************************************************************************ffunction GetDaysBetween(fromDate,toDate){  if(!fromDate) { fromDate = new Date(); }  if(!toDate)   { toDate   = new Date(); }  Milliminutes = 1000 * 60;  Millihours   = Milliminutes * 60;  Millidays    = Millihours * 24;  funcFromDate      = Date.parse(fromDate);  funcToDate        = Date.parse(toDate);  differenceInDates = funcFromDate - funcToDate;  return Math.round( differenceInDates / Millidays );}// FUNCTION ************************************************************************************//// GetDateByDayOffset//// Returns the date of Date + n days...//// Input  : fromDate [date object], days [integer]//// Output : funcDate [date object]//// *********************************************************************************************ffunction GetDateByOffset(fromDate, numberOfDays){  if(!numberOfDays) { numberOfDays = 0; }  if(!fromDate || fromDate == "undefined" || fromDate == "null")  {   fromDate = new Date();  }  else  {    fromDate = new Date(fromDate);  }  Milliminutes = 1000 * 60;  Millihours   = Milliminutes * 60;  Millidays    = Millihours * 24;  funcDate     = Date.parse(fromDate) + (Millidays * numberOfDays);  return (new Date(funcDate));  }// FUNCTION ************************************************************************************//// MakeNiceDate//// Returns the date in nice format, MM/DD/YYYY where "/" is specified....//// Input  : inputDate [date object], delimiter [string]//// Output : funcDate [string]//// *********************************************************************************************ffunction MakeNiceDate(inputDate, delimiter){  if(!delimiter) { delimiter = "/"; }  inputDate = new Date(inputDate);  funcDate = (inputDate.getMonth() + 1) + delimiter +              inputDate.getDate()        + delimiter +              inputDate.getFullYear();  return funcDate;}// FUNCTION ************************************************************************************//// MakeNiceTime//// Returns the time in nice format, HH:MM AM/PM where ":" is specified....//// Input  : inputTime [date object], delimiter [string]//// Output : funcTime [string]//// *********************************************************************************************ffunction MakeNiceTime(inputTime, delimiter){  if(!delimiter) { delimiter = ":"; }  inputTime = new Date(inputTime);  H    = (inputTime.getHours() > 12)  ? inputTime.getHours()-12 : inputTime.getHours();  SUFF = (inputTime.getHours() >= 12) ? " pm" : " am";  M    = (inputTime.getMinutes() <10) ? "0"+inputTime.getMinutes() : inputTime.getMinutes();    funcTime = H + delimiter + M + SUFF;  return funcTime;}// FUNCTION ************************************************************************************//// MinutesToTime//// Converts an input of minutes from midnight to a "readable" time object. The object has// hours in obj.h and minutes in obj.m//// Input  : inputMinutes [integer]//// Output : Time [object]//// *********************************************************************************************ffunction MinutesToTime(inputMinutes){    funcTime = new Object(); hours    = Math.floor(inputMinutes / 60); minutes  = inputMinutes - (hours * 60); if (minutes < 10) { minutes = '0' + minutes; } if (hours > 12)   { hours  -= 12;            } if (hours < 10)   { hours   = '0' + hours;   } funcTime.hours   = hours; funcTime.minutes = minutes; return (funcTime);}// FUNCTION ************************************************************************************//// PrintNiceTime//// Takes minutes from midnight and returns a string of "nice" time format eg. "3:03 am"//// Input  : inputMinutes [integer]//// Output : "nice" Time [string]//// *********************************************************************************************function PrintNiceTime(inputMinutes){  if(parseFloat("0"+inputMinutes) == 0){return "";}  suffix = "";  tyme   = MinutesToTime(inputMinutes);  if(inputMinutes >= 720) { suffix = " pm"; }  else                   { suffix = " am"; }  return funcTime.hours + ":" + funcTime.minutes + suffix;}// FUNCTION ************************************************************************************//// TimeToMinutes//// Takes pretty-time and converts to minutes past midnight//// Input  : strTime [string]//// Output : minutes [integer]//// *********************************************************************************************function TimeToMinutes(strTime){  if(strTime == "") { return ""; }  timeArr = strTime.split(":");  hours   = parseFloat("0"+timeArr[0]);  timeArr = timeArr[1].split(" ");  minutes = parseFloat("0"+timeArr[0]);  if(timeArr[1].indexOf("pm") > -1) { hours += 12; }   minutes = minutes + (hours * 60);  return minutes;}// FUNCTION ************************************************************************************//// TimeSelectionList//// Just a wrapper around GetTimeSelectionList to allow for ?:?? am as values...//// Input  : selName [string], interval [integer], , selectedTime [string], onchange [string], //          firstOptText [string], firstOptValue [string]//// Output : timeList [string]//// NOTE : Interval must be in minutes.//// *********************************************************************************************function TimeSelectionList(selName,interval,selectedTime,onchange,firstOptText,firstOptValue,size,options){  selectedTime = TimeToMinutes(selectedTime);  return GetTimeSelectionList(selName,interval,'',1200,selectedTime,onchange,firstOptText,firstOptValue,true,size,options);}// FUNCTION ************************************************************************************//// GetTimeSelectionList//// Takes 3 optional params and returns HTML for a select list with time...//// Input  : selName [string], interval [integer], startTime [integer], endTime [integer], //          selectedTime [integer], onchange [string], firstOption [string], timeAsValue [boolean]//// Output : timeList [string]//// NOTE : Interval must be in minutes.//// *********************************************************************************************function GetTimeSelectionList(selName,interval,startTime,endTime,selectedTime,onchange,firstOptText,firstOptValue,timeAsValue,size,options){  interval  = (interval!="" || interval) ? interval : 30;  startTime = (startTime) ? startTime : 360;  endTime = (endTime) ? endTime : 1080;  onchange  = (onchange != "") ? 'onchange"'+onchange+'"' : '';  size      = (size) ? size : 1;   timeList  = '<select name="'+selName+'" size="'+size+'"' + onchange + ' '+options+'>';  timeList += (firstOptText != "") ? '<option value="'+firstOptValue+'">'+firstOptText+'</option>' : '';  // --> from start to finish...  //  for(currTime = startTime; currTime <= endTime; currTime += interval)  {    if(selectedTime == currTime) { selected = "selected"; }     else                         { selected = "";         }    if(timeAsValue) { timeList += '<option ' + selected + ' value="'+ PrintNiceTime(currTime) + '">'; }    else            { timeList += '<option ' + selected + ' value="'+ currTime + '">';                }    timeList += '&nbsp;' + PrintNiceTime(currTime) + '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</option>';  }     return timeList + '</select>';}// FUNCTION ************************************************************************************//// GetWeekDayId//// Returns the day id [integer] of the specific day. eg. 2 => Tuesday//// Input  : inputDate [string or object]//// Output : day id [integer]//// *********************************************************************************************function GetWeekDayId(inputDate) { if(typeof(inputDate) == "string") {  dateArray = inputDate.split('/');  month     = dateArray[0];  day       = dateArray[1];  year      = dateArray[2];  funcDate   = new Date(year,month-1,day); }  else  {  funcDate   = new Date(inputDate); }  return funcDate.getDay();}// FUNCTION ************************************************************************************//// GetToday//// Returns to days date in string format MM/DD/YYYY//// Input  : none//// Output : date [string]//// *********************************************************************************************function GetToday(){ today = new Date(); month = today.getMonth() + 1; day   = today.getDate(); year  = today.getFullYear(); return month + '/' + day + '/' + year;;}// FUNCTION ************************************************************************************//// GetCurrentTime//// Gets current time (server side, so the time on the server /CINCY/) and returns it in minutes// past 12:00 midnight//// Input  : none//// Output : minutes [integer]//// *********************************************************************************************function GetCurrentTime(){ today   = new Date(); hours   = today.getHours(); minutes = today.getMinutes(); return hours * 60 + minutes;}// FUNCTION ************************************************************************************//// IsDateDigit & ValidateDate//// Validates dates (usually onblur and onkeypress)//// Input  : oField [object]//// Output : alert &/| boolean//// *********************************************************************************************fvar iSlashCount = 0;function IsDateDigit(oField){   iSlashCount = (oField.value.split("/")).length-1;  iRangeStart = (iSlashCount >= 2) ? 48 : 47;  return ( (event.keyCode >= iRangeStart) && (event.keyCode <= 57) ); }function ValidateDate(sValue,oField){   oToday  = new Date();  sValue +="";  if(sValue == "") return;  aValue = sValue.split("/");    if(aValue.length != 3)  {    if(sValue.length<4)    {     alert("OOPS!\nYour date is in the incorrect format. It must be in this format:\n\n\tMM/DD/YYYY");     oField.select();    }    else    {      if(sValue.length>=6)      {        sValue = sValue.substr(0,2)+"/"+sValue.substr(2,2)+"/"+((sValue.substr(4)<100) ? "20"+sValue.substr(4) : sValue.substr(4));        ValidateDate(sValue,oField);      }      else      {        alert("OOP!\nThis nifty program can't figure out the date.\n\nTry these formats:\n\tMM/DD/YYYY\n\tMMDDYY");        oField.select();      }    }  }  else  {    if(aValue[0] > 12 || aValue[0] < 1)    {      alert("OOPS.\nThe month is incorrect. 1 - 12 please.\n\nTry again.");      oField.select();      return false;    }    if(aValue[1] > 31 || aValue[1] < 1)    {      alert("OOPS.\nThe day is incorrect. 1 - 31 please.\n\nTry again.");      oField.select();      return false;    }    aValue[2] = (aValue[2]<100) ? "20"+aValue[2] : aValue[2];    if(aValue[2] < oToday.getFullYear())    {      alert("OOPS.\nThe year is incorrect. "+oToday.getFullYear()+" and later.\n\nTry again.");      oField.select();      return false;    }    oFieldDate = new Date(aValue[0]+"/"+aValue[1]+"/"+aValue[2]);    if( GetDaysBetween(oFieldDate,oToday) < -1 )    {      alert("OOPS.\nYou cannot make something due in the past!\n\nToday is "+MakeNiceDate(oToday)+".\n\nTry again.");      oField.value = MakeNiceDate(oToday);      oField.select();    }  }  oField.value=sValue;}// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//// api_Forms.js//// These are CLIENTSIDE JavaScript functions that help us validate forms and other common form// functions.//// sections : //   SECTION I   = Validation Functions//   SECTION II  = Selection List Functions//   SECTION III = Miscellaneous Functions//// created  : 02.14.00// updated  : 02.14.00//// notes    : 2/14/00 JMB - Today i started the commenting standard...////// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++////// SECTION I ////// ////////////////////////////////////////////////////////////////////////////////////////////////// Validation Functions//// These functions validate forms or form fields...//////// //////////////////////////////////////////////////////////////////////////////////////////////// FUNCTION *************************************************************************************//// ValidateAllTextFields//// This function validates all fields that require values, except Hidden fields and// whatever names of fields specified in the comma-delimited string passed as exceptFields// The function, if all fields are validated, can possibly pass on to doOtherFunction which// is the functin name of another function to call after you validate the form...//// * NOTE : to be able to use this function with passing exceptFields, the user must be using//          a browser that can handle JavaScript 1.2..... ex: NS4+ and IE4+//// input  : form [object], alertMessage [string], exceptFields [comma delimited string],//          doOtherFunction [function name]//// output : true/false [boolean]//// **********************************************************************************************function ValidateAllTextFields(form, alertMessage, exceptFields, doOtherFunction){ // --> initialize variables... // exceptFieldArray = new Array(); notValid         = false; if(exceptFields != "" && esceptFields) {  exceptFieldArray = exceptFields.split(','); } // --> go through each form element and array element.. // for(elementPosition = 0; elementPosition < form.length; elementPosition++){  for(arrayPosition = 0; arrayPosition < exceptFieldArray.length; arrayPosition++)  {    if(form.elements[elementPosition].name.indexOf(exceptFieldArray[arrayPosition]) != -1)    {     notValid = true;     break;    }    else{ notValid=false; }  }        if(form.elements[elementPosition].type != 'hidden' &&      form.elements[elementPosition].value == "" && !notValid)  {    alert(alertMessage);    form.elements[elementPosition].focus();    return false;  } } if(doOtherFunction) {  return doOtherFunction(form); } else{ return true; }}////// SECTION II////// ////////////////////////////////////////////////////////////////////////////////////////////////// Selection List Functions//// These functions manipulate selection list(s)...//////// //////////////////////////////////////////////////////////////////////////////////////////////// FUNCTION *************************************************************************************//// MoveItems//// This function moves an item from one (muli)selection list to another list...//// input  : fromList [selection list object], toList [selection list object]//// output : none//// **********************************************************************************************function MoveItems(fromList, toList){ for(fromPosition = 0; fromPosition < fromList.options.length; fromPosition++) {  if(fromList.options[fromPosition].selected == 1)  {   AddItem(fromList.options[fromPosition].text,fromList.options[fromPosition].value,toList);  } }  RemoveListItems(fromList);}// FUNCTION *************************************************************************************//// CopyItems//// This function copies an item from one (muli)selection list to another list...//// input  : fromList [selection list object], toList [selection list object]//// output : none//// **********************************************************************************************function CopyItems(fromList, toList){ for(fromPosition = 0; fromPosition < fromList.options.length; fromPosition++) {  if(fromList.options[fromPosition].selected == 1)  {   AddItem(fromList.options[fromPosition].text,fromList.options[fromPosition].value,toList);   fromList.options[fromPosition].selected = 0;  } } }// FUNCTION *************************************************************************************//// AddItem//// This function adds an item from one (multi)selection list to another...//// input  : itemText [string], itemValue [string/number], toList [selection list object]//// output : none//// **********************************************************************************************function AddItem(itemText,itemValue,toList,selected){ addIt = true; for(toPosition=0; toPosition < toList.options.length; toPosition++) {  // --> here we check to see if value already in list, if it is, you don't add it...  //  if(toList.options[toPosition].value == itemValue && toList.options[toPosition].text == itemText)  {     addIt = false;     break;  } } if(addIt) {   toPosition = toList.options.length;   toList.options.length++;    toList.options[toPosition]       = new Option();   toList.options[toPosition].text  = itemText;   toList.options[toPosition].value = itemValue;   if(selected) toList.options[toPosition].selected = true; }}function remove_item(list,idx)   // remove item number idx from list{   for(i=idx;i<list.options.length-1;i++)  {    list.options[i].value=list.options[i+1].value;    list.options[i].text =list.options[i+1].text;  }  list.options.length--;}// FUNCTION *************************************************************************************//// RemvoeListItems//// This function removes an item from a selection list...//// input  : list [selection list object]//// output : none//// **********************************************************************************************function RemoveListItems(list){ listValue   = new Array();  listText    = new Array();  newPosition = -1; for(listPosition = 0; listPosition < list.options.length; listPosition++) {  if(list.options[listPosition].selected == 0)  {    newPosition++;    listValue[newPosition] = list.options[listPosition].value;    listText[newPosition]  = list.options[listPosition].text;  } } list.options.length = 0; for(listPosition = 0; listPosition <= newPosition; listPosition++) {  list.options.length++;   list.options[listPosition]       = new Option();  list.options[listPosition].text  = listText[listPosition];  list.options[listPosition].value = listValue[listPosition]; }}// FUNCTION *************************************************************************************//// RemvoeAll//// This function removes all items from a selection list...//// input  : list [selection list object]//// output : none//// **********************************************************************************************function RemoveAll(list){ list.options.length = 0;}// FUNCTION *************************************************************************************//// SelectAll//// This function selects all items in a selection list...//// input  : list [selection list object]//// output : none//// **********************************************************************************************function SelectAll(list){  list.multiple = true; for(listPosition = 0; listPosition < list.options.length; listPosition++) {   list.options[listPosition].selected = 1; }}// FUNCTION *************************************************************************************//// SelectItem//// This function selects an item in a selection list...//// input  : list [selection list object]//// output : none//// **********************************************************************************************function SelectItem(list,item){  for(listPosition = 0; listPosition < list.options.length; listPosition++) {    if(list.options[listPosition].value == item)   {    list.options[listPosition].selected = 1;   }   else   {    list.options[listPosition].selected = 0;   } }}////// SECTION III////// ////////////////////////////////////////////////////////////////////////////////////////////////// Miscellaneous functions//// These functions do miscellaneous things...//////// //////////////////////////////////////////////////////////////////////////////////////////////// FUNCTION *************************************************************************************//// ClearAllTextFields//// This function clears all text, and textarea fields in a form (does NOT clear HIDDEN fields)//// input  : form [object]//// output : none//// **********************************************************************************************function ClearAllTextFields(form){  for(elementPosition = 0; elementPostions < form.length; elementPosition++)  {    if(form.elements[elementPosition].type != 'hidden' &&        (form.elements[elementPosition].type == 'text' ||         form.elements[elementPosition].type == 'textarea'))    {      form.elements[elementPosition].value="";    }  }}// EOF;