var isNav, isIE;

if (parseInt(navigator.appVersion.charAt(0)) >= 4){
  isNav = (navigator.appName == "Netscape") ? true : false;
//  isIE = (navigator.appName.indexOf("Microsoft" != -1)) ? true : false;
  isIE = (navigator.appName == "Microsoft Internet Explorer") ? true : false;
}
function trim (s) { 
     return s.replace(/^\s+|\s+$/g, ''); 
} 
function focusMe(evt){
      var e;
      if(isNav)
         e=evt.target;
      else if(isIE)
         e=event.srcElement;
      else
          return false;

      e.className="focusMe";
      if (e.type=="text")
            e.select();
}
function unfocusMe(evt){
      var e;
      if(isNav)
         e=evt.target;
      else if(isIE)
         e=event.srcElement;
      else
          return false;
      e.className="subheader";
}
var PWindow;
function ShowProgress()
  {
    //PWindow = null;
    //Sprogress=window.open('/oma/search/progress.html', 'PWindow','resizable=yes,width=350,height=200')
    //Sprogress.moveTo(screen.availWidth/2-200,screen.availHeight/2-100);
    //PWindow=Sprogress;
  }

function CloseProgress()
  {
    //window.open('', 'PWindow').close();
  }
function loadExaminersDetail(row_id)
{
    examinersDetail = null;
    examinersDetail=window.open('/oma/examinersEx/examinersDetail.php?row_id='+row_id, 'examinersDetail','toolbar=no,location=no,scrollbars=yes,resizable=yes,width=730,height=880')
    examinersDetail.moveTo(screen.availWidth/2-350,screen.availHeight/2-450);
}
  
function loadExaminersUpload(row_id){
    examiners = null;
    examiners=window.open('/oma/examinersEx/examinersUpload.php?new=true&row_id='+row_id, 'examiners','toolbar=no,location=no,scrollbars=yes,resizable=yes,width=700,height=400')
    examiners.moveTo(screen.availWidth/2-100,screen.availHeight/2-50);
}
function loadExaminersUploadFile(row_id)
{
    examinersUploadFile = null;
    examinersUploadFile=window.open('/oma/examinersEx/examinersUploadFile.php?row_id='+row_id, 'examinersUploadFile','toolbar=no,location=no,scrollbars=yes,resizable=yes,width=700,height=200')
    examinersUploadFile.moveTo(screen.availWidth/2-100,screen.availHeight/2-50);
}
function loadExaminersAutoComplete(row_id){
    examiners = null;
    examiners=window.open('/oma/examinersEx/examinersAutoComplete.php?row_id='+row_id, 'examinersAC','toolbar=no,location=no,scrollbars=yes,resizable=yes,width=700,height=200')
    examiners.moveTo(screen.availWidth/2-100,screen.availHeight/2-50);
}
function loadOnlineContinScreen()
  {
    contin = null;
    contin=window.open('/oma/search/continSearch.php?titlenum='+document.form1.titlenum.value, 'contin','toolbar=no,location=no,scrollbars=yes,resizable=yes,width=700,height=400')
    contin.moveTo(screen.availWidth/2-100,screen.availHeight/2-50);
  }
function loadFTLPopup(){
	FTL = null;
    FTL=window.open('/oma/search/FTL.html', 'FTL','toolbar=no,location=no,scrollbars=yes,resizable=yes,width=500,height=200')
    FTL.moveTo(screen.availWidth/2-100,screen.availHeight/2-50);
}
function loadInventoryDetailScreen(unkey)
  {
    InvDetail = null;
    InvDetail=window.open('/oma/search/inventoryDetailScreen.php?unkey='+unkey, 'InvDetail','toolbar=no,location=no,scrollbars=yes,resizable=yes,width=700,height=400')
    InvDetail.moveTo(screen.availWidth/2-100,screen.availHeight/2-50);
  }
function loadACRISBBL(county,block,lot){
	ACRIS = null; var f = new Date();
	uriString = "ACRIS.php?type=BBL&countyShort=" + county + "&block=" + block + "&lot=" + lot;
	//alert(uriString);
    ACRIS=window.open(uriString,'ACRIS'+ f.getHours() + f.getMinutes() + f.getSeconds(),'toolbar=yes,location=yes,scrollbars=yes,resizable=yes,width=700,height=500')
	ACRIS.moveTo(screen.availWidth/2-50,screen.availHeight/2-50);
}
function loadACRISName(county,firstName99,lastName99,type99){
	ACRIS = null; var f = new Date();
	uriString = "ACRIS.php?type="+type99+"&countyShort=" + county + "&firstName=" + firstName99 + "&lastName=" + lastName99 + "&type=" + type99;
	//alert(uriString);
    ACRIS=window.open(uriString,'ACRIS'+ f.getHours() + f.getMinutes() + f.getSeconds(),'toolbar=yes,location=yes,scrollbars=yes,resizable=yes,width=700,height=500')
	ACRIS.moveTo(screen.availWidth/2-50,screen.availHeight/2-50);
}
function loadNotifyWindow(outputLocation){
	notifyWindow = null; var f = new Date();
	uriString = "/oma/notify/notifyEmail.php?outputLocation="+outputLocation;
	//alert(uriString);
    notifyWindow=window.open(uriString,'notifyWindow'+ f.getHours() + f.getMinutes() + f.getSeconds(),'toolbar=no,location=no,scrollbars=yes,resizable=yes,width=700,height=400')
	notifyWindow.moveTo(screen.availWidth/2-50,screen.availHeight/2-50);
}
function loadMoreInfoWindow(why,titlenum,county,block,lot,add,name1,name2,name3,name4,name5,corp1,corp2){
	moreInfoWindow = null; var f = new Date();
	uriString = "/oma/search/emailMoreInfoWindow.php?why="+why+"&titlenum="+titlenum+"&county="+county+"&block="+block+"&lot="+lot+"&add="+add+"&name1="+name1+"&name2="+name2+"&name3="+name3+"&name4="+name4+"&name5="+name5+"&corp1="+corp1+"&corp2="+corp2;
	//alert(uriString);
    moreInfoWindow=window.open(uriString,'moreInfoWindow'+ f.getHours() + f.getMinutes() + f.getSeconds(),'toolbar=no,location=no,scrollbars=yes,resizable=yes,width=700,height=500')
	moreInfoWindow.moveTo(screen.availWidth/2-50,screen.availHeight/2-50);
}
function loadQuestionsComments(){
	moreInfoWindow = null; var f = new Date();
	uriString = "/oma/notify/questionsComments.php";
	//alert(uriString);
    moreInfoWindow=window.open(uriString,'moreInfoWindow'+ f.getHours() + f.getMinutes() + f.getSeconds(),'toolbar=no,location=no,scrollbars=yes,resizable=yes,width=700,height=500')
	moreInfoWindow.moveTo(screen.availWidth/2-50,screen.availHeight/2-50);
}
function loadCountyClerkRun(titlenum,county,block,lot){
	countyClerk = null; var f = new Date();
	uriString = "/oma/order/countyClerk.php?titlenum="+titlenum+"&county="+county+"&block="+block+"&lot="+lot;
	//alert(uriString);
    countyClerk=window.open(uriString,'countyClerk'+ f.getHours() + f.getMinutes() + f.getSeconds(),'toolbar=no,location=no,scrollbars=yes,resizable=yes,width=700,height=300')
	countyClerk.moveTo(screen.availWidth/2-50,screen.availHeight/2-50);
}
function loadStateUCC(name99,firstName99,type99){
	StateUCC = null; var f = new Date();
	if (type99 == "Individual"){
		uriString = "StateUCC.php?type99=I&lastName=" + name99 + "&firstName=" + firstName99;
	}else{
		uriString = "StateUCC.php?type99=C&corp=" + name99;
	}
	//alert(uriString);
    StateUCC=window.open(uriString,'StateUCC'+ f.getHours() + f.getMinutes() + f.getSeconds(),'toolbar=yes,location=yes,scrollbars=yes,resizable=yes,width=700,height=500')
	StateUCC.moveTo(screen.availWidth/2-50,screen.availHeight/2-50);
} 
function loadNameScanDetailsJDG(kyv,kyvsub,county){
	details = null; var f = new Date();
    details=window.open("nameScanDetailsJDG.php?kyv=" + kyv + "&kyvsub=" + kyvsub + "&county=" + county,'details'+ f.getHours() + f.getMinutes() + f.getSeconds(),'toolbar=no,location=no,scrollbars=yes,resizable=yes,width=700,height=500')
    details.moveTo(screen.availWidth/2-100,screen.availHeight/2-50);
}
function loadNameScanDetailsUCC(rowid,unkey){
	details = null; var f = new Date();
    details=window.open("nameScanDetailsUCC.php?rowid=" + rowid + "&unkey=" + unkey,'details'+ f.getHours() + f.getMinutes() + f.getSeconds(),'toolbar=no,location=no,scrollbars=yes,resizable=yes,width=700,height=500')
    details.moveTo(screen.availWidth/2-100,screen.availHeight/2-50);
}
function loadNameScanDetailsTAB(rowid,violnumber){
	details = null; var f = new Date();
    details=window.open("nameScanDetailsTAB.php?rowid=" + rowid + "&violnumber=" + violnumber,'details' + f.getHours() + f.getMinutes() + f.getSeconds(),'toolbar=no,location=no,scrollbars=yes,resizable=yes,width=700,height=300')
    details.moveTo(screen.availWidth/2-100,screen.availHeight/2-50);
}
function loadNameScanDetailsECB(rowid,violnumber){
	details = null; var f = new Date();
    details=window.open("nameScanDetailsECB.php?rowid=" + rowid + "&violnumber=" + violnumber,'details' + f.getHours() + f.getMinutes() + f.getSeconds(),'toolbar=no,location=no,scrollbars=yes,resizable=yes,width=700,height=300')
    details.moveTo(screen.availWidth/2-100,screen.availHeight/2-50);
}
function loadNameScanDetailsPVB(rowid,plate){
	details = null; var f = new Date();
    details=window.open("nameScanDetailsPVB.php?rowid=" + rowid + "&plate=" + plate,'details' + f.getHours() + f.getMinutes() + f.getSeconds(),'toolbar=no,location=no,scrollbars=yes,resizable=yes,width=700,height=300')
    details.moveTo(screen.availWidth/2-100,screen.availHeight/2-50);
}
function loadEEXAverages(){
	details = null; var f = new Date();
    details=window.open("EEXAverages.php",'details' + f.getHours() + f.getMinutes() + f.getSeconds(),'toolbar=no,location=no,scrollbars=yes,resizable=yes,width=700,height=500')
    details.moveTo(screen.availWidth/2-100,screen.availHeight/2-50);
}
function loadScanningLogsScreen(){
    contin2 = null;
    contin2=window.open('/oma/search/scanLogs.php?scanDate='+document.form99.scanDate.value, 'contin2','toolbar=no,location=no,scrollbars=yes,resizable=yes,width=700,height=500')
    contin2.moveTo(screen.availWidth/2-100,screen.availHeight/2-50);
}
function loadOnlineAbstract(){
	location.href="/oma/search/onlineAbstract.php";
}
function loadPolicyHits(){
	location.href="/oma/SES/policyHits.php";
}
function loadCOOP(county,block,lot){
	//alert ("/oma/coop/firstCOOP.php?county="+county+"&block="+block+"&lot="+lot);
	location.href="/oma/coop/firstCOOP.php?county="+county+"&block="+block+"&lot="+lot;
}
function loadSES(county,block,lot){
	location.href="/oma/SES/SES_order1.php";
}
function loadRecordingTracker(){
	location.href="/oma/search/recordingTracker.php";
}
function loadDEP(){
	location.href="/oma/search/dep.php";
}
function loadDOF(){
	location.href="/oma/search/dof.php";
}
function loadMap(){
	location.href="/oma/search/map.php";
}
function loadProcessQ(){
	//ShowProgress();
	location.href="/oma/search/processQ.php";
}	
function loadAISRet(){
	//ShowProgress();
	location.href="/oma/search/aisRetrieve.php";
}	
function loadAssess(){
	//ShowProgress();
	location.href="/oma/orps/orpsSearch.php?shtype=ad";
	//location.href="/oma/search/rpadSearch.php";
}	
function loadRecordings(){
	location.href="/oma/search/recordingIndex.php";
}
function loadRecordingImages(){
	location.href="/oma/search/recordingImages.php";
}	
function loadRecordingAlerts(){
	location.href="/oma/search/recordingAlerts.php";
}
function loadNameScan(){
	location.href="/oma/scan/nameScan.php";
}	
function loadAutomatedTX(){
	location.href="/oma/automated/automatedTX.php";
}	
function loadExaminersEx(){
	location.href="/oma/examinersEx/examinersEx.php";
}	
function openSecureImage(address,fileTypeAIS,fileTypeClient){
	var d = new Date();
	theUrl = "/oma/viewer.php?address=" + address + "&fileTypeAIS=" + fileTypeAIS + "&fileTypeClient=" + fileTypeClient;
	//alert (theUrl);
	newWin = window.open(theUrl,'pdf' + d.getHours() + d.getMinutes() + d.getSeconds(),"toolbar=no,location=no,scrollbars=yes,resizable=yes");
}
function muniTax(){
	var f = new Date();
	theUrl = "http://65.242.190.8/ais/orderform/index.asp";
	newWindow2 = window.open(theUrl,f.getHours() + f.getMinutes() + f.getSeconds(),"toolbar=no,location=no,scrollbars=yes,resizable=yes");	
}
function continOrders(){
	location.href="/oma/order/contin1.php";
}
function batchPDFJobs(totalChk){
	var hold = 0;
	theUrl = "/oma/viewerMultiCombine2PDF.php?fileTypeAIS=tif&fileTypeClient=pdf";
	for (i=1;i<=totalChk;i++){
		//alert(document.resultsForm.elements["chk"+i].checked);
		if (document.resultsForm.elements["chk"+i].checked == true){
			hold = hold +1;
			theUrl = theUrl + "&add" + eval(hold) + "=" + document.resultsForm.elements["chk"+i].value;
		}
	}
	//must be more than 2
	if (hold < 2){
		alert("Please select 2 or more images to Batch PDF.");
		return;
	}
	//must be less than 10
	if (hold > 10){
		alert("Please select 10 or fewer jobs to Batch PDF.");
		return;
	}
	var d = new Date();
	//alert(theUrl);
	newWindow = window.open(theUrl,'pdf' + d.getHours() + d.getMinutes() + d.getSeconds(),"toolbar=no,location=no,scrollbars=yes,resizable=yes");
}
function isValidEmail(str) {
   return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
}
