<!--
/*
window.onerror = handleError;

function handleError() {
	alert(window.url)
	return true;
}
*/
var win = null;

function logoff(strfrom)
{
	/*	Function:		logoff
		Purpose:		The purpose of this function is to logoff and redirect to the 
		                appropriate page/home

		Update Date:	Programmer:			Description:
	*/
	location.href = "http://www.empcheck.com/redir.asp?to=" + strfrom;
}	

function showpopup(strRefURL,strwidth,strheight)
{
	var newWindow = window.open(strRefURL,"WinPopup","width=" + strwidth + ",height=" + strheight + ",left=100,top=100,toolbar=no,location=no,menubar=no,status=no,resizable=no,scrollbars=yes")
}

/*-----------------------------The functions below are used for the Employer Popup Search----------------------------------------------------------*/
function SelectEmployer()
{
	strEmployer = document.frmEmpVerify.txtEmployer.value
	if (strEmployer.length > 0) {
		if (document.frmEmpVerify.hdSearch.value == 'Y') {
			ShowEmployerList(0)
		}
	}
}

function ShowEmployerList(bShow)
{
	strEmployer = document.frmEmpVerify.txtEmployer.value
	strRefURL = "../SelectEmployer.asp?Search=" + escape(strEmployer) + "&show=" + bShow
	//var newWindow = window.open(strRefURL,"WinEmployerSearch","width=600,height=350,left=100,top=100,toolbar=no,location=no,menubar=no,status=no,resizable=yes,scrollbars=yes")
	//newWindow.focus();
	var newWindow = doOpen(strRefURL,600,350,"WinEmployerSearch");
}
//--------------------------------------------Employer Popup Search------------------------------------------------------

/*-----------------------------The functions below are used for the USER Popup Search----------------------------------------------------------*/
function SelectUser(strType,bSocial)
{
	var strContact = ''
	strUser = document.frmEmpVerify.txtUser.value
	intPOS = strUser.indexOf("-")
	if (intPOS > 0) { 
		strContact = strUser.substr(intPOS + 1)
		strUser = strUser.substr(0,intPOS) 
	}
	if (strUser.length > 0) {
		if (document.frmEmpVerify.hdSearch.value == 'Y') {
			ShowUserList(0,strType,bSocial)
		}
	}
}

function ShowUserList(bShow,strType,bSocial)
{
	var strContact = ''
	strUser = document.frmEmpVerify.txtUser.value
	intPOS = strUser.indexOf("-")
	if (intPOS > 0 && strType == 'Verifier') { 
		strContact = strUser.substr(intPOS + 1)
		strUser = strUser.substr(0,intPOS) 
	}		
	if (strType == 'Verifier' || strType == 'Employee') {
		strRefURL = "../SelectUser.asp?Search=" + escape(strUser) + "&show=" + bShow + "&Type=" + strType  + "&contact=" + escape(strContact) + "&social=" + bSocial
		//var newWindow = window.open(strRefURL,"WinUserSearch","width=600,height=350,left=100,top=100,toolbar=no,location=no,menubar=no,status=no,resizable=yes,scrollbars=yes")
		//newWindow.focus();
		var newWindow = doOpen(strRefURL,600,350,"WinUserSearch");

	}
}
//--------------------------------------------USER Popup Search------------------------------------------------------



function printit(){
/*for browser printing...currently not using....just using window.print() instead*/
   if (navigator.appVersion.indexOf("MSIE")!=-1){
       var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
	   document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
       WebBrowser1.ExecWB(6, 1); //Use a 1 vs. a 2 for a prompting dialog box
       WebBrowser1.outerHTML = "";
   }
   else	{
		window.print() ;
   }
}

var bSetfocus = true

function StayOnTOp()
{
	if (bSetfocus) { 
		self.focus();	
	}
	else	{
		self.close()
	}
}

function printme()
{
	bSetfocus = false;
	window.print(); 
}

function email()
{
	bSetfocus = false;
	window.open("../email.asp","EmailPopup","width=500,height=590,left=200,top=150,toolbar=no,location=no,menubar=no,status=no,resizable=no,scrollbars=no")
}

function genPDF()
{
	bSetfocus = false;
	window.open("../pdf.asp")
}


function SortBy(SortByField,strFormName,straction)
{
    if( SortByField != lastcol )
	{
        lastseq = 'Asc';
        lastcol = SortByField;
    }
    else
    {
        if( lastseq == 'Asc') lastseq = 'Desc'; else lastseq = 'Asc';
    }
    eval(strFormName + '.hdSortOrder').value = lastseq;
	eval(strFormName + '.hdSortBy').value = SortByField;
	eval(strFormName).action = straction;
	eval(strFormName).submit();
}

function fnShowNotes(strVal,strType)	{
	if (strVal.length == 0){
		alert("Please enter a value");
		return;
	}
	else {
		if (strVal.indexOf("-") != -1) {
			var strVal = strVal.substring(0, strVal.indexOf("-"));
		}
	}	
	strRefURL = "Notes.asp?type=" + strType + "&user=" + strVal;
	var newWindow = window.open(strRefURL,"winUserNotes","width=500,height=600,left=100,top=100,toolbar=no,location=no,menubar=no,status=no,resizable=no,scrollbars=yes")
}

// In this example we use a wrapper function doOpen() for 
// window.open in order to promote reuse of this
// solution whereever a popup window may be needed.

function doOpen(url,strwidth,strheight,strwinname)
{
// attempt to open the popup
strleft = 100
strtop = 100
if (url == 'popup.html') {
	strleft = 1100
	strtop = 100
}
	
win = window.open(url, strwinname, "width=" + strwidth + ",height=" + strheight + ",left=" + strleft + ",top=" + strtop + ",toolbar=no,location=no,menubar=no,status=no,resizable=no,scrollbars=yes");

if (win)
{
    // popup successfully created
    if (!win.closed){win.focus();}
}
else
{
    // popup was not created.
    showPopupMessage(url);
}
return win;
}

function showPopupMessage(url)
{
if (!document.createElement)
{
return;
}

var elmDiv = document.createElement('div');

if (typeof(elmDiv.innerHTML) != 'string')
{
return;
}

elmDiv.id  = 'popupmessage';
elmDiv.style.cssText = 
    'position: absolute; left: 600px; top: 150px;' +
    'width: 200px;' +
    'color: #333333; ' +
    'background-color: white; ' +
    'font-family: Arial, Helvetica, sans-serif;font-weight: bold;font-size: 12px; ' +
    'border: solid red 3px; ' +
    'padding: 1em;';

var html = 'You have popup suppression enabled ' + 
    'which prevents our site from working properly. ' +
    'Please place our site in your popup suppression ' +
    'whitelist  ' +
    '<p align="center">' +
    'Many links within this site open pages as Pop-Ups.' +
    'If you are experiencing difficulties in opening ' +
    'links, you may have a “pop-up blocker” program '+
    'installed on your computer that disables this '+
    'feature. Please disable or change your '+ 
    'preference so that you can fully enjoy '+
    'the functionality of this site'+
    '<p align="center">' +
    '<a href="#" onclick="hidePopupMessage(); return false;">Close this message<\/a>' +
    '<\/div>';

document.body.appendChild(elmDiv);
elmDiv.innerHTML = html;
}

function hidePopupMessage()
{
var elmDiv = document.getElementById('popupmessage');
if (elmDiv)
{
    elmDiv.parentNode.removeChild(elmDiv);
}
}
//----------------------------------------------------------------
-->