<!-- Hide from old browsers
// Javascript Functions for CheckView.
// Copyright (C) 1998, Pacific CodeWorks, inc, unless otherwise noted
// $Id: functions.js,v 1.4 2007/08/17 04:33:25 robt Exp $ - $Date: 2007/08/17 04:33:25 $
function PopIt(label, msg)
{
  // Set up Page Colors & Table
  var s1 = 
    "<TITLE>Information!</TITLE>" +
    "<BODY BGCOLOR='ffffff'><TABLE BORDER=0><TR>" +
	"<TD WIDTH=90% HEIGHT=90 VALIGN=TOP ALIGN=LEFT>"+
	"<FONT SIZE=4>"
  

  var s2 = "<FONT COLOR='FF0000'><B>"+label+"</B></FONT><P>"
 

  var s3 =   
    "</TD><TD WIDTH=10%> </TD></TR><TR><TD> </TD>"+
    "<TD VALIGN=TOP ALIGN=RIGHT>"+
    "<FORM><INPUT TYPE='BUTTON' VALUE='OK'" +
		   "onClick='self.close()'>"  +
    "</FORM></TD></TR></TABLE></BODY>"

 
  popup = window.open("","popDialog","height=200,width=300,scrollbars=no")
  popup.document.write(s1+s2+msg+s3)
  popup.document.close()
}

function do_error_js(msg, tgt, mod, query_string)
{
  // Set up Page Colors & Table
  var s1 = 
    "<TITLE>Information!</TITLE>" +
    "<BODY BGCOLOR='ffffff'><TABLE BORDER=0><TR>" +
	"<TD WIDTH=90% HEIGHT=90 VALIGN=TOP ALIGN=LEFT>"+
	"<FONT SIZE=4>"
  

  var s2 = "<FONT COLOR='FF0000'><B>Error: </B></FONT><P>"

  var s3 = "<FONT COLOR='000000'>" + 
		"<P><B>Query type was: </B>"+query_string+"<P>" +
		"</FONT>"
 

  var s4 =   
    "</TD><TD WIDTH=10%> </TD></TR><TR><TD> </TD>"+
    "<TD VALIGN=TOP ALIGN=RIGHT>"+
    "<FORM><INPUT TYPE='BUTTON' VALUE='OK'" +
		   "onClick='self.close()'>"  +
    "</FORM></TD></TR></TABLE></BODY>"

 
  do_err_pop = window.open("","do_err_Dialog","height=200,width=300,scrollbars=no")
  do_err_pop.document.write(s1+s2+msg+" "+tgt+" "+mod+s3+s4)
  do_err_pop.document.close()
}
// A slightly more generic version of do_error_js - no 
// query_string required.
function do_error_sm(msg, tgt, mod)
{
  // Set up Page Colors & Table
  var s1 = 
	"<html>" +
	"<head>" +
	"<TITLE>Information!</TITLE>" +
	"<link rel='StyleSheet' href='/checkview/stylesheets/main_cis.css' title='PCW'>" +
	"</head>" +
	"<BODY BGCOLOR='ffffff'><TABLE BORDER=0><TR>" +
	"<TD WIDTH=90% HEIGHT=90 VALIGN=TOP ALIGN=LEFT>"+
	"<FONT SIZE=4>"
  

  var s2 = "<FONT COLOR='FF0000'><B>Error: </B></FONT><P>"

  var s3 =   
    "</TD><TD WIDTH=10%> </TD></TR><TR><TD> </TD>"+
    "<TD VALIGN=TOP ALIGN=RIGHT>"+
    "<FORM><INPUT TYPE='BUTTON' VALUE='OK'" +
		   "onClick='self.close()'>"  +
    "</FORM></TD></TR></TABLE></BODY></html>"

 
  do_err_pop = window.open("","do_err_Dialog","height=200,width=300,scrollbars=no")
  do_err_pop.document.write(s1+s2+msg+" "+tgt+" "+mod+s3)
  do_err_pop.document.close()
}

function logoff(user)
{
	auths = new Array();
	auths[0] = "returns";
	auths[1] = "edit";
	auths[2] = "system";
	auths[3] = "account";
	auths[4] = "admin";
	auths[5] = "query";
	auths[6] = "prints";
	auths[7] = "sysadm";
	auths[8] = "multi";
	auths[9] = "large";
	auths[10] = "passwd";
	auths[11] = "$AUTH"; // handle an off by one problem

	for (i = 0; i < auths.length; i++)
	{
		tgt = auths[i];
		if (getCookie(tgt) != null)
		{
			delCookie(tgt);
		}
	}

	delCookie(user);
}

function blogoff(bank)
{
	aba = new Array();
	aba[0] = "ABA";
	auths[1] = "pad"; // handle an off by one problem

	for (i = 0; i < aba.length; i++)
	{
		tgt = aba[i];
		if (getCookie(tgt) != null)
		{
			delCookie(tgt);
		}
	}

	delCookie(bank);
}

/*
** validate input - we can add other categories to make this
** a generic validation function.
*/
function validate(tgt, frm, cat, string)
{
	if (cat == "blank")
	{
		if (tgt.value == "")
		{
			alert("Please supply " + string);
			return;
		}
	}

	frm.submit();

	
	
}
//end hiding -->
