﻿// JScript File
//Function: LimitText

//Author: ???
//Date: ???
//Purpose: Do not allow more than maxChars to be added to fieldObj.value
//Modifications:
function LimitText(fieldObj,maxChars)
{
	var result = true;
  if (fieldObj.value.length >= maxChars) {
		result = false;
		//fieldObj.value = fieldObj.value.substr(0,maxChars);
  }
  if (window.event) {
		window.event.returnValue = result;
  }
  return result;
}


function CheckFileUpload(URL) {
  if (URL != '') {
    var sFeatures, sLocationURL;
    sFeatures = "dialogHeight:600px;dialogWidth:800px;";
    openWindow = window.showModalDialog(URL, "",sFeatures);
            }
}

function LogOutConfirmation() {
  if (confirm("Are you sure you wish to log out? \n If you click OK, your data will not be saved."))
    //Set a hidden text box to something so you can read that on the post back
    {
      var targetLogoutField = document.getElementById('ctl00$LogoutAnswer');
      targetLogoutField.value = 'Logout';
    }
  else
    {
      var targetLogoutField = document.getElementById('ctl00$LogoutAnswer');
      targetLogoutField.value = '';
    }
}

function CancelConfirmation() {
  if (confirm("Are you sure you wish to cancel? \n If you click OK, your data will not be saved and you will return to the audit type selection page."))
    //Set a hidden text box to something so you can read that on the post back
    {
      var targetCancelField = document.getElementById('ctl00$CancelAnswer');
      targetCancelField.value = 'Cancel';
    }
  else
    {
      var targetCancelField = document.getElementById('ctl00$CancelAnswer');
      targetCancelField.value = '';
    }
}