function PrintCarCompleted() 
{
alert("This will go and retrieve the Car Completed template and display the report in a new window.  Click OK and then wait a moment while the report is prepared.");
SubmitForm('CarReportForm');
}

function CheckSaveType(c1,c2,c3)
{
 if ( confirm(c1) )
 {
   SubmitForm(c2) ;
 }
  else
 {
  SubmitForm(c3) ;
 }
}


function SubmitForm(cButton){
document.forms[0].cButtonPressed.value=cButton
document.forms[0].submit()
}


function PrintAlert() {
alert("Please use the Print option on your Browser for printing")
}

function WordAlert() {
alert("The word report can take between 10-30 seconds to complete --- please be patient!!  In contrast, the Excel ouptput takes about 3 seconds, the HTML table output < 1 second and the PDF is not completed yet.") 
}


function NotImplementedYet()  {
alert("This feature has not been implemented yet.  It should be ready soon in a maintenance release.")
}

function JKT_Alert(cAlertMsg)  {
alert(cAlertMsg)
}

function WarnSaveB4Email() {
if (confirm("In order to Email, the record needs to be saved first -- OK to Save and then go to email form?") )
{SubmitForm('eMail_AMS') }
}


function ConfirmDelete(cDeleteMsg,cDeleteAction)  
{
 if ( confirm(cDeleteMsg) )
 {
   SubmitForm(cDeleteAction) ;
 }
}

function ConfirmSubmit(cSubmitMsg,cSubmitAction)  
{
 if ( confirm(cSubmitMsg) )
 {
   SubmitForm(cSubmitAction) ;
 }
}

function ConfirmDialog(cConfirmMsg)  
{
 if ( confirm(cConfirmMsg) )
 {
   return true ;
 }
 else
 {
   return false ;
 } 
}


function NoDelete()
{
alert("Deleting of Departments Not Allowed in the Demo version")
}

/*
Submit Once form validation- 
© Dynamic Drive (www.dynamicdrive.com)
For full source code, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com
*/

function submitonce(theform){
//if IE 4+ or NS 6+
if (document.all||document.getElementById){
//screen thru every element in the form, and hunt down "submit" and "reset" and "button"
for (i=0;i<theform.length;i++){
var tempobj=theform.elements[i]
if(tempobj.type.toLowerCase()=="submit"||tempobj.type.toLowerCase()=="cancel"||tempobj.type.toLowerCase()=="button")
//disable em
tempobj.disabled=true
}
}
}
