// Array function...

function makeArray() {
var args=makeArray.arguments;
    for (var i=0; i < args.length; i++) {
    this[i]=args[i];
    }
this.length=args.length;
}

// This function determines which page is selected and goes to it...

function goPage(form) {
i=form.menu.selectedIndex;            
    if (i != 0) {
//    window.parent.location.href=urls[i];  
    parent.location.href=urls[i];  
    }
}

function goto_page(page){
   parent.location.href=page;
}

function set_progress_bar() {
   document.prog_bar.src=prog_bar_src;
   document.prog_bar.alt=prog_bar_alt;
}

function EvalCompleted() {
var comment_string;
var today=new Date();
var year=today.getYear();
var i;

      if (year < 1000 ) {year += 1900}; 
            document.EvalForm.date.value=(today.getMonth()+1)+"/"+today.getDate()+"/"+year;
     return true;
}


//cookie read-write functions

function setCookie(name, value, expires, path, domain, secure)
{
	
    document.cookie= name + "=" + escape(value) +
        ((expires) ? "; expires=" + expires.toGMTString() : "") +
        ((path) ? "; path=" + path : "") +
        ((domain) ? "; domain=" + domain : "") +
        ((secure) ? "; secure" : "");
}

function getCookieVal (offset) {
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
   endstr=document.cookie.length;
return unescape(document.cookie.substring(offset,endstr));
}

//function to return the value of the cookie specified by "name".

function getCookie (name) {

var arg = name+"=";
var alen = arg.length;
var clen = document.cookie.length;
var i=0;

while (i < clen) {
  var j=i+alen;
  if (document.cookie.substring (i,j) == arg)
    return getCookieVal(j);
  i=document.cookie.indexOf(" ",i)+1;
  if (i == 0) break;
}
return null;
}

function deleteCookie( name, path, domain ) {
  if ( getCookie( name ) ) document.cookie = name + "=" +
    ( ( path ) ? ";path=" + path : "") +
    ( ( domain ) ? ";domain=" + domain : "" ) +
    ";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}

function isNumberString (InString)  {
	if(InString.length==0) 
		return (false);
	RefString="1234567890";
	for (Count=0; Count < InString.length; Count++)  {
		TempChar= InString.substring (Count, Count+1);
		if (RefString.indexOf (TempChar, 0)==-1)  
			return (false);
	}
	return (true);
}

function cookietest() {
testValue=Math.floor(1000*Math.random());
setCookie('AreCookiesEnabled',testValue);
if (testValue==getCookie('AreCookiesEnabled')) 
     return null;
else 
     alert('You do NOT currently have cookies enabled in your browser.  If you do not have cookies enabled, you will not be able to complete and receive credit for this training. Please refer to your browser documentation for instructions on how to enable coookies, and please follow those instructions before proceeding with this program.');
}






