
window.TopObject=function TopObject() {};        window.TopObject.prototype._callSuperInstanceMethod = function() 
    {
       //alert(arguments.callee.caller._superClassName)
       //alert(arguments.callee.caller._superClassNamespace)

       if (arguments.callee._className == arguments.callee.caller._className) {
           var caller = arguments.callee.caller
          // alert(caller._superClassName)
          // alert(caller._superClassNamespace)
           if (caller._superClassNamespace == null) {
               window[caller._superClassName].prototype[caller._methodName].apply(this, arguments)
           }
           else {
            //   alert('else')
               window[caller._superClassNamespace][caller._superClassName].prototype[caller._methodName].apply(this, arguments)
           }
       }
   }
    window.TopObject._callSuperClassMethod = function() 
       {
          //alert(arguments.callee.caller._superClassName)
          //alert(arguments.callee.caller._superClassNamespace)

          if (arguments.callee._className == arguments.callee.caller._className) 
          {
              var caller = arguments.callee.caller
            //  alert(caller._superClassName)
            //  alert(caller._superClassNamespace)
              if (caller._superClassNamespace == null) {
                  window[caller._superClassName][caller._methodName].apply(this, arguments)
              }
              else {
                  //    alert('else')
                  window[caller._superClassNamespace][caller._superClassName][caller._methodName].apply(this, arguments)
              }
          }
      }
      TopObject=window.TopObject;
/*

*/
window.getCurrentWorkOrder=function getCurrentWorkOrder(parms)
{
    return myProgram.mainDS.current_workorder_id.trim()
};
window.getCurrentWorkOrder.release_number_id = '01.001.0001';
window.getCurrentWorkOrder.release_number_rn = '1227240584171';
getCurrentWorkOrder=window.getCurrentWorkOrder
/*

*/
window.getSpecifiedDirectory=function getSpecifiedDirectory()
{
    return myProgram.mySpecifiedCurrentDirectory
};
window.getSpecifiedDirectory.release_number_id = '01.001.0001';
window.getSpecifiedDirectory.release_number_rn = '1227240584171';
getSpecifiedDirectory=window.getSpecifiedDirectory
/*

*/
window.myAvatar=function myAvatar() {};
window.myAvatar.release_number_id = '01.001.0001';
window.myAvatar.release_number_rn = '1227240584171';
myAvatar=window.myAvatar
/*

*/
window.MyRecipe=function MyRecipe(the_initial_ingredients)
{	
	
};
window.MyRecipe.release_number_id = '01.001.0001';
window.MyRecipe.release_number_rn = '1227240584171';
MyRecipe=window.MyRecipe
/*

*/
window.addCollateralDocument=function addCollateralDocument(parms)
{
    var parms = parms.dbEval()
    var the_values=new Array();
    
    the_values["Work Order Id"] = myProgram.mainDS.current_workorder_id
    
    var the_equipment_value=parms["equipment_id"]
    if(the_equipment_value.trim() == "")
    {
        return "[Ref Code:22] There must be specified equipment for this workorder before you can add other items."
    }
    
    myProgram.mainDS.wo_selected_equipment=the_equipment_value
    the_values["Equipment Id"]=the_equipment_value
    
    var the_category_value=parms["category"]
    the_values["Category"]=the_category_value
    
    var the_description_value=parms["description"]
    the_values["Collateral Description"]=the_description_value
    
    the_values["RN"]=myProgram.myNextRN()
    
    var file_value = parms["file"]
    var fileAllowedResult = myProgram.myIsFileAllowed(file_value)
    if(fileAllowedResult !== true) return fileAllowedResult
    
    the_values["File"]=myProgram.myPrepareFileForUpload(file_value, the_values["RN"])
    
    the_headings = myProgram.mainDS.wo_collateral_headings
    
    the_values["RN"]=myProgram.myNextRN()
    the_values["ServerRN"]='0'
    var the_row=the_headings.dbCreateRow(the_values, "wo_collateral")
    
    myProgram.mainDS.wo_collateral_list.push(the_row)
    myProgram.mySaveData()
    
    return '{"file":"'+the_values["File"]+'"}'
};
window.addCollateralDocument.release_number_id = '01.001.0001';
window.addCollateralDocument.release_number_rn = '1227240584171';
addCollateralDocument=window.addCollateralDocument
/*

*/
window.getDocumentDoneValue=function getDocumentDoneValue(parms)
{
    try
    {
        var parms = parms.replace(/\\/g,"\\\\").dbEval()
        var fileLocation = parms["fileLocation"]
        var the_locator_recipe=new SUITableCellValueLocatorRecipe({"initialConfigurationName":"generic_table_cell_value_locator"})
        the_locator_recipe.tableRows=myProgram.mainDS.static_document_management_list
        the_locator_recipe.tableHeadings=myProgram.mainDS.static_document_management_headings
        the_locator_recipe.tableLocatorHeading=[].dbPush("FileLocation").dbPush(myProgram.mainDS.wo_id_heading)
        the_locator_recipe.tableLocatorFilter=[].dbPush(fileLocation).dbPush(myProgram.mainDS.current_workorder_id)
        the_locator_recipe.tableTargetCellHeading="Done"
        var value = the_locator_recipe.prepare()
        return value+""
    }
    catch(e)
    {
        myProgram.mydbLogMessage("DocumentManager","","Error occurred trying to get the document 'Done' value for WO:"+myProgram.mainDS.current_workorder_id+" Filelocation:"+fileLocation+" - "+sysFunctions.getExceptionMessage(e))
        return "false"
    }
};
window.getDocumentDoneValue.release_number_id = '01.001.0001';
window.getDocumentDoneValue.release_number_rn = '1227240584171';
getDocumentDoneValue=window.getDocumentDoneValue
/*

*/
window.updateDocumentRequired=function updateDocumentRequired(parmsString)
{
    try
    {
        var parms = parmsString.replace(/\\/g,"\\\\").dbEval()
        var fileLocation = parms["fileLocation"]
        var newValue = parms["newValue"].trim()
    
        if(newValue === "true")
        {
            newValue = "Y"
        }
        else if(newValue === "false")
        {
            newValue = "N"
        }
        else
        {
            return
        }
        
        var the_locator_recipe=new SUITableCellValueLocatorRecipe({"initialConfigurationName":"generic_table_cell_value_locator"})
        the_locator_recipe.tableRows=myProgram.mainDS.static_document_management_list
        the_locator_recipe.tableHeadings=myProgram.mainDS.static_document_management_headings
        the_locator_recipe.tableCellNewValue=newValue
        the_locator_recipe.tableLocatorHeading=[].dbPush("FileLocation").dbPush(myProgram.mainDS.wo_id_heading)
        the_locator_recipe.tableLocatorFilter=[].dbPush(fileLocation).dbPush(myProgram.mainDS.current_workorder_id)
        the_locator_recipe.tableTargetCellHeading="Done"
        var the_old_value=the_locator_recipe.prepare()
        
        myProgram.mySaveData()
    }
    catch(e)
    {
        return "Error"
    }
};
window.updateDocumentRequired.release_number_id = '01.001.0001';
window.updateDocumentRequired.release_number_rn = '1227240584171';
updateDocumentRequired=window.updateDocumentRequired
/*

*/
window.removeCollateralLine=function removeCollateralLine(parms)
{
    try
    {
        var parms = parms.replace(/\\/g,"\\\\").dbEval()
        var file = parms["File"]
        
        myProgram.tempDS.file_for_deleted_line = file
        var the_table=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'})
        the_table.sourceRows=myProgram.mainDS.wo_collateral_list
        the_table.sourceHeadings=myProgram.mainDS.wo_collateral_headings
        the_table.filterOnSourceHeadings=[].dbPush("File")
        the_table.filterValues=[].dbPush(function(val){return val.value != myProgram.tempDS.file_for_deleted_line})
        the_table.targetHeadings=myProgram.mainDS.wo_collateral_headings
        myProgram.mainDS.wo_collateral_list=the_table.prepare() 
        delete(myProgram.tempDS.file_for_deleted_line)
        myProgram.mySaveData()
        return "true"
    }
    catch(e)
    {
        myProgram.mydbLogMessage("DocumentManager","","Error occurred trying to remove collateral line for 'File':'"+file+"'"+sysFunctions.getExceptionMessage(e))
        return "false"
    }
};
window.removeCollateralLine.release_number_id = '01.001.0001';
window.removeCollateralLine.release_number_rn = '1227240584171';
removeCollateralLine=window.removeCollateralLine
/*

*/
window.getCollateralHeadings=function getCollateralHeadings(parms)
{
    return sysFunctions.stringify(myProgram.mainDS.wo_collateral_headings)
};
window.getCollateralHeadings.release_number_id = '01.001.0001';
window.getCollateralHeadings.release_number_rn = '1227240584171';
getCollateralHeadings=window.getCollateralHeadings
/*

*/
window.getCacheDocumentHeadings=function getCacheDocumentHeadings(parms)
{
    return sysFunctions.stringify(myProgram.attachmentsDS.static_document_headings)
};
window.getCacheDocumentHeadings.release_number_id = '01.001.0001';
window.getCacheDocumentHeadings.release_number_rn = '1227240584171';
getCacheDocumentHeadings=window.getCacheDocumentHeadings
/*

*/
window.getDefaultEmailTo=function getDefaultEmailTo(parmsString)
{
    return myProgram.myDefaultReceiptEmailTo()
};
window.getDefaultEmailTo.release_number_id = '01.001.0001';
window.getDefaultEmailTo.release_number_rn = '1227240584171';
getDefaultEmailTo=window.getDefaultEmailTo
/*

*/
window.getCollateralList=function getCollateralList(parms)
{
    var the_table=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'})
    the_table.sourceRows=myProgram.mainDS.wo_collateral_list
    the_table.sourceHeadings=myProgram.mainDS.wo_collateral_headings
    the_table.filterOnSourceHeadings=[].dbPush("Work Order Id")
    the_table.filterValues=[].dbPush(myProgram.mainDS.current_workorder_id)
    the_table.targetHeadings=myProgram.mainDS.wo_collateral_headings
    return sysFunctions.stringify(the_table.prepare())
};
window.getCollateralList.release_number_id = '01.001.0001';
window.getCollateralList.release_number_rn = '1227240584171';
getCollateralList=window.getCollateralList
/*

*/
window.sendEmail=function sendEmail(parmsString)
{
    try
    {
        var parms = parmsString.replace(/\\/g,"\\\\").dbEval()
        myProgram.tempDS.emailToForPdfSubmission = parms["emailTo"]
        myProgram.myEmailPdfReceipt(parms["attachmentsString"])
        return "true"
    }
    catch(e)
    {
        return sysFunctions.getExceptionMessage(e)
    }
};
window.sendEmail.release_number_id = '01.001.0001';
window.sendEmail.release_number_rn = '1227240584171';
sendEmail=window.sendEmail
/*

*/
window.getCollateralCategoryList=function getCollateralCategoryList(parms)
{
    return sysFunctions.stringify(myProgram.mainDS.static_collateral_category_list)
};
window.getCollateralCategoryList.release_number_id = '01.001.0001';
window.getCollateralCategoryList.release_number_rn = '1227240584171';
getCollateralCategoryList=window.getCollateralCategoryList
/*

*/
window.getCurrentEquipmentList=function getCurrentEquipmentList(parms)
{
    return sysFunctions.stringify(myProgram.myCurrentEquipmentListForWorkOrder(myProgram.mainDS.current_workorder_id, ["Equipment Id"]))
};
window.getCurrentEquipmentList.release_number_id = '01.001.0001';
window.getCurrentEquipmentList.release_number_rn = '1227240584171';
getCurrentEquipmentList=window.getCurrentEquipmentList
/*

*/
window.setAddDocumentDirectory=function setAddDocumentDirectory(parms)
{
    try
    {
        var parms = parms.replace(/\\/g,"\\\\").dbEval()
        myProgram.tempDS.currentAddDocumentDirectory = parms["currentAddDocumentDirectory"]
    }
    catch(e)
    {
        myProgram.mydbLogMessage("DocumentManager","","Error occurred trying to set currentAddDocumentDirectory: "+sysFunctions.getExceptionMessage(e))
        return "false"
    }
};
window.setAddDocumentDirectory.release_number_id = '01.001.0001';
window.setAddDocumentDirectory.release_number_rn = '1227240584171';
setAddDocumentDirectory=window.setAddDocumentDirectory
/*

*/
window.getAddDocumentDirectory=function getAddDocumentDirectory(parms)
{
    return myProgram.tempDS.currentAddDocumentDirectory+""
};
window.getAddDocumentDirectory.release_number_id = '01.001.0001';
window.getAddDocumentDirectory.release_number_rn = '1227240584171';
getAddDocumentDirectory=window.getAddDocumentDirectory
/*

*/
window.getDocumentList=function getDocumentList(parms)
{
    var the_table=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'})
    the_table.sourceRows=myProgram.attachmentsDS.static_document_list
    the_table.sourceHeadings=myProgram.attachmentsDS.static_document_headings
    the_table.filterOnSourceHeadings=[].dbPush("ReferenceType").dbPush("ReferenceId")
    the_table.filterValues=[].dbPush("WorkOrders").dbPush(myProgram.mainDS.current_workorder_id)
    the_table.targetHeadings=myProgram.attachmentsDS.static_document_headings
    var workorderResults = the_table.prepare()
    
    var the_table=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'})
    the_table.sourceRows=myProgram.attachmentsDS.static_document_list
    the_table.sourceHeadings=myProgram.attachmentsDS.static_document_headings
    the_table.filterOnSourceHeadings=[].dbPush("ReferenceType").dbPush("ReferenceId")
    the_table.filterValues=[].dbPush("ClientSites").dbPush(myProgram.getSiteIdForWorkOrderId(myProgram.mainDS.current_workorder_id))
    the_table.targetHeadings=myProgram.attachmentsDS.static_document_headings
    var siteResults = the_table.prepare()
    
    return sysFunctions.stringify(workorderResults.concat(siteResults))
};
window.getDocumentList.release_number_id = '01.001.0001';
window.getDocumentList.release_number_rn = '1227240584171';
getDocumentList=window.getDocumentList
/*

*/
window.myData=function myData() {};
window.myData.release_number_id = '01.001.0001';
window.myData.release_number_rn = '1227240584171';
myData=window.myData
/*

*/
window.MyCompletedWorkOrderPage=function MyCompletedWorkOrderPage(){};
window.MyCompletedWorkOrderPage.release_number_id = '01.001.0001';
window.MyCompletedWorkOrderPage.release_number_rn = '1227240584171';
MyCompletedWorkOrderPage=window.MyCompletedWorkOrderPage
/*

*/
window.MyUnbilledPage=function MyUnbilledPage(){};
window.MyUnbilledPage.release_number_id = '01.001.0001';
window.MyUnbilledPage.release_number_rn = '1227240584171';
MyUnbilledPage=window.MyUnbilledPage
/*

*/
window.MyQuotePage=function MyQuotePage(){};
window.MyQuotePage.release_number_id = '01.001.0001';
window.MyQuotePage.release_number_rn = '1227240584171';
MyQuotePage=window.MyQuotePage
/*

*/
window.MyPendingWorkOrderPage=function MyPendingWorkOrderPage()
{

};
window.MyPendingWorkOrderPage.release_number_id = '01.001.0001';
window.MyPendingWorkOrderPage.release_number_rn = '1227240584171';
MyPendingWorkOrderPage=window.MyPendingWorkOrderPage
window.MyRecipe.getVersionTable = function()
{
    var table = new GUITableRecipe()
    table.cellStyles = ["font-weight:900;text-align:left","text-align:left"]
    table.rows.push(["Version:", ManifestInfo.getManifestEntry("SubAnywhere").releaseNumberId])
    table.rows.push(["Build date/time:", ManifestInfo.buildDateTime])
    return table
}
window.MyRecipe.getVersionTable._methodName='getVersionTable'
window.MyRecipe.startApp = function()
{
    sysFunctions = new SUIFunctions()
    
    __ = sysFunctions.__
    
    StringExtensions.load()
    ArrayExtensions.load()
    
    myProgram= new MyRecipe
    myPendingWorkOrderPage = new MyPendingWorkOrderPage()
    myUnbilledPage = new MyUnbilledPage()
    myCompletedPage = new MyCompletedWorkOrderPage()
    myQuotePage = new MyQuotePage()
    
    if(myProgram.tempDS == null) myProgram.tempDS={}
    if(myProgram.attachmentsDS == null) myProgram.attachmentsDS = {}
    if(myProgram.inventoryDS == null) myProgram.inventoryDS = {}
    if(myProgram.mainDS == null) myProgram.mainDS={}

    myProgram.mainDS.url = window.location.protocol+"//"+window.location.host+"/dbxchange/SubAnywhere"
    var isJab = false
    if(window.opener)
    {
        if(window.opener.jab)
        {
            isJab = true
            myProgram.mainDS.url = "http://localhost:8080/dbxchange/SubAnywhere"
        }
    }
    var html = "<div id='mywaitappletdiv'><applet id=MyWaitApplet width='0' height='0'><PARAM name='code' value='MyWaitApplet.class'></applet></div>\
<div id=cursorDiv width=100% height=100%>\
<div class='text' style='position:absolute;right:20px;top:20px;'>"+MyRecipe.getVersionTable().prepare()+"</div>\
<div id='myprogressappletdiv' style='display:absolute;left:200px;top:200px'></div>\
<center>\
\
    <div id='context_menu' style='overflow:auto;display:none;border-width:1;border-style:solid;border-color:gray;background-color:white;position:absolute'>\
    </div>\
    <div id='pleaseWaitDiv' style='font:arial;'></div>\
    <div  id='main_division' style='display:block;border-width:1;border-style:none;border-color:black;background-color:#ffffff;height:100%'>\
             <img style='border-style:solid;border-color:gray;border-width:1px 0px 1px 1px' src='splash.gif'/>\
    </div>\
</center>"

    var div = document.createElement("div")
    div.innerHTML = html
    document.body.appendChild(div)

    if(!isJab)
    {
        if(!passBrowserTest())
        {
            document.getElementById('main_division').innerHTML = "<table style='width:100%;height:100%;text-align:center;vertical-align:middle'><tr><td><i style='font-family:verdana'>Your browser must be either Internet Explorer 7+, Firefox 3+, Safari 3.2.1+, Google chrome 1.0.154.43+, or Opera 9.62+ to use this application.</i></td></tr></table>"
            return false
        }
    }
    
    myProgram.myLoadConfigFile()
    document.getElementById("main_division").innerHTML = myProgram.getLoginForm()
}
window.MyRecipe.startApp._methodName='startApp'
window.myAvatar.myAcknowledgeWorkOrderDo = function(newStatus, userETADate, userETATime)
{
    var the_locator_recipe=new SUITableCellValueLocatorRecipe('{"initialConfigurationName":"generic_table_cell_value_locator"}')
    the_locator_recipe.tableRows=myProgram.mainDS.wo_list
    the_locator_recipe.tableHeadings=myProgram.mainDS.wo_headings
    the_locator_recipe.tableLocatorHeading=[].dbPush(myProgram.mainDS.wo_id_heading).dbPush("Date Scheduled")
    the_locator_recipe.tableLocatorFilter=[].dbPush(myProgram.mainDS.pending_workorder_id).dbPush(myProgram.mainDS.pending_workorder_date_scheduled)
    the_locator_recipe.tableTargetCellHeading="Pending"
    the_locator_recipe.tableCellNewValue='n'
    the_locator_recipe.prepare()
            
    var the_locator_recipe=new SUITableCellValueLocatorRecipe({"initialConfigurationName":"generic_table_cell_value_locator"})
    the_locator_recipe.tableRows=myProgram.mainDS.wo_list
    the_locator_recipe.tableHeadings=myProgram.mainDS.wo_headings
    the_locator_recipe.tableLocatorHeading=[].dbPush(myProgram.mainDS.wo_id_heading).dbPush("Date Scheduled")
    the_locator_recipe.tableLocatorFilter=[].dbPush(myProgram.mainDS.pending_workorder_id).dbPush(myProgram.mainDS.pending_workorder_date_scheduled)
    the_locator_recipe.tableTargetCellHeading='Status'
    var the_old_value=the_locator_recipe.prepare()
    
    //Change the local data store work order to reflect the changed status.
    var the_locator_recipe=new SUITableCellValueLocatorRecipe('{"initialConfigurationName":"generic_table_cell_value_locator"}')
    the_locator_recipe.tableRows=myProgram.mainDS.wo_list
    the_locator_recipe.tableHeadings=myProgram.mainDS.wo_headings
    the_locator_recipe.tableLocatorHeading=[].dbPush(myProgram.mainDS.wo_id_heading).dbPush("Date Scheduled")
    the_locator_recipe.tableLocatorFilter=[].dbPush(myProgram.mainDS.pending_workorder_id).dbPush(myProgram.mainDS.pending_workorder_date_scheduled)
    the_locator_recipe.tableTargetCellHeading="Status"
    the_locator_recipe.tableCellNewValue=newStatus
    the_locator_recipe.prepare()
    
    //Locate the date_scheduled value for this work order.
    var the_locator_recipe=new SUITableCellValueLocatorRecipe({"initialConfigurationName":"generic_table_cell_value_locator"})
    the_locator_recipe.tableRows=myProgram.mainDS.wo_list
    the_locator_recipe.tableHeadings=myProgram.mainDS.wo_headings
    the_locator_recipe.tableLocatorHeading=[].dbPush(myProgram.mainDS.wo_id_heading).dbPush("Date Scheduled")
    the_locator_recipe.tableLocatorFilter=[].dbPush(myProgram.mainDS.pending_workorder_id).dbPush(myProgram.mainDS.pending_workorder_date_scheduled)
    the_locator_recipe.tableTargetCellHeading="Date Scheduled"
    var date_scheduled=the_locator_recipe.prepare()
    
    //Get the tech_id from the data store.
    var tech_id = myProgram.mainDS.tech_id;
    
    //["Work Order Id","Technician Id","Date Scheduled","Old Status","Status","Transmitted"]
    
    var the_values= {};
    the_values["Work Order Id"] = myProgram.mainDS.pending_workorder_id;
    the_values["Technician Id"] = tech_id;
    the_values["Date Scheduled"] = date_scheduled;
    the_values["Old Status"] = the_old_value;
    the_values["Status"] = newStatus;
    the_values["ETADate"] = userETADate
    the_values["ETATime"] = userETATime
    the_values["Transmitted"] = 'n';
    the_values["DateTimeChanged"] = myProgram.myEditRecipeFor({recipeName:"System Date"})+" "+myProgram.myTimeStamp()+" "+(new Date()).getTimezoneOffset();
    
    //2008-01-24 (jc)-[2090]-Submit WOTechRn with all WOStatusChange messages.
    var the_locator_recipe=new SUITableCellValueLocatorRecipe({"initialConfigurationName":"generic_table_cell_value_locator"})
    the_locator_recipe.tableRows=myProgram.mainDS.wo_list
    the_locator_recipe.tableHeadings=myProgram.mainDS.wo_headings
    the_locator_recipe.tableLocatorHeading=[].dbPush(myProgram.mainDS.wo_id_heading).dbPush("Date Scheduled")
    the_locator_recipe.tableLocatorFilter=[].dbPush(myProgram.mainDS.pending_workorder_id).dbPush(date_scheduled)
    the_locator_recipe.tableTargetCellHeading="WOTechRn"
    var woTechRn=the_locator_recipe.prepare()
    
    the_values["WOTechRn"] = woTechRn
    
    //2005-12-14 JKC CASE:527 Changed the row creation to use dbCreateRow.
    var the_headings=myProgram.mainDS.wo_status_change_headings
    var the_row=the_headings.dbCreateRow(the_values, "wo_status_change")
    myProgram.mainDS.wo_status_change_list.dbPush(the_row)
    
    if(myProgram.mySendStatusMessage())
    {
        sysFunctions.setColumnValueForTable(myProgram.mainDS.wo_list, myProgram.mainDS.wo_headings, "Date Scheduled", userETADate, ["WOTechRn"], [myProgram.mainDS.pending_workorder_rn])
        sysFunctions.setColumnValueForTable(myProgram.mainDS.wo_list, myProgram.mainDS.wo_headings, "Time Scheduled", userETATime, ["WOTechRn"], [myProgram.mainDS.pending_workorder_rn])
        sysFunctions.setColumnValueForTable(myProgram.mainDS.wo_list, myProgram.mainDS.wo_headings, "Transmitted", 'n', ["WOTechRn"], [myProgram.mainDS.pending_workorder_rn]) 
    
        document.getElementById("pendingPageDiv").innerHTML = ""
        this.myRefreshOpenWorkOrdersGrid()
        this.myRefreshPendingWorkOrdersGrid()
        
        alert('the work order status has been changed from: '+the_old_value+' to: '+newStatus)
        return true
    }
    else
    {
        alert("A problem occurred trying to post your changes.  Your changes have NOT been submitted.  Please try again.")
        myProgram.mainDS.wo_status_change_list.pop() //Remove status line added to myProgram.mainDS.wo_status_change_list
        return false
    }
}
window.myAvatar.myAcknowledgeWorkOrderDo._methodName='myAcknowledgeWorkOrderDo'
window.myAvatar.GUIFormGridRecipe_example_form_grid_b = function(this_object)
{
			this_object.styleAttribute="display:inline;overflow:auto;background-color:#dddddd;height:800;width:1000"
			this_object.cellWidth="51"
			this_object.cellHeight="12"
			this_object.gridUnits='pt'
			this_object.cellFontSize=9
			this_object.cellFontFamily="arial"
			this_object.cellOutsideBorderWidth=0
			var small_blue_style=";background-color:blue;font-family:arial;font-size:8;"
			var small_white_style=";background-color:white;font-family:arial;font-size:8;"
			var medium_blue_style=";background-color:blue;font-family:arial;font-size:10;"
			var medium_red_style=";background-color:red;font-family:arial;font-size:10;"
			var medium_yellow_style=";background-color:yellow;font-family:arial;font-size:10;"
			var medium_gray_style=";background-color:#ddddd;font-family:arial;font-size:10;"
			var medium_lightgray_style=";background-color:eeee;font-family:arial;font-size:10;"
			this_object.cellDefaultHeightWhenExpanded="600"
			this_object.cellDefaultWidthWhenExpanded="400"

			this_object.cellOutsideBorderColor="black"
			this_object.cellContentStyles=[]
			this_object.cellHeadingStyles=[]
			this_object.cellHotSpotEnabled=[false,true,
									true,false,false,false,false,false,false,
									false,false,false,
									false,false,false,false,true,
									true,
									false,false,false,
									true,
									true,
									true,true,true,
									true,false,
									true,true,
									false,false,false,false,false,false,
									false,false			
									]

			this_object.cellOnClickEnabled=[false,true,
									true,false,false,false,false,false,false,
									false,false,false,
									false,false,false,false,true,
									true,
									false,true,false,
									true,
									true,
									true,true,true,
									true,false,
									true,true,
									false,false,false,false,false,false,
									false,false			
									]
			this_object.cellBorders=["all","all",
							  "all","all","all","all","all","all","all",
							  "all","all","all",
							  "all","all","all","all","all",
							  "all",
							  "all","all","all",
							  "all",
							  "all",
							  [],[],[],
							  "all","all",
							  "all","all",
							  "all","all","all","all","all","all",
							  "all","all"
								]
			this_object.cellHeadings=["_logo_","Work Requested",
								"Customer Info","Date Scheduled","Street","_street_","City","State","Zip",
								"Phone","Contact","Directions to Site",
								"Work Order Id","Work Code","Work Order Status","Attachments","_attachments_",
								"Incoming Call Script",
								"Equipment Currently On Work Order", "Tap Here to Add Equipment to Work Order","&nbsp",
								"myEquipmentGrid",
								"_work_performed_grid_",
								"Truck Stock/Inventory","Labor","Misc",
								"Closing Call Script","Tap Here to Add Equipment to Purchase Order",
								"Recommendations","Signatures",
								"LABOR","_labor_","MATERIAL","_material_","Sales Tax","_sales_tax_",
								"TOTAL AMOUNT DUE","_total_amount_due_"
								]
			this_object.cellContents=[null,"_work_requested_",
								"_customer_info_","_date_scheduled_",null,null,"_city_","_state_","_zip_",
								"_phone_","_contact_","_directions_to_site_",
								"_work_order_id_","_work_code_","_work_order_status_",null,null,
								"myCallScriptGrid",
								null,null,null,
								null,
								null,
								"myLaborGrid","myMaterialGrid","myOtherGrid",
								"_closing_call_script_","_purchase_orders_",
								"_recommendations_","mySignatureGrid",
								null,null,null,null,null,null,
								null,null								
								]
			this_object.cellPositions=[[1,1],[1,3],
								[4,1],[6,1],[4,3],[5,3],[4,4],[5,4],[6,4],
								[7,1],[8,1],[7,3],
								[10,1],[11,1],[10,3],[10,5],[11,5],
								[1,6],
								[1,11],[4,11],[8,11],
								[1,12],
								[1,16],
								[1,23],[5,23],[9,23],
								[1,31],[7,31],
								[1,36],[5,36],
								[9,36],[10,36],[9,37],[10,37],[9,39],[10,39],
								[9,40],[10,40]
								]
			this_object.cellExtents=[[3,2],[3,3],
								[2,2],[1,2],[1,1],[2,1],[1,2],[1,2],[1,2],
								[1,2],[2,2],[3,3],
								[1,2],[1,2],[2,2],[1,1],[1,1],
								[11,5],
								[3,1],[4,1],[4,1],
								[11,4],
								[11,7],
								[4,8],[4,8],[3,8],
								[6,5],[5,5],
								[4,7],[4,7],
								[1,1],[2,1],[1,1],[2,1],[1,1],[2,1],
								[1,3],[2,3]
								]
}
window.myAvatar.GUIFormGridRecipe_example_form_grid_b._methodName='GUIFormGridRecipe_example_form_grid_b'
window.myAvatar.GUITabsRecipe_example_tabs2 = function(this_object)
{
	//754
	this_object.topTabNames=[[["<img src='home_front.gif'/>","<img src='home_back.gif'/>"]
							 ,["<img src='ts_front.gif'/>","<img src='ts_back.gif'/>"]
							 ,["<img src='tb_front.gif'/>","<img src='tb_back.gif'/>"]
							 ,["<img src='nwo_front.gif'/>","<img src='nwo_back.gif'/>"]
							 ,["<img src='help_front.gif'/>","<img src='help_back.gif'/>"]]]
	this_object.topTabContents=[[myAvatar.myTabbedHomePage(),"<div style='border-style:solid;border-width:0 1 1 1;border-color:#676566;' id='myTimeSheetPageDiv'>"+myAvatar.myTimeSheetPage().prepare()+"</div>","<div style='border-style:solid;border-width:0 1 1 1;border-color:#676566;'>"+myAvatar.mySynchronizePage().prepare()+"</div>","<div style='border-style:solid;border-width:0 1 1 1;border-color:#676566;' id='createWorkOrderPageDiv'>"+myAvatar.myCreateWorkOrderPage().prepare()+"</div>"]]
	this_object.toolTabContents=[]//["Tab set 1","Tab set 2"]
	this_object.toolTabsStyle='display:none;'
	this_object.styleAttribute="border:0 solid black;height:949;width:"+sysFunctions.getTechAnywhereScreenWidth()+";overflow:none;display:inline;position:absolute;top:0;left:0;"
	this_object.topTabsStyle='width:100%;height:719;'+/*position:absolute;top:0;left:0;*/'border:0 solid black;font-size:12;font-family:arial;'
	this_object.toolTabContents=[]//["Tab set 1","Tab set 2"]
	this_object.tabContentsStyle='overflow:auto;background-color:white;width:'+sysFunctions.getTechAnywhereScreenWidth()+';height:937;border:0 solid black;'
	this_object.tabSeparatorStyle='width:'+sysFunctions.getTechAnywhereScreenWidth()+';height:2px;background-color:#0303A5;background-image: url(tabs_separator.gif);background-repeat: repeat-x'
}
window.myAvatar.GUITabsRecipe_example_tabs2._methodName='GUITabsRecipe_example_tabs2'
window.myAvatar.mySiteFindResultsGrid = function()
{
	return myProgram.mySiteFindResultsGridForFormView()
}
window.myAvatar.mySiteFindResultsGrid._methodName='mySiteFindResultsGrid'
window.myAvatar.myCreateWorkOrderPage = function()
{
	//Clear all the data still in memory from previous executions of myProgram method
	if(myProgram.tempDS.preserve_site_results == null)
	{
		myProgram.mainDS.site_listing = null;
	}
	else
	{
		myProgram.tempDS.preserve_site_results = null;
	}
		
	myProgram.mainDS.selected_site_id = null;
	myProgram.mainDS.site_equipment_list = null;
	myProgram.mainDS.site_equipment_wo_list = null;
	myProgram.mainDS.work_order_selected_equipment_id = null;
	
	var the_recipe=new GUITemplateRecipe('{"initialConfigurationName":"generic_template"}')
	the_recipe.keys=[]
	the_recipe.values=[]
	var the_template=[]
	the_template.dbPush('<br/>')
	the_template.dbPush(myProgram.myFindSiteButtonRecipe()).dbPush('&nbsp;&nbsp').dbPush('<span style=\'font-family:arial;font-size:12\'>').dbPush('&nbsp').dbPush(myProgram.myActiveSitesOnlyCheckBoxRecipe()).dbPush('Active Sites Only?').dbPush('</span>')
	the_template.dbPush('<br/><br/>')
	
	/************************************************/
	//Build the rows for the grid.
	var row_set = new Array();
	
	var first_row = new Array();
	first_row.dbPush('Site Id:').dbPush(new GUIInputFieldRecipe({alert:false,idAttribute:"site_id",initialConfigurationName:"generic_input_field"}));
	var second_row = new Array();
	second_row.dbPush('Site Name:').dbPush(new GUIInputFieldRecipe({alert:false,idAttribute:"site_name",initialConfigurationName:"generic_input_field"}));
	var second_and_half_row = new Array();
	second_and_half_row.dbPush('Site Address:').dbPush(new GUIInputFieldRecipe({alert:false,idAttribute:"site_address",initialConfigurationName:"generic_input_field"}));
	var third_row = new Array();
	third_row.dbPush('Site City:').dbPush(new GUIInputFieldRecipe({alert:false,idAttribute:"site_city",initialConfigurationName:"generic_input_field"}));
	var fourth_row = new Array();
	fourth_row.dbPush('Site State:').dbPush(new GUIInputFieldRecipe({alert:false,idAttribute:"site_state",initialConfigurationName:"generic_input_field"}));
	var fifth_row = new Array();
	fifth_row.dbPush('Zip Code:').dbPush(new GUIInputFieldRecipe({alert:false,idAttribute:"zip_code",initialConfigurationName:"generic_input_field"}));
	
	row_set.dbPush(first_row).dbPush(second_row).dbPush(second_and_half_row).dbPush(third_row).dbPush(fourth_row).dbPush(fifth_row);
	
	/************************************************/
	var the_site_find_input_grid=new GUISimpleGridRecipe('{"initialConfigurationName":"generic_simple_grid","showHeadings":false,"borderAttribute":0}')
	the_site_find_input_grid.columnWidths=[75,100];
	the_site_find_input_grid.columnCount=2;
	
	the_site_find_input_grid.alert=false
	
	var the_table=new SUIDataModelRecipe('{"initialConfigurationName":"generic_data_model"}')
	
	the_table.sourceRows=row_set //Rows of data.
	the_table.sourceHeadings=['Label','Input'];
	the_table.targetHeadings=['Label','Input'];
	the_site_find_input_grid.rows=the_table.prepare();
	the_site_find_input_grid.defaultColumnWidth=null
	
	/************************************************/
	the_template.dbPush(the_site_find_input_grid);
	the_template.dbPush('<br/>')
	the_template.dbPush(myProgram.myOnCallFirstStepHelpButton())
	the_template.dbPush('<br/><br/>')
	the_template.dbPush('<div id=mySiteFindResultsGrid>')
	the_template.dbPush(myProgram.mySiteFindResultsGridForFormView())
	the_template.dbPush('</div>')
	the_template.dbPush('<div style="font-family:arial;font-size:10;color:black;background-color:white;">Results Returned </div>').dbPush(myProgram.myEditRecipeFor({"recipeName":"Results Limit","onchangeAttribute":"myProgram.mySiteFindResultsLimiter"}))	
	//the_template.dbPush('<br/><br/>')
	the_template.dbPush('<br/><br/>')
	the_recipe.template=the_template
	return the_recipe
}
window.myAvatar.myCreateWorkOrderPage._methodName='myCreateWorkOrderPage'
window.myAvatar.myTimeSheetPage = function()
{
	var the_recipe=new GUITemplateRecipe('{"initialConfigurationName":"generic_template"}')
	the_recipe.keys=[]
	the_recipe.values=[]
	var the_template=[]
	the_template.dbPush('<br/>')	
	the_template.dbPush(myProgram.myPayPeriodComboboxRecipe().prepare()+" ").dbPush(myProgram.myTimeSheetSubmitButtonRecipe())
	the_template.dbPush('<br/>')	//
	the_template.dbPush('<br/>')	//
	the_template.dbPush('<div  id=myTimeSheetSummaryGrid>')
	the_template.dbPush(myProgram.myTimeSheetSummaryGrid())
	the_template.dbPush('</div>')
	
	the_recipe.template=the_template
	return the_recipe
}
window.myAvatar.myTimeSheetPage._methodName='myTimeSheetPage'
window.myAvatar.mySynchronizePage = function()
{
	var the_recipe=new GUITemplateRecipe('{"initialConfigurationName":"generic_template"}')
	the_recipe.keys=[]
	the_recipe.values=[]
	var the_template=[]
	the_template.dbPush('<div>')
	
	the_template.dbPush(myProgram.myInventorySyncForm())
	//the_template.dbPush('<br/>')
	//the_template.dbPush(this.myAttachmentsSyncForm())
	the_template.dbPush('<br/>')
	the_template.dbPush(myProgram.myFlatRateSyncForm())
	the_template.dbPush('<br/>')
	the_template.dbPush('<br/>')
	the_template.dbPush(myProgram.myFullBackupButtonRecipe())
	the_template.dbPush(myProgram.myUpdateSubanywhereButtonRecipe())
	//the_template.dbPush(this.myClearMainDSDataButtonRecipe())
	the_template.dbPush(myProgram.mySubmitSubanywhereFolderButtonTwo())
	the_template.dbPush(myProgram.mySynchronizeButtonRecipe())
	the_template.dbPush('<br/>')
	the_template.dbPush('<br/>')
	the_template.dbPush('<div id="messageQueueGridDiv">')
	the_template.dbPush(myProgram.myMessageQueueGrid())
	the_template.dbPush('</div>')
	the_template.dbPush('<br/>')
	the_template.dbPush(myProgram.myMessageQueueGridRefreshButton())
	the_template.dbPush('<br/>')
	the_template.dbPush('<br/>')
	the_template.dbPush('<div id="emailStatusGridDiv">')
	the_template.dbPush(myProgram.myEmailStatusGrid())
	the_template.dbPush('</div>')
	the_template.dbPush('<br/>')
	the_template.dbPush(myProgram.myEmailStatusGridRefreshButton())
	the_template.dbPush('<br/>')
	the_template.dbPush('<br/>')
	the_template.dbPush('<div style="font-family:arial;font-size:12"><span style="color:red">Data Source URL</span>: '+myProgram.mainDS.url+'</div>')
	the_template.dbPush('<br/>')
	the_template.dbPush('<div style="font-family:arial;font-size:12"><span style="color:red">SubAnywhere Version</span>: '+myProgram.mySubAnywhereVersion()+'</div>')
	the_template.dbPush('<br/>')
	the_template.dbPush('<div style="font-family:arial;font-size:12"><span style="color:red">Datastore Version</span>: '+myProgram.myDatastoreVersion()+'</div>')
	the_template.dbPush('<br/>')
	the_template.dbPush('<div style="font-family:arial;font-size:12"><span style="color:red">Local Datastore</span>: '+myProgram.myDatastoreFilePathAndName()+'</div>')
		
	the_template.dbPush('</div>')
	the_recipe.template=the_template
	return the_recipe
}
window.myAvatar.mySynchronizePage._methodName='mySynchronizePage'
window.myAvatar.myAcceptanceSignaturePage = function()
{
	
		
	var the_recipe=new GUITemplateRecipe({initialConfigurationName:"generic_template"})
	var the_template=the_recipe.template
	the_template.dbPush('<div>')//
		the_template.dbPush("<div id='mySignatureGridDiv'>"+myProgram.mySignatureGrid().prepare()+"</div>")
		the_template.dbPush('<br/>')
		the_template.dbPush(myProgram.myInvoiceFormatRadioButtonSetRecipe())
		the_template.dbPush('<br/>')
		the_template.dbPush(myProgram.myAddSignatureButtonRecipe())
	the_template.dbPush('</div>')//
	the_recipe.alert=false
	return the_recipe	
}
window.myAvatar.myAcceptanceSignaturePage._methodName='myAcceptanceSignaturePage'
window.myAvatar.myCurrentWorkOrderMessage = function()
{
	if(myProgram.mainDS.current_workorder_id == null || myProgram.mainDS.current_workorder_id.dbTrim() == "")
	{
		return "<span style='font-family:verdana;font-size:18;color:red'>No Work Order is selected</span>"	
	}
	else
	{
		return "<span style='font-family:verdana;font-size:18;color:green'>Current Workorder: "+myProgram.mainDS.current_workorder_id+"</span>"
	}
}
window.myAvatar.myCurrentWorkOrderMessage._methodName='myCurrentWorkOrderMessage'
window.myAvatar.myHomePage = function()
{
	var templateRecipe = new GUITemplateRecipe()
	var the_template = []
	myProgram.tempDS.current_page_recipe=templateRecipe
	templateRecipe.parentElementId="main_division"
	the_template.dbPush(myAvatar.myTabbedHomePage())
	the_template.joinString = ""
	templateRecipe.template = the_template
	
	return templateRecipe
}
window.myAvatar.myHomePage._methodName='myHomePage'
window.myAvatar.myTabbedHomePage = function()
{
	var aParms={}
	aParms.dateScheduledFilter = myProgram.tempDS.current_wo_filter
	aParms.filter_function=function(val){return (val.value.trim().toLowerCase()!='completed' && val.value.trim().toLowerCase()!='cancelled' && val.value.trim().toLowerCase()!='pending')}
	aParms.list="open_wo_list"
	aParms.page="view_open_workorder_page_tabbed"
	
	var pParms={}
	pParms.list = "pending_wo_list"
	pParms.dateScheduledFilter = myProgram.tempDS.current_wo_filter
	
	
	
	var this_recipe=new GUITabsRecipe('{"initialConfigurationName":"","finalIngredients":{}}')
	this_recipe.alert = false
	this_recipe.styleAttribute = "display:block;float:left;position:relative;border:none;height:100%;width:100%;overflow:none;"
	this_recipe.topTabsStyle='width:100%;height:100%;border:0px solid black;font-size:12px;font-family:verdana;background-color:white;'
	this_recipe.tabContentsStyle='overflow:auto;background-color:white;width:'+sysFunctions.getTechAnywhereScreenWidth()+';height:700px;/*500px;*/border:1px solid #8DB2E3;'
	
	//this_recipe.topTabsStyle='width:100%;height:738;position:absolute;top:0;left:0;border:0 solid black;font-size:12;font-family:arial;background-color:white;border-style:solid;border-color:gray;border-width: 0 0 0 0;'
	this_recipe.tabSeparatorStyle+=';width:99.7%;'
	this_recipe.toolTabContents=[]//["Tab set 1","Tab set 2"]
	//this_recipe.tabContentsStyle='overflow:auto;background-color:white;width:'+sysFunctions.getTechAnywhereScreenWidth()+';height:906px;border:1px solid #676566;'
	this_recipe.topTabNames=[[["<span onclick='myProgram.refreshWOList()'>Unacknowledged</span>","<span onclick='myProgram.refreshWOList(this.id)' id='pendingTab'>Unacknowledged</span>"]
							 ,["<span onclick='myProgram.refreshWOList()' id='inProcessTab'>In Progress</span>","<span onclick='myProgram.refreshWOList(this.id)' id='inProcessTab'>In Progress</span>"]
							 ,["<span onclick='myProgram.refreshWOList()' id='unbilledTab'>Unbilled</span>","<span onclick='myProgram.refreshWOList(this.id)' id='unbilledTab'>Unbilled</span>"],
							 ["<span onclick='myProgram.refreshWOList()' src='comp_front.gif'>Completed</span>","<span onclick='myProgram.refreshWOList(this.id)' id='completedTab'>Completed</span>"],
							 ["<span onclick='myProgram.refreshWOList()' id='quotesTab'>Quotes</span>","<span onclick='myProgram.refreshWOList(this.id)' id='quotesTab'>Quotes</span>"]
							,["<span onclick='myProgram.refreshWOList()' id='currentTab'>Current WO</span>","<span id='currentTab'>Current WO</span>"]]]
   						
	this_recipe.topTabContents=[[myAvatar.myPendingWorkOrderGridAndPage(pParms),
								 "<div id='myAcknowledgedWorkOrdersGridDiv'>"+__('myAcknowledgedWorkOrdersGrid',null,aParms).prepare()+"</div>",
								 myUnbilledPage.myGridAndPage().prepare(),
								 myCompletedPage.myGridAndPage().prepare(),
								 myQuotePage.myGridAndPage().prepare(),
								 myAvatar.myNoWorkOrderDiv()]]
	this_recipe.toolTabContents=[]//["Tab set 1","Tab set 2"]
	this_recipe.toolTabsStyle='display:none;'
	this_recipe.toolTabContents=[]//["Tab set 1","Tab set 2"]
	
	var the_recipe=new GUITemplateRecipe({initialConfigurationName:"generic_template"})
	var the_template=the_recipe.template
	the_template.dbPush('<div style="position:absolute;top:0px;left:0px;width:100%">')//
	the_template.dbPush(this_recipe)
	the_template.dbPush('</div>')
	
	return the_recipe	
}
window.myAvatar.myTabbedHomePage._methodName='myTabbedHomePage'
window.myAvatar.myNoWorkOrderDiv = function()
{
    var guiTagRecipe = new GUIDivTagRecipe({initialConfigurationName:"generic_div_tag"})
	guiTagRecipe.idAttribute="currentWorkOrderDiv"
	guiTagRecipe.contents='"NO WORKORDER HAS BEEN SELECTED"'
	return guiTagRecipe
}
window.myAvatar.myNoWorkOrderDiv._methodName='myNoWorkOrderDiv'
window.myAvatar.myCurrentWorkOrderFormGrid = function()
{
	//2008-05-05 (jc)-[2262]-Topaz signature.  Following is used to determine if the topaz signature area has changed.
	myProgram.tempDS.initialSigString = null //Needs to be here for topaz to work
	if(myProgram.mainDS.current_workorder_id == null)
	{
		return myAvatar.myNoWorkOrderDiv()
	}
	var this_recipe = new GUIFormGridRecipe('{"initialConfigurationName":"example_navigation_grid_2","finalIngredients":{}}')
	this_recipe.idAttribute="example_form_grid_a"
	this_recipe.styleAttribute+=";width:100%;height:904px;overflow:none;"
	this_recipe.breakpointOnPrepare = false
        
	return this_recipe
}
window.myAvatar.myCurrentWorkOrderFormGrid._methodName='myCurrentWorkOrderFormGrid'
window.myAvatar.myViewOpenWorkOrderTabbedView = function(rowNumber, columnNumber)
{
	myProgram.mainDS.current_workorder_id=myProgram.mainDS.open_wo_list[rowNumber][columnNumber]
	
	wo_date_scheduled_index=myProgram.mainDS.open_wo_headings.dbIndexOf("Date Scheduled")
	wo_time_scheduled_index=myProgram.mainDS.open_wo_headings.dbIndexOf("Time Scheduled")
	
	myProgram.mainDS.current_workorder_date_scheduled = myProgram.mainDS.open_wo_list[rowNumber][wo_date_scheduled_index]
	myProgram.mainDS.current_workorder_time_scheduled = myProgram.mainDS.open_wo_list[rowNumber][wo_time_scheduled_index]
		
	//Locate the SiteId value for this work order.
	var the_locator_recipe=new SUITableCellValueLocatorRecipe({"initialConfigurationName":"generic_table_cell_value_locator"})
	the_locator_recipe.tableRows=myProgram.mainDS.wo_list
	the_locator_recipe.tableHeadings=myProgram.mainDS.wo_headings
	the_locator_recipe.tableLocatorHeading=[].dbPush(myProgram.mainDS.wo_id_heading).dbPush("Date Scheduled")
	the_locator_recipe.tableLocatorFilter=[].dbPush(myProgram.mainDS.current_workorder_id).dbPush(myProgram.mainDS.current_workorder_date_scheduled)
	the_locator_recipe.tableTargetCellHeading="SiteId"
	myProgram.tempDS.selected_site_id = the_locator_recipe.prepare()
	
	var the_locator_recipe=new SUITableCellValueLocatorRecipe({"initialConfigurationName":"generic_table_cell_value_locator"})
	the_locator_recipe.tableRows=myProgram.mainDS.wo_list
	the_locator_recipe.tableHeadings=myProgram.mainDS.wo_headings
	the_locator_recipe.tableLocatorHeading=[].dbPush(myProgram.mainDS.wo_id_heading).dbPush("Date Scheduled")
	the_locator_recipe.tableLocatorFilter=[].dbPush(myProgram.mainDS.current_workorder_id).dbPush(myProgram.mainDS.current_workorder_date_scheduled)
	the_locator_recipe.tableTargetCellHeading="Status"
	myProgram.mainDS.current_workorder_status = the_locator_recipe.prepare()
	
	myProgram.myLoadDataForCurrentWorkOrder()
	//sysFunctions.setInnerHTMLForElement("currentWorkOrderDiv", myAvatar.myCurrentWorkOrderFormGrid().prepare())//currentWorkOrderContentDiv
	myProgram.loadIntoCurrentWorkOrderTab(myAvatar.myCurrentWorkOrderFormGrid().prepare())
	//myProgram.myDirectToCurrentWorkOrderPage()
}
window.myAvatar.myViewOpenWorkOrderTabbedView._methodName='myViewOpenWorkOrderTabbedView'
window.myAvatar.myCurrentWorkOrderPageTabbed = function()
{
	var this_recipe=new GUITabsRecipe('{"initialConfigurationName":"","finalIngredients":{}}')
	the_code_textarea_contents=sysFunctions.functionTextArea(GUITabsRecipe,'recipe')
	the_code_textarea2_contents=sysFunctions.functionTextArea(GUITabsRecipe.prototype.prepare,'prepare')
	this_recipe.styleAttribute="border:1 solid black;height:735;width:100%;overflow:auto;display:inline;"
	this_recipe.topTabsStyle='display:none'//width:800;height:700;position:absolute;top:0;left:0;border:1 solid black;font-size:12;font-family:arial;'
	this_recipe.tabSeparatorStyle='display:none'
	this_recipe.tabContentsStyle='overflow:auto;background-color:#aaaaaa;width:90%;height:700;border:1 solid black;position:absolute;left:160'
	this_recipe.toolTabsStyle='position:absolute;top:0;left:10;width:150;height:200;border:1 solid black;background-color:yellow'
	this_recipe.topTabNames=[[""],
							 [""],
							 [""],
							 [""],
							 [""],
							 [""],
							 [""],
							 [""],
							 [""],
							 [""],
							 [""],
							 [""],
							 [""],
							 [""],
							 [""],
							 [""]]
	this_recipe.topTabContents=[[this.workOrderInformationDivRecipe()],
								[this.callScriptDivRecipe()],
								[this.attachmentsDivRecipe()],
								[this.collateralDivRecipe()],
								[this.requiredDivRecipe()],
								[this.workPerformedDivRecipe()],
								[this.equipmentDivRecipe()],
								[this.equipmentUnspecifiedDivRecipe()],
								[this.laborDivRecipe()],
								[this.otherDivRecipe()],
								[this.materialDivRecipe()],
								[this.purchaseOrdersDivRecipe()],
								[this.flatRateDivRecipe()],
								[this.recommendationsDivRecipe()],
								[this.closingScriptDivRecipe()],
								[this.acceptanceSignaturesDivRecipe()]]
	this_recipe.toolTabContents=["Work Order Information",
								 "Call Script",
								 "Attachments",
								 "Collateral",
								 "Required Documents",
								 ((myProgram.isWorkOrderQuote()) ? "Scope of Quoted Services" : "Work Performed"),
								 "Current Equipment",
								 "Other Equipment",
								 "Labor",
								 "Misc",
								 "Material",
								 "Purchase Orders",
								 "Flat Rate",
								 "Recommendations",
								 "Closing Script",
								 "Acceptance Signatures"]
	
	var the_recipe=new GUITemplateRecipe({initialConfigurationName:"generic_template"})
	var the_template=the_recipe.template
	the_template.dbPush('<div style="position:absolute;top:0;left:0">')//
	the_template.dbPush(this_recipe)
	the_template.dbPush('</div>')
	
	return the_recipe	
}
window.myAvatar.myCurrentWorkOrderPageTabbed._methodName='myCurrentWorkOrderPageTabbed'
window.myAvatar.GUIFormGridRecipe_example_form_grid_a = function(this_object)
{
			this_object.styleAttribute="display:inline;overflow:auto;background-color:#dddddd;height:800;width:1100"
			this_object.cellHeadingBackgroundColorWhenEnabled="#aaaaaa"
			this_object.cellWidth="101"
			this_object.cellHeight="12"
			this_object.gridUnits='pt'
			this_object.cellFontSize=9
			this_object.cellFontFamily="arial"
			this_object.cellOutsideBorderWidth=0
			var small_blue_style=";background-color:blue;font-family:arial;font-size:8;"
			var small_white_style=";background-color:white;font-family:arial;font-size:8;"
			var medium_blue_style=";background-color:blue;font-family:arial;font-size:10;"
			var medium_red_style=";background-color:red;font-family:arial;font-size:10;"
			var medium_yellow_style=";background-color:yellow;font-family:arial;font-size:10;"
			var medium_gray_style=";background-color:#ddddd;font-family:arial;font-size:10;"
			var medium_lightgray_style=";background-color:eeee;font-family:arial;font-size:10;"
			var sb="overflow:auto;height:100%;background-color:yellow"
			this_object.cellDefaultHeightWhenExpanded="600"
			this_object.cellDefaultWidthWhenExpanded="400"

			this_object.cellOutsideBorderColor="black"
			this_object.cellContentStyles=[]
			this_object.cellHeadingStyles=[
										null,null,null,null,null,null,null,null,
										sb,sb,sb,sb,sb,sb,sb,sb,
										sb,sb,sb,sb,sb,sb,sb,sb,
										sb,sb,sb,sb,sb,sb,sb,sb,
										sb,sb,sb,sb,sb,sb,sb,sb,
										sb,sb,sb,sb,sb,sb,sb,sb
										]
			this_object.cellHotSpotEnabled=[
									false,false,false,false,false,false,false,false,
									false,false,false,false,false,false,false,false,
									false,false,false,false,false,false,false,false,
									false,false,false,false,false,false,false,false,
									false,false,false,false,false,false,false,false,
									false,false,false,false,false,false,false,false
									]

			this_object.cellOnClickEnabled=[
									true,true,true,true,true,true,true,true,
									true,true,true,true,true,true,true,true,
									true,true,true,true,true,true,true,true,
									true,true,true,true,true,true,true,true,
									true,true,true,true,true,true,true,true,
									true,true,true,true,true,true,true,true								
								]
			this_object.cellBorders=[
							  "all","all","all","all","all","all","all","all",
							  "all","all","all","all","all","all","all","all",
							  "all","all","all","all","all","all","all","all",
							  "all","all","all","all","all","all","all","all",
							  "all","all","all","all","all","all","all","all",
							  "all","all","all","all","all","all","all","all"
								]
			var mrt=""//__("myResourcesTree")
			this_object.cellHeadings=[
								"","monday 05-07-2007","tuesday 05-08-2007","wednesday 05-09-2007","thursday 05-10-2007","friday 05-11-2007","saturday 05-12-2007","sunday 05-13-2007",
								"wo00001<br/>description 1<br/>description 2<br/>description 3<br/>description 4<br/>description 5<br/>description 6<br/>description 7<br/>",mrt,mrt,mrt,mrt,mrt,mrt,mrt,
								"wo00002<br/>description 1<br/>description 2<br/>description 3<br/>description 4<br/>description 5<br/>description 6<br/>description 7<br/>",mrt,mrt,mrt,mrt,mrt,mrt,mrt,
								"wo00003<br/>description 1<br/>description 2<br/>description 3<br/>description 4<br/>description 5<br/>description 6<br/>description 7<br/>",mrt,mrt,mrt,mrt,mrt,mrt,mrt,
								"wo00004<br/>description 1<br/>description 2<br/>description 3<br/>description 4<br/>description 5<br/>description 6<br/>description 7<br/>",mrt,mrt,mrt,mrt,mrt,mrt,mrt,
								"wo00005<br/>description 1<br/>description 2<br/>description 3<br/>description 4<br/>description 5<br/>description 6<br/>description 7<br/>",mrt,mrt,mrt,mrt,mrt,mrt,mrt

								]
			this_object.cellContents=[
								]
			this_object.cellPositions=[
								[0,1],[1,1],[2,1],[3,1],[4,1],[5,1],[6,1],[7,1],
								[0,2],[1,2],[2,2],[3,2],[4,2],[5,2],[6,2],[7,2],
								[0,7],[1,7],[2,7],[3,7],[4,7],[5,7],[6,7],[7,7],
								[0,12],[1,12],[2,12],[3,12],[4,12],[5,12],[6,12],[7,12],
								[0,17],[1,17],[2,17],[3,17],[4,17],[5,17],[6,17],[7,17],
								[0,22],[1,22],[2,22],[3,22],[4,22],[5,22],[6,22],[7,22]

								]
			this_object.cellExtents=[
								[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],
								[1,5],[1,5],[1,5],[1,5],[1,5],[1,5],[1,5],[1,5],
								[1,5],[1,5],[1,5],[1,5],[1,5],[1,5],[1,5],[1,5],
								[1,5],[1,5],[1,5],[1,5],[1,5],[1,5],[1,5],[1,5],
								[1,5],[1,5],[1,5],[1,5],[1,5],[1,5],[1,5],[1,5],
								[1,5],[1,5],[1,5],[1,5],[1,5],[1,5],[1,5],[1,5]
								]
}
window.myAvatar.GUIFormGridRecipe_example_form_grid_a._methodName='GUIFormGridRecipe_example_form_grid_a'
window.myAvatar.GUITreeRecipe_example_tree_a = function(this_object)
{
			this_object.idAttribute="the_resources"
			this_object.styleAttribute+=";font-size:10;width:300"
			this_object.indentWidth=10
			this_object.leftMargin=10
			var wo_array=[]//["wo01","wo02","wo03","wo04","wo05"]
			this_object.branches=[
									["reusables",
										[
											["technicians",
												[
												["kelly green",wo_array],
												["sandy beach",wo_array],
												["john walker",wo_array],
												["jim beam",wo_array]

												],'closed'],
											["trucks",
												[
												["F-150-01",wo_array],
												["F-150-02",wo_array],
												["F-150-03",wo_array],												
												["F-150-03",wo_array],												
												["F-150-04",wo_array],												
												["F-150-05",wo_array],												
												["F-250-01",wo_array]
												],'closed']
										]
									]
								]
}
window.myAvatar.GUITreeRecipe_example_tree_a._methodName='GUITreeRecipe_example_tree_a'
window.myAvatar.GUITreeRecipe_currentWorkOrderTree = function(this_object)
{
	this_object.idAttribute="the_current_work_order_tree"
	this_object.styleAttribute+=";font-size:10;width:600"
	this_object.indentWidth=10
	this_object.leftMargin=10
	var wo_array=[]//["wo01","wo02","wo03","wo04","wo05"]
	
	
	
	this_object.branches=[
							["Work Order Information",[[this.workOrderInformationDivRecipe(),[]]]],
							["Call Script",[[this.callScriptDivRecipe(),[]]]],
							["Documents",[["Attachments",[[this.attachmentsDivRecipe(),[]]]],
										  ["Collateral",[[this.collateralDivRecipe(),[]]]],
										  ["Required",[[this.requiredDivRecipe(),[]]]]]],
							["Work Performed",[[this.workPerformedDivRecipe(),[]]]],
							["Specified Equipment",[[this.equipmentDivRecipe(),[]]]],
							["Unspecified Equipment",[[this.equipmentUnspecifiedDivRecipe(),[]]]],
							["Labor",[[this.laborDivRecipe(),[]]]],
							["Misc",[[this.otherDivRecipe(),[]]]],
							["Material",[[this.materialDivRecipe(),[]]]],
							["Purchase Orders",[[this.purchaseOrdersDivRecipe(),[]]]],
							["Flat Rate",[[this.flatRateDivRecipe(),[]]]],
							["Recommendations",[[this.recommendationsDivRecipe(),[]]]],
							["Closing Script",[[this.closingScriptDivRecipe(),[]]]],
							["Acceptance Signatures",[[this.acceptanceSignaturesDivRecipe(),[]]]]
							
						]
					
}
window.myAvatar.GUITreeRecipe_currentWorkOrderTree._methodName='GUITreeRecipe_currentWorkOrderTree'
window.myAvatar.GUITreeRecipe_currentWorkPerformedTree = function(this_object)
{
	this_object.idAttribute="the_current_work_performed_tree"
	this_object.styleAttribute+=";font-size:10;width:600"
	this_object.indentWidth=10
	this_object.leftMargin=10
	var wo_array=[]
	
	this_object.branches=myAvatar.myWorkPerformedBranches()
	
	
}
window.myAvatar.GUITreeRecipe_currentWorkPerformedTree._methodName='GUITreeRecipe_currentWorkPerformedTree'
window.myAvatar.myWorkPerformedRecipe = function(equipmentId, workPerformed, rowNumber)
{
	var the_recipe=new GUITemplateRecipe({initialConfigurationName:"generic_template"})
	var the_template=the_recipe.template
	the_template.dbPush('<div>')//
	the_template.dbPush("<div style='font-family:arial;font-size:20;color:black'>"+((myProgram.isWorkOrderQuote()) ? "Scope of Quoted Services" : "Work Performed")+" :"+equipmentId+"</div>")
 	the_template.dbPush(myAvatar.myWorkPerformedTextAreaRecipe(workPerformed, rowNumber).prepare())
 	the_template.dbPush('<br/>')
 	the_template.dbPush(myProgram.myCommonPhraseComboBox().prepare()+myAvatar.myAddCommonPhraseButtonRecipe(rowNumber).prepare())
 	the_template.dbPush('</div>')//
 	return the_template
}
window.myAvatar.myWorkPerformedRecipe._methodName='myWorkPerformedRecipe'
window.myAvatar.mySaveWorkPerformed = function(rowNumber)
{
	var equipment_rn_index=myProgram.mainDS.work_performed_headings.dbIndexOf("RN")
	var current_equipment_rn=myProgram.mainDS.work_performed_list[rowNumber][equipment_rn_index]
	
	var the_locator_recipe=new SUITableCellValueLocatorRecipe({"initialConfigurationName":"generic_table_cell_value_locator"})
	the_locator_recipe.tableRows=myProgram.mainDS.wo_equipment_list
	the_locator_recipe.tableHeadings=myProgram.mainDS.wo_equipment_headings
	the_locator_recipe.tableCellNewValue=window['work_performed_text_area_'+rowNumber].value
	the_locator_recipe.tableLocatorHeading=[].dbPush("RN").dbPush(myProgram.mainDS.wo_id_heading)
	the_locator_recipe.tableLocatorFilter=[].dbPush(current_equipment_rn).dbPush(myProgram.mainDS.current_workorder_id)
	the_locator_recipe.tableTargetCellHeading='Work Performed'
	var the_old_value=the_locator_recipe.prepare()
		
	var the_locator_recipe=new SUITableCellValueLocatorRecipe({"initialConfigurationName":"generic_table_cell_value_locator"})
	the_locator_recipe.tableRows=myProgram.mainDS.wo_equipment_list
	the_locator_recipe.tableHeadings=myProgram.mainDS.wo_equipment_headings
	the_locator_recipe.tableCellNewValue='n'
	the_locator_recipe.tableLocatorHeading=[].dbPush("RN").dbPush(myProgram.mainDS.wo_id_heading)
	the_locator_recipe.tableLocatorFilter=[].dbPush(current_equipment_rn).dbPush(myProgram.mainDS.current_workorder_id)
	the_locator_recipe.tableTargetCellHeading='Transmitted'
	var the_old_value=the_locator_recipe.prepare()
	
	myProgram.mySaveData()
}
window.myAvatar.mySaveWorkPerformed._methodName='mySaveWorkPerformed'
window.myAvatar.myAddCommonPhrase = function(rowNumber)
{
	var the_common_phrase_combobox=window['add_common_phrase_combobox']
	
	if(the_common_phrase_combobox.options.length == 0)
	{
		//Silently ignore
		return;
	}
	var the_description_value=myProgram.mainDS.static_selected_common_phrase = the_common_phrase_combobox.options[the_common_phrase_combobox.selectedIndex].text
	
	//Locate the row with the selected description and get the text value to insert.
	var the_locator_recipe=new SUITableCellValueLocatorRecipe({"initialConfigurationName":"generic_table_cell_value_locator"})
	the_locator_recipe.tableRows=myProgram.mainDS.static_common_phrase_list
	the_locator_recipe.tableHeadings=myProgram.mainDS.static_common_phrase_headings
	the_locator_recipe.tableLocatorHeading="Description"
	the_locator_recipe.tableLocatorFilter=the_description_value
	the_locator_recipe.tableTargetCellHeading="Text"
	var text=the_locator_recipe.prepare()
	
	var the_work_performed_text_area = window['work_performed_text_area_'+rowNumber]
	if(the_work_performed_text_area != null)
	{
		the_work_performed_text_area.focus()
		the_work_performed_text_area.value = the_work_performed_text_area.value+text+"\r\n";
		the_work_performed_text_area.selectionStart = the_work_performed_text_area.value.length;
		myAvatar.mySaveWorkPerformed(rowNumber)
		return
	}
	var the_work_requested_text_area = window['work_requested_text_area_'+rowNumber]
	if(the_work_requested_text_area != null)
	{
		the_work_requested_text_area.focus()
		the_work_requested_text_area.value = the_work_requested_text_area.value+text+"\r\n";
		the_work_requested_text_area.selectionStart = the_work_requested_text_area.value.length;
		myAvatar.mySaveWorkPerformed(rowNumber)
		return
	}
}
window.myAvatar.myAddCommonPhrase._methodName='myAddCommonPhrase'
window.myAvatar.myAddCommonPhraseButtonRecipe = function(rowNumber)
{
	var the_button_recipe=new GUIInputFieldRecipe('{"initialConfigurationName":"generic_button_input_field",\
						"titleAttribute":"click to add the selected common phrase",\
						"valueAttribute":"Add Common Phrase","onclickAttribute":"myAvatar.myAddCommonPhrase('+rowNumber+')"\
						}')
	return the_button_recipe
}
window.myAvatar.myAddCommonPhraseButtonRecipe._methodName='myAddCommonPhraseButtonRecipe'
window.myAvatar.myWorkPerformedTextAreaRecipe = function(workPerformed, rowNumber)
{
	var the_textarea_configuration='{"initialConfigurationName":"generic_textarea",\
			"rowsAttribute":"20","colsAttribute":"100","styleAttribute":"overflow:scroll;word-wrap:normal","idAttribute":"work_performed_text_area_'+rowNumber+'"}'
	var the_recipe=new GUITextAreaRecipe(the_textarea_configuration)
	the_recipe.styleAttribute="word-wrap:break-word;color:green;font-size:12;font-family:times new roman;"
	the_recipe.onchangeAttribute="myAvatar.mySaveWorkPerformed("+rowNumber+")"
	the_recipe.contents=workPerformed
	
	return the_recipe
}
window.myAvatar.myWorkPerformedTextAreaRecipe._methodName='myWorkPerformedTextAreaRecipe'
window.myAvatar.myWorkPerformedBranches = function()
{
	var the_table=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'})
	the_table.sourceRows=myProgram.mainDS.wo_equipment_list
	the_table.sourceHeadings=myProgram.mainDS.wo_equipment_headings
	the_table.filterOnSourceHeadings=[].dbPush(myProgram.mainDS.wo_id_heading)
	the_table.filterOnSourceHeadings.dbPush("Specified")
	the_table.filterValues=[].dbPush(myProgram.mainDS.current_workorder_id)
	the_table.filterValues.dbPush("y")
	the_table.sortOnSourceHeadings=[].dbPush(myProgram.mainDS.wo_id_heading)
	the_table.targetHeadings=myProgram.mainDS.work_performed_headings//['Equipment Id','Work Performed',"RN"]
	var work_performed_list=the_table.prepare()
	myProgram.mainDS.work_performed_list=work_performed_list
	
	var branchesToReturn = []
	
	for (var the_index=0;the_index<work_performed_list.length;the_index++)
	{
		var the_equipment_id=work_performed_list[the_index][0]
		var the_text=work_performed_list[the_index][1]
		//while(the_text.indexOf("\x0d") != -1)
		//{
		//	the_text=the_text.replace(/\x0d/g,'<br/>')
	//	}
		var workPerformedRecipe = myAvatar.myWorkPerformedRecipe(the_equipment_id, the_text, the_index)
		branchesToReturn.push([the_equipment_id,[[workPerformedRecipe,[]]],'open'])
	}
	
	return branchesToReturn
}
window.myAvatar.myWorkPerformedBranches._methodName='myWorkPerformedBranches'
window.myAvatar.requiredDivRecipe = function()
{
	var guiTagRecipe = new GUIDivTagRecipe()
	guiTagRecipe.contents='"&nbsp;"'
	guiTagRecipe.onclickAttribute=""
	guiTagRecipe.alert=false
	guiTagRecipe.idAttribute="requiredDiv"
	guiTagRecipe.breakpointOnPrepare=false
	guiTagRecipe.styleAttribute='display:inline;background-color:#dddddd;border:3 solid black'
	return guiTagRecipe
}
window.myAvatar.requiredDivRecipe._methodName='requiredDivRecipe'
window.myAvatar.collateralDivRecipe = function()
{
	var guiTagRecipe = new GUIDivTagRecipe()
	guiTagRecipe.contents='"&nbsp;"'
	guiTagRecipe.onclickAttribute=""
	guiTagRecipe.alert=false
	guiTagRecipe.idAttribute="collateralDiv"
	guiTagRecipe.breakpointOnPrepare=false
	guiTagRecipe.styleAttribute='display:inline;background-color:#dddddd;border:3 solid black'
	return guiTagRecipe
}
window.myAvatar.collateralDivRecipe._methodName='collateralDivRecipe'
window.myAvatar.attachmentsDivRecipe = function()
{
	var guiTagRecipe = new GUIDivTagRecipe()
	guiTagRecipe.contents='"No Work Order Selected"'
	guiTagRecipe.onclickAttribute=""
	guiTagRecipe.alert=false
	guiTagRecipe.idAttribute="attachmentsDiv"
	guiTagRecipe.breakpointOnPrepare=false
	guiTagRecipe.styleAttribute='display:inline;background-color:#dddddd;border:3 solid black'
	return guiTagRecipe
}
window.myAvatar.attachmentsDivRecipe._methodName='attachmentsDivRecipe'
window.myAvatar.acceptanceSignaturesDivRecipe = function()
{
	var guiTagRecipe = new GUIDivTagRecipe()
	guiTagRecipe.contents='"&nbsp;"'
	guiTagRecipe.onclickAttribute=""
	guiTagRecipe.alert=false
	guiTagRecipe.idAttribute="acceptanceSignaturesDiv"
	guiTagRecipe.breakpointOnPrepare=false
	guiTagRecipe.styleAttribute='display:inline;background-color:#dddddd;border:3 solid black'
	return guiTagRecipe
}
window.myAvatar.acceptanceSignaturesDivRecipe._methodName='acceptanceSignaturesDivRecipe'
window.myAvatar.closingScriptDivRecipe = function()
{
	var guiTagRecipe = new GUIDivTagRecipe()
	guiTagRecipe.contents='"&nbsp;"'
	guiTagRecipe.onclickAttribute=""
	guiTagRecipe.alert=false
	guiTagRecipe.idAttribute="closingScriptDiv"
	guiTagRecipe.breakpointOnPrepare=false
	guiTagRecipe.styleAttribute='display:inline;background-color:#dddddd;border:1 solid black'
	return guiTagRecipe
}
window.myAvatar.closingScriptDivRecipe._methodName='closingScriptDivRecipe'
window.myAvatar.recommendationsDivRecipe = function()
{
	var guiTagRecipe = new GUIDivTagRecipe()
	guiTagRecipe.contents='"&nbsp;"'
	guiTagRecipe.onclickAttribute=""
	guiTagRecipe.alert=false
	guiTagRecipe.idAttribute="recommendationsDiv"
	guiTagRecipe.breakpointOnPrepare=false
	guiTagRecipe.styleAttribute='display:inline;background-color:#dddddd;border:1 solid black'
	return guiTagRecipe
}
window.myAvatar.recommendationsDivRecipe._methodName='recommendationsDivRecipe'
window.myAvatar.flatRateDivRecipe = function()
{
	var guiTagRecipe = new GUIDivTagRecipe()
	guiTagRecipe.contents='"&nbsp;"'
	guiTagRecipe.onclickAttribute=""
	guiTagRecipe.alert=false
	guiTagRecipe.idAttribute="flatRateDiv"
	guiTagRecipe.breakpointOnPrepare=false
	guiTagRecipe.styleAttribute='display:inline;background-color:#dddddd;border:1 solid black'
	return guiTagRecipe
}
window.myAvatar.flatRateDivRecipe._methodName='flatRateDivRecipe'
window.myAvatar.purchaseOrdersDivRecipe = function()
{
	var guiTagRecipe = new GUIDivTagRecipe()
	guiTagRecipe.contents='"&nbsp;"'
	guiTagRecipe.onclickAttribute=""
	guiTagRecipe.alert=false
	guiTagRecipe.idAttribute="purchaseOrdersDiv"
	guiTagRecipe.breakpointOnPrepare=false
	guiTagRecipe.styleAttribute='display:inline;width:800;height:800background-color:#dddddd;border:1 solid black'
	return guiTagRecipe
}
window.myAvatar.purchaseOrdersDivRecipe._methodName='purchaseOrdersDivRecipe'
window.myAvatar.otherDivRecipe = function()
{
	var guiTagRecipe = new GUIDivTagRecipe()
	guiTagRecipe.contents='"&nbsp;"'
	guiTagRecipe.onclickAttribute=""
	guiTagRecipe.alert=false
	guiTagRecipe.idAttribute="otherDiv"
	guiTagRecipe.breakpointOnPrepare=false
	guiTagRecipe.styleAttribute='display:inline;background-color:#dddddd;border:1 solid black'
	return guiTagRecipe
}
window.myAvatar.otherDivRecipe._methodName='otherDivRecipe'
window.myAvatar.materialDivRecipe = function()
{
	var guiTagRecipe = new GUIDivTagRecipe()
	guiTagRecipe.contents='"&nbsp;"'
	guiTagRecipe.onclickAttribute=""
	guiTagRecipe.alert=false
	guiTagRecipe.idAttribute="materialDiv"
	guiTagRecipe.breakpointOnPrepare=false
	guiTagRecipe.styleAttribute='display:inline;background-color:#dddddd;border:1 solid black'
	return guiTagRecipe
}
window.myAvatar.materialDivRecipe._methodName='materialDivRecipe'
window.myAvatar.laborDivRecipe = function()
{
	var guiTagRecipe = new GUIDivTagRecipe()
	guiTagRecipe.contents='"&nbsp;"'
	guiTagRecipe.onclickAttribute=""
	guiTagRecipe.alert=false
	guiTagRecipe.idAttribute="laborDiv"
	guiTagRecipe.breakpointOnPrepare=false
	guiTagRecipe.styleAttribute='display:inline;background-color:#dddddd;border:1 solid black'
	return guiTagRecipe
}
window.myAvatar.laborDivRecipe._methodName='laborDivRecipe'
window.myAvatar.equipmentUnspecifiedDivRecipe = function()
{
	var guiTagRecipe = new GUIDivTagRecipe()
	guiTagRecipe.contents='"&nbsp;"'
	guiTagRecipe.onclickAttribute=""
	guiTagRecipe.alert=false
	guiTagRecipe.idAttribute="equipmentUnspecifiedDiv"
	guiTagRecipe.breakpointOnPrepare=false
	guiTagRecipe.styleAttribute='display:inline;background-color:#dddddd;border:1 solid black'
	return guiTagRecipe
}
window.myAvatar.equipmentUnspecifiedDivRecipe._methodName='equipmentUnspecifiedDivRecipe'
window.myAvatar.equipmentDivRecipe = function()
{
	var guiTagRecipe = new GUIDivTagRecipe()
	guiTagRecipe.contents='"&nbsp;"'
	guiTagRecipe.onclickAttribute=""
	guiTagRecipe.alert=false
	guiTagRecipe.idAttribute="equipmentDiv"
	guiTagRecipe.breakpointOnPrepare=false
	guiTagRecipe.styleAttribute='display:inline;background-color:#dddddd;border:1 solid black'
	return guiTagRecipe
}
window.myAvatar.equipmentDivRecipe._methodName='equipmentDivRecipe'
window.myAvatar.workPerformedDivRecipe = function()
{
	var guiTagRecipe = new GUIDivTagRecipe()
	guiTagRecipe.contents='"&nbsp;"'
	guiTagRecipe.onclickAttribute=""
	guiTagRecipe.alert=false
	guiTagRecipe.idAttribute="workPerformedDiv"
	guiTagRecipe.breakpointOnPrepare=false
	guiTagRecipe.styleAttribute='display:inline;background-color:#dddddd;border:1 solid black'
	return guiTagRecipe
}
window.myAvatar.workPerformedDivRecipe._methodName='workPerformedDivRecipe'
window.myAvatar.documentsDivRecipe = function()
{
	var guiTagRecipe = new GUIDivTagRecipe()
	guiTagRecipe.contents='"&nbsp;"'
	guiTagRecipe.onclickAttribute=""
	guiTagRecipe.alert=false
	guiTagRecipe.idAttribute="documentsDiv"
	guiTagRecipe.breakpointOnPrepare=false
	guiTagRecipe.styleAttribute='display:inline;background-color:#dddddd;border:1 solid black'
	return guiTagRecipe
}
window.myAvatar.documentsDivRecipe._methodName='documentsDivRecipe'
window.myAvatar.callScriptDivRecipe = function()
{
	var guiTagRecipe = new GUIDivTagRecipe()
	guiTagRecipe.contents='"&nbsp;"'
	guiTagRecipe.onclickAttribute=""
	guiTagRecipe.alert=false
	guiTagRecipe.idAttribute="callScriptDiv"
	guiTagRecipe.breakpointOnPrepare=false
	guiTagRecipe.styleAttribute='display:inline;background-color:#dddddd;border:1 solid black'
	return guiTagRecipe
}
window.myAvatar.callScriptDivRecipe._methodName='callScriptDivRecipe'
window.myAvatar.workOrderInformationDivRecipe = function()
{
	var guiTagRecipe = new GUIDivTagRecipe()
	guiTagRecipe.contents='"&nbsp;"'
	guiTagRecipe.onclickAttribute=""
	guiTagRecipe.alert=false
	guiTagRecipe.idAttribute="workOrderInformationDiv"
	guiTagRecipe.breakpointOnPrepare=false
	guiTagRecipe.styleAttribute='display:inline;background-color:#dddddd;border:1 solid black'
	return guiTagRecipe
}
window.myAvatar.workOrderInformationDivRecipe._methodName='workOrderInformationDivRecipe'
window.myAvatar.GUITreeRecipe_workorder_tree = function(this_object)
{
			this_object.idAttribute="the_resources"
			this_object.styleAttribute+=";font-size:10;width:800"
			this_object.indentWidth=10
			this_object.leftMargin=10
			var wo_array=[]//["wo01","wo02","wo03","wo04","wo05"]
			
			var aParms={}
			aParms.dateScheduledFilter = myProgram.tempDS.current_wo_filter
			aParms.filter_function=function(val){return (val.value.trim().toLowerCase()!='completed' && val.value.trim().toLowerCase()!='cancelled' && val.value.trim().toLowerCase()!='pending')}
			aParms.list="open_wo_list"
			aParms.page="view_open_workorder_page"
			
			var pParms={}
			pParms.dateScheduledFilter = myProgram.tempDS.current_wo_filter
			pParms.page="view_pending_workorder_page"
			
			var cParms={}
			cParms.dateScheduledFilter = myProgram.tempDS.current_wo_filter
			cParms.filter_function=function(val){return (val.value.trim().toLowerCase()=='completed' || val.value.trim().toLowerCase()=='cancelled')}
			cParms.page="view_completed_workorder_page"
			
			this_object.branches=[
									["Home",[["Open", [["<div style='display:inline' id='myAcknowledgedWorkOrdersGridDiv'>"+__('myAcknowledgedWorkOrdersGrid',null,aParms).prepare()+"</div>",[]]]],
											 ["Pending", [[myAvatar.myPendingWorkOrderGridAndPage(pParms),[]]]],
											 ["Completed", [["<div style='display:inline' id='myCompletedWorkOrdersGridDiv'>"+__('myCompletedWorkOrdersGrid',null,cParms).prepare()+"</div>",[]]]]]],
									["Review Time Sheet",[["<div style='display:inline' id='myTimeSheetPageDiv'>"+myAvatar.myTimeSheetPage().prepare()+"</div>",[]]]],
									["Synchronize Database",[[myAvatar.mySynchronizePage().prepare(),[]]]],
									["Create On Call Work Order",[["Coming soon...",[]]]],
									["Current Work Order [<div style='display=inline' id=currentWorkOrderDiv>Please Select a work order</div>]",
										[["<div id='currentWorkOrderContentDiv'>"+myAvatar.currentWorkOrderTreeRecipe().prepare()+"</div>",[]]]
									]
								 
									
								]
								/*
								["Home",[["Open", [myProgram.myAcknowledgedWorkOrdersGrid(aParms).prepare(),[]]],
											 ["Pending", [myProgram.myPendingWorkOrdersGrid(pParms).prepare(),[]]],
											 ["Completed", [myProgram.myCompletedWorkOrdersGrid(cParms).prepare(),[]]]]],
									["Review Time Sheet",[]],
									["Synchronize Database",[]],
									["Create On Call Work Order",[]]
								*/
}
window.myAvatar.GUITreeRecipe_workorder_tree._methodName='GUITreeRecipe_workorder_tree'
window.myAvatar.myRefreshPendingWorkOrdersGrid = function()
{
	var pParms={}
	pParms.dateScheduledFilter = myProgram.tempDS.current_wo_filter
	pParms.page="view_pending_workorder_page"
	sysFunctions.setInnerHTMLForElement("myPendingWorkOrdersGridDiv", myProgram.myPendingWorkOrdersGrid(pParms).prepare())
}
window.myAvatar.myRefreshPendingWorkOrdersGrid._methodName='myRefreshPendingWorkOrdersGrid'
window.myAvatar.myRefreshOpenWorkOrdersGrid = function()
{
	var aParms={}
	aParms.dateScheduledFilter = myProgram.tempDS.current_wo_filter
	aParms.filter_function=function(val){return (val.value.trim().toLowerCase()!='completed' && val.value.trim().toLowerCase()!='cancelled' && val.value.trim().toLowerCase()!='pending')}
	aParms.list="open_wo_list"
	aParms.page="view_open_workorder_page_tabbed"
	document.getElementById("myAcknowledgedWorkOrdersGridDiv").innerHTML = myProgram.myAcknowledgedWorkOrdersGrid(aParms).prepare()
}
window.myAvatar.myRefreshOpenWorkOrdersGrid._methodName='myRefreshOpenWorkOrdersGrid'
window.myAvatar.myPendingWorkOrderGridAndPage = function(pParms)
{
	var the_recipe=new GUITemplateRecipe({initialConfigurationName:"generic_template"})
	var the_template=the_recipe.template
	the_template.dbPush('<div id="myPendingWorkOrdersGridDiv">')
	the_template.dbPush(myProgram.myPendingWorkOrdersGrid(pParms).prepare())
	the_template.dbPush('</div>')
	the_template.dbPush('<div id="pendingPageDiv">')
	the_template.dbPush('</div>')
	return the_recipe.prepare()
}
window.myAvatar.myPendingWorkOrderGridAndPage._methodName='myPendingWorkOrderGridAndPage'
window.myAvatar.myWorkorderTree = function()
{
	the_recipe=new GUITreeRecipe('{"initialConfigurationName":"workorder_tree","finalIngredients":{}}')
    the_recipe.leafContentsHTMLTemplate='<a href=# onclick="myAvatar.setContextParent(this)">_leaf_contents_</a>'
//	the_recipe.alert=true
//	the_recipe.onmouseoutAttribute='this.parentNode.parentNode.style.display=\'none\''
//	the_recipe.onmouseoverAttribute='this.parentNode.parentNode.style.display=\'block\''
	the_recipe.parentElementId='main_division'
	return the_recipe
}
window.myAvatar.myWorkorderTree._methodName='myWorkorderTree'
window.myAvatar.currentWorkOrderTreeRecipe = function()
{
	the_recipe=new GUITreeRecipe('{"initialConfigurationName":"currentWorkOrderTree","finalIngredients":{}}')
    the_recipe.leafContentsHTMLTemplate='<a href=# onclick="myAvatar.setContextParent(this)">_leaf_contents_</a>'
//	the_recipe.alert=true
//	the_recipe.onmouseoutAttribute='this.parentNode.parentNode.style.display=\'none\''
//	the_recipe.onmouseoverAttribute='this.parentNode.parentNode.style.display=\'block\''
	//the_recipe.parentElementId='currentWorkOrderBranchDiv'
	return the_recipe
}
window.myAvatar.currentWorkOrderTreeRecipe._methodName='currentWorkOrderTreeRecipe'
window.myAvatar.myCurrentWorkOrderSelected = function()
{
	var infoRecipe = myProgram.myWorkOrderInfo({"enableEditStatus":true,"showButtons":false})
	delete(infoRecipe.parentElementId)
	window["workOrderInformationDiv"].innerHTML = infoRecipe.prepare()
	sysFunctions.setInnerHTMLForElement("callScriptDiv", myProgram.myCallScriptGrid().prepare())
	sysFunctions.setInnerHTMLForElement("attachmentsDiv", myAvatar.myAttachmentsGrid().prepare())
	sysFunctions.setInnerHTMLForElement("collateralDiv", myAvatar.myCollateralPage().prepare())
	sysFunctions.setInnerHTMLForElement("requiredDiv", myProgram.myRODocumentManagementGrid().prepare())
	sysFunctions.setInnerHTMLForElement("workPerformedDiv", myAvatar.myViewWorkPerformed().prepare())
	sysFunctions.setInnerHTMLForElement("equipmentDiv", myProgram.myEquipmentGrid().prepare())
	sysFunctions.setInnerHTMLForElement("laborDiv", myProgram.myLaborGrid().prepare())
	sysFunctions.setInnerHTMLForElement("otherDiv", myProgram.myOtherGrid().prepare())
	sysFunctions.setInnerHTMLForElement("materialDiv", myProgram.myMaterialGrid().prepare())
	sysFunctions.setInnerHTMLForElement("purchaseOrdersDiv", myAvatar.myViewPurchaseOrdersPage().prepare())
	sysFunctions.setInnerHTMLForElement("flatRateDiv", myProgram.myFlatRateGrid().prepare())
	sysFunctions.setInnerHTMLForElement("recommendationsDiv", "<div>"+myAvatar.myViewRecommendationPage().prepare()+"</div>")
	sysFunctions.setInnerHTMLForElement("closingScriptDiv", myProgram.myClosingScriptGrid().prepare())
	sysFunctions.setInnerHTMLForElement("acceptanceSignaturesDiv", myAvatar.myAcceptanceSignaturePage().prepare())
	sysFunctions.setInnerHTMLForElement("equipmentUnspecifiedDiv", myProgram.myEquipmentUnspecifiedGrid().prepare())
}
window.myAvatar.myCurrentWorkOrderSelected._methodName='myCurrentWorkOrderSelected'
window.myAvatar.myViewWorkPerformed = function()
{
	the_recipe=new GUITreeRecipe('{"initialConfigurationName":"currentWorkPerformedTree","finalIngredients":{}}')
    the_recipe.leafContentsHTMLTemplate='<a href=# onclick="myAvatar.setContextParent(this)">_leaf_contents_</a>'
	return the_recipe	
}
window.myAvatar.myViewWorkPerformed._methodName='myViewWorkPerformed'
window.myAvatar.myCurrentWorkOrderInfo = function(heading)
{
	var the_locator_recipe=new SUITableCellValueLocatorRecipe({"initialConfigurationName":"generic_table_cell_value_locator"})
	the_locator_recipe.tableRows=myProgram.mainDS.wo_list
	the_locator_recipe.tableHeadings=myProgram.mainDS.wo_headings
	the_locator_recipe.tableLocatorHeading=[].dbPush("Work Order Id").dbPush("Date Scheduled")
	the_locator_recipe.tableLocatorFilter=[].dbPush(myProgram.mainDS.current_workorder_id).dbPush(myProgram.mainDS.current_workorder_date_scheduled)
	the_locator_recipe.tableTargetCellHeading=heading
	var the_value=the_locator_recipe.prepare()
	if(the_value == null) the_value = ""
	
	return the_value
}
window.myAvatar.myCurrentWorkOrderInfo._methodName='myCurrentWorkOrderInfo'
window.myAvatar.myViewPurchaseOrdersPage = function()
{
	var the_recipe=new GUITemplateRecipe({initialConfigurationName:"generic_template"})
	var the_template=the_recipe.template
	the_template.dbPush('<div>')//
	the_template.dbPush('<div id="myPurchaseOrderGridDiv">')
	the_template.dbPush(myAvatar.myPurchaseOrderGrid())
	the_template.dbPush('</div>')

	the_template.dbPush('<div id="myPurchaseOrderPageDiv">')
	the_template.dbPush(this.myAddPurchaseOrderButtonTwoRecipe())
	the_template.dbPush('</div>')
	
	the_template.dbPush('</div>')//
	the_recipe.alert=false
	return the_recipe
}
window.myAvatar.myViewPurchaseOrdersPage._methodName='myViewPurchaseOrdersPage'
window.myAvatar.myEquipmentPage = function()
{
	var the_recipe=new GUITemplateRecipe({initialConfigurationName:"generic_template"})
	var the_template=the_recipe.template
	the_template.dbPush('<div>')//
	the_template.dbPush('<div style="font-family:arial;font-size:15;color:black">Current Equipment</div>')
	the_template.dbPush(myProgram.myEquipmentGrid())
	the_template.dbPush('<br/>')
	the_template.dbPush('<div style="font-family:arial;font-size:15;color:black">Other Equipment</div>')
	the_template.dbPush(myProgram.myEquipmentUnspecifiedGrid())
	the_template.dbPush('</div>')//
	the_recipe.alert=false
	return the_recipe
}
window.myAvatar.myEquipmentPage._methodName='myEquipmentPage'
window.myAvatar.myCollateralPage = function()
{
	var the_recipe=new GUITemplateRecipe({initialConfigurationName:"generic_template"})
	var the_template=the_recipe.template
	the_template.dbPush('<div>')//
	the_template.dbPush('<div id=wo_collateral_division>')
	the_template.dbPush(myProgram.myCollateralGrid())
	the_template.dbPush('</div>')
    the_template.dbPush('<br/>')
    the_template.dbPush(myProgram.myAddCollateralForm())
	the_template.dbPush(myProgram.myAddCollateralButtonRecipe()).dbPush('<br/>')
	the_template.dbPush('</div>')//
	the_recipe.alert=false
	return the_recipe
}
window.myAvatar.myCollateralPage._methodName='myCollateralPage'
window.myAvatar.myViewRecommendationPage = function()
{
	var the_recipe=new GUITemplateRecipe({initialConfigurationName:"generic_template"})
	var the_template=the_recipe.template
	//the_template.dbPush('<div>')//
	//the_template.dbPush('<br/>')
	//the_template.dbPush('<div style="font-family:arial;font-size:20;color:black">Recommendations For Work Order:'+(myProgram.mainDS.current_workorder_id)+'</div>')
 	//the_template.dbPush('<br/>')
 	var textAreaRecipe = myProgram.myRecommendationTextAreaRecipe()
 	textAreaRecipe.onchangeAttribute = "myAvatar.mySaveRecommendations()"
 	textAreaRecipe.alert=false
 	the_template.dbPush(textAreaRecipe)
 	the_template.dbPush('<br/>')
 	the_template.dbPush(myProgram.myRecommendationHelpButtonRecipe())
	//the_template.dbPush('</div>')//
	the_recipe.alert=false
	return the_recipe
}
window.myAvatar.myViewRecommendationPage._methodName='myViewRecommendationPage'
window.myAvatar.mySaveRecommendations = function()
{
	if(myProgram.mainDS.wo_recommendation_list == null) myProgram.mainDS.wo_recommendation_list = []
	var the_value = document.getElementById("recommendation_text_area").value
		
	var the_locator_recipe=new SUITableCellValueLocatorRecipe({"initialConfigurationName":"generic_table_cell_value_locator"})
	the_locator_recipe.tableRows=myProgram.mainDS.wo_recommendation_list
	the_locator_recipe.tableHeadings=myProgram.mainDS.wo_recommendation_headings
	the_locator_recipe.tableCellNewValue=the_value
	the_locator_recipe.tableLocatorHeading=myProgram.mainDS.wo_id_heading
	the_locator_recipe.tableLocatorFilter=myProgram.mainDS.current_workorder_id
	the_locator_recipe.tableTargetCellHeading='Recommendation'
	var the_old_value=the_locator_recipe.prepare()
	
	var the_locator_recipe=new SUITableCellValueLocatorRecipe({"initialConfigurationName":"generic_table_cell_value_locator"})
	the_locator_recipe.tableRows=myProgram.mainDS.wo_recommendation_list
	the_locator_recipe.tableHeadings=myProgram.mainDS.wo_recommendation_headings
	the_locator_recipe.tableCellNewValue="n"
	the_locator_recipe.tableLocatorHeading=myProgram.mainDS.wo_id_heading
	the_locator_recipe.tableLocatorFilter=myProgram.mainDS.current_workorder_id
	the_locator_recipe.tableTargetCellHeading='Transmitted'
	var the_old_value=the_locator_recipe.prepare()
	
	//2005-12-14 (jc)-[325]-Changed this check to compare to null, as locator recipe returns null or the located value.
	if(the_old_value == null)
	{
		//Insert the row.
		the_values = {};
		the_values["Work Order Id"] = myProgram.mainDS.current_workorder_id
		the_values["Recommendation"] = the_value
		the_values["ServerRN"] = "0"
		
		var the_row = myProgram.mainDS.wo_recommendation_headings.dbCreateRow(the_values, "wo_recommendation")
		
		myProgram.mainDS.wo_recommendation_list.push(the_row);
	}
	
	myProgram.mySubmitRecommendations()
}
window.myAvatar.mySaveRecommendations._methodName='mySaveRecommendations'
window.myAvatar.myAttachmentsGrid = function()
{
	if(myProgram.tempDS.selected_site_id == null)myProgram.tempDS.selected_site_id = ""
	var filter_params_one = {'ReferenceId':myProgram.mainDS.current_workorder_id,'ReferenceType':'WorkOrders'}
	var filter_params_two = {'ReferenceId':myProgram.tempDS.selected_site_id,'ReferenceType':'ClientSites'}
	return myProgram.myViewSiteAttachmentsGrid(filter_params_one, filter_params_two)
}
window.myAvatar.myAttachmentsGrid._methodName='myAttachmentsGrid'
window.myAvatar.myCreateWorkOrderPageFinalStep = function()
{
	var the_recipe = myProgram.myCreateWorkOrderPageFinalStep()
	the_recipe.parentElementId="createWorkOrderPageDiv"
	window["createWorkOrderPageDiv"].innerHTML = the_recipe.prepare()	
}
window.myAvatar.myCreateWorkOrderPageFinalStep._methodName='myCreateWorkOrderPageFinalStep'
window.myAvatar.myLoadCompletedWorkOrderPage = function()
{
	var workOrderInformation = myProgram.myPrepareInvoiceDataForWorkOrderId(myProgram.mainDS.current_workorder_id)
	sysFunctions.setInnerHTMLForElement("completedPageDiv", "<div style='display:inline'>"+myProgram.myCompletedWorkOrderSummaryGridSet(workOrderInformation).prepare()+"</div>")
}
window.myAvatar.myLoadCompletedWorkOrderPage._methodName='myLoadCompletedWorkOrderPage'
window.myAvatar.myEditPurchaseOrderPage = function(rowNumber)
{
	//Locator Values
	var po_number_index = myProgram.mainDS.wo_po_grid_headings.dbIndexOf("PO#")
	var po_number_value = myProgram.tempDS.wo_po_grid_list[rowNumber][po_number_index]
			
	var the_table=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'})
	the_table.sourceRows=myProgram.mainDS.wo_po_list
	the_table.sourceHeadings=myProgram.mainDS.wo_po_headings
	the_table.filterOnSourceHeadings=[].dbPush("PO#")
	the_table.filterValues=[].dbPush(po_number_value)
	the_table.targetHeadings=myProgram.mainDS.wo_po_headings
	var po_row_list=the_table.prepare()
	
	var po_row = po_row_list[0];
	myProgram.tempDS.current_edit_po_row = po_row
	var po_number_index = myProgram.mainDS.wo_po_headings.dbIndexOf("PO#")
	var po_number = po_row[po_number_index]
	
	myProgram.myLoadPurchaseOrderItems(po_number)
	
	myProgram.tempDS.current_edit_control=null
	
	var the_recipe=new GUITemplateRecipe({initialConfigurationName:"generic_template"})
	var the_template=the_recipe.template
	the_template.dbPush('<div>')//
	the_template.dbPush('<div style="font-family:arial;font-size:20;color:black">Edit Purchase Order: '+po_number+' </div>')

	the_template.dbPush(myProgram.myAddPurchaseOrderForm(po_row))
	the_template.dbPush(myAvatar.myChangePurchaseOrderButtonRecipe())
	the_template.dbPush('<br/>')
	
	the_template.dbPush('<div style="font-family:arial;font-size:20;color:black">Material Items</div>')
	the_template.dbPush(myProgram.myPOMaterialGrid())
	
	the_template.dbPush('<div style="font-family:arial;font-size:20;color:black">Other Items</div>')
	the_template.dbPush(myProgram.myPOOtherGrid())
	
	the_template.dbPush('<div>')//
	return the_recipe
}
window.myAvatar.myEditPurchaseOrderPage._methodName='myEditPurchaseOrderPage'
window.myAvatar.myLoadEditPOPage = function(rowNumber)
{
	sysFunctions.setInnerHTMLForElement("myPurchaseOrderPageDiv", myAvatar.myEditPurchaseOrderPage(rowNumber).prepare())
}
window.myAvatar.myLoadEditPOPage._methodName='myLoadEditPOPage'
window.myAvatar.myLoadAddPOPage = function()
{
	sysFunctions.setInnerHTMLForElement("myPurchaseOrderPageDiv", myAvatar.myAddPurchaseOrderPage().prepare())
}
window.myAvatar.myLoadAddPOPage._methodName='myLoadAddPOPage'
window.myAvatar.myAddPurchaseOrderButtonTwoRecipe = function()
{
	var the_button_recipe=new GUIInputFieldRecipe('{"initialConfigurationName":"generic_button_input_field",\
						"titleAttribute":"click add a new purchase order",\
						"valueAttribute":"Add Purchase Order","onclickAttribute":"__(\\\'myLoadAddPOPage\\\')"\
						}')
	return the_button_recipe
}
window.myAvatar.myAddPurchaseOrderButtonTwoRecipe._methodName='myAddPurchaseOrderButtonTwoRecipe'
window.myAvatar.myViewOpenWorkOrder = function(rowNumber, columnNumber)
{
	myProgram.mainDS.current_workorder_id=myProgram.mainDS.open_wo_list[rowNumber][columnNumber]
	
	wo_date_scheduled_index=myProgram.mainDS.open_wo_headings.dbIndexOf("Date Scheduled")
	wo_time_scheduled_index=myProgram.mainDS.open_wo_headings.dbIndexOf("Time Scheduled")
	myProgram.mainDS.current_workorder_date_scheduled = myProgram.mainDS.open_wo_list[rowNumber][wo_date_scheduled_index]
	myProgram.mainDS.current_workorder_time_scheduled = myProgram.mainDS.open_wo_list[rowNumber][wo_time_scheduled_index]
		
	//Locate the SiteId value for this work order.
	var the_locator_recipe=new SUITableCellValueLocatorRecipe({"initialConfigurationName":"generic_table_cell_value_locator"})
	the_locator_recipe.tableRows=myProgram.mainDS.wo_list
	the_locator_recipe.tableHeadings=myProgram.mainDS.wo_headings
	the_locator_recipe.tableLocatorHeading=[].dbPush(myProgram.mainDS.wo_id_heading).dbPush("Date Scheduled")
	the_locator_recipe.tableLocatorFilter=[].dbPush(myProgram.mainDS.current_workorder_id).dbPush(myProgram.mainDS.current_workorder_date_scheduled)
	the_locator_recipe.tableTargetCellHeading="SiteId"
	myProgram.tempDS.selected_site_id = the_locator_recipe.prepare()
	
	window["currentWorkOrderDiv"].innerHTML = this.myCurrentWorkOrderMessage()
	sysFunctions.setInnerHTMLForElement("currentWorkOrderContentDiv", myAvatar.currentWorkOrderTreeRecipe().prepare())
	this.myCurrentWorkOrderSelected()
}
window.myAvatar.myViewOpenWorkOrder._methodName='myViewOpenWorkOrder'
window.myAvatar.myCheckPODetails = function()
{
	//2005-12-19 (jc)-Adding a PO restriction: Must have at least one material/other item added.	
	if(myProgram.tempDS.wo_po_material_list.length == 0 && myProgram.tempDS.wo_po_other_list.length == 0)
	{
		alert("[Ref Code:30] There must be at least one Material/Other item added to this Purchase Order before it can be created.")
		return;
	}
	var the_vendor_combobox=window['add_vendor_combobox']
	if(the_vendor_combobox.options.length == 0)
	{
		alert("[Ref Code:25] There must be a vendor to create a purchase order.")
		return;
	}
	myProgram.myAddPurchaseOrderRow()
	alert("The Purchase Order has been successfully created.")
	myProgram.myRefreshMaterialSummaryGridForFormView()
	myProgram.myRefreshOtherSummaryGridForFormView()
	myProgram.myUpdateOtherHeading()
	myProgram.myUpdateMaterialHeading()
	myProgram.myHideSecondLayerWindow()
}
window.myAvatar.myCheckPODetails._methodName='myCheckPODetails'
window.myAvatar.myPurchaseOrderGrid = function()
{
	var the_grid = myProgram.myPurchaseOrderGrid()
	the_grid.cellOnClick = ["myProgram.myNewPage('edit_purchase_orders_page','_row_number_','_column_number_')"]
	
	return the_grid
}
window.myAvatar.myPurchaseOrderGrid._methodName='myPurchaseOrderGrid'
window.myAvatar.myWorkorderTreeOld = function()
{
	the_recipe=new GUITreeRecipe('{"initialConfigurationName":"example_tree_a","finalIngredients":{}}')
    the_recipe.leafContentsHTMLTemplate='<a href=# onclick="myAvatar.setContextParent(this)">_leaf_contents_</a>'
//	the_recipe.alert=true
//	the_recipe.onmouseoutAttribute='this.parentNode.parentNode.style.display=\'none\''
//	the_recipe.onmouseoverAttribute='this.parentNode.parentNode.style.display=\'block\''
	the_recipe.parentElementId='main_division'
	return the_recipe
}
window.myAvatar.myWorkorderTreeOld._methodName='myWorkorderTreeOld'
window.myAvatar.myChangePurchaseOrder = function()
{
	//Check the temp material/other datastores.
	if(myProgram.tempDS.wo_po_material_list.length == 0 && myProgram.tempDS.wo_po_other_list.length == 0)
	{
		alert("[Ref Code:31] There must be at least one Material/Other item added to a purchase order.")
		return;
	}
	//Delete the material/other rows in the mainDS lists that are associated with this Purchase order.
	var the_table=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'})
	the_table.sourceRows=myProgram.mainDS.wo_po_material_list
	the_table.sourceHeadings=myProgram.mainDS.wo_po_material_headings
	the_table.filterOnSourceHeadings=[].dbPush(myProgram.mainDS.wo_id_heading)
	the_table.filterOnSourceHeadings.dbPush("PO#")
	the_table.filterValues=[].dbPush(myProgram.mainDS.current_workorder_id)
	the_table.filterValues.dbPush(myProgram.po_number_exclude_filter)
	the_table.targetHeadings=myProgram.mainDS.wo_po_material_headings
	var new_wo_po_material_list=the_table.prepare()
	
	var the_table=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'})
	the_table.sourceRows=myProgram.mainDS.wo_po_other_list
	the_table.sourceHeadings=myProgram.mainDS.wo_po_other_headings
	the_table.filterOnSourceHeadings=[].dbPush(myProgram.mainDS.wo_id_heading)
	the_table.filterOnSourceHeadings.dbPush("PO#")
	the_table.filterValues=[].dbPush(myProgram.mainDS.current_workorder_id)
	the_table.filterValues.dbPush(myProgram.po_number_exclude_filter)
	the_table.targetHeadings=myProgram.mainDS.wo_po_other_headings
	var new_wo_po_other_list=the_table.prepare()
	
	myProgram.mainDS.wo_po_material_list = new_wo_po_material_list
	myProgram.mainDS.wo_po_other_list = new_wo_po_other_list
	
	var the_table=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'})
	the_table.sourceRows=myProgram.mainDS.wo_material_list
	the_table.sourceHeadings=myProgram.mainDS.wo_material_headings
	the_table.filterOnSourceHeadings=[].dbPush(myProgram.mainDS.wo_id_heading)
	the_table.filterOnSourceHeadings.dbPush("PO#")
	the_table.filterValues=[].dbPush(myProgram.mainDS.current_workorder_id)
	the_table.filterValues.dbPush(myProgram.po_number_exclude_filter)
	the_table.targetHeadings=myProgram.mainDS.wo_material_headings
	var new_wo_material_list=the_table.prepare()
	
	var the_table=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'})
	the_table.sourceRows=myProgram.mainDS.wo_other_list
	the_table.sourceHeadings=myProgram.mainDS.wo_other_headings
	the_table.filterOnSourceHeadings=[].dbPush(myProgram.mainDS.wo_id_heading)
	the_table.filterOnSourceHeadings.dbPush("PO#")
	the_table.filterValues=[].dbPush(myProgram.mainDS.current_workorder_id)
	the_table.filterValues.dbPush(myProgram.po_number_exclude_filter)
	the_table.targetHeadings=myProgram.mainDS.wo_other_headings
	var new_wo_other_list=the_table.prepare()
	
	myProgram.mainDS.wo_material_list = new_wo_material_list
	myProgram.mainDS.wo_other_list = new_wo_other_list
	
	var the_table=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'})
	the_table.sourceRows=myProgram.mainDS.wo_po_list
	the_table.sourceHeadings=myProgram.mainDS.wo_po_headings
	the_table.filterOnSourceHeadings=[].dbPush(myProgram.mainDS.wo_id_heading)
	the_table.filterOnSourceHeadings.dbPush("PO#")
	the_table.filterValues=[].dbPush(myProgram.mainDS.current_workorder_id)
	the_table.filterValues.dbPush(myProgram.po_number_exclude_filter)
	the_table.targetHeadings=myProgram.mainDS.wo_po_headings
	var new_wo_po_list=the_table.prepare()
	
	myProgram.mainDS.wo_po_list = new_wo_po_list
	myProgram.myAddPurchaseOrderRow()
	sysFunctions.setInnerHTMLForElement("myPurchaseOrderPageDiv", myAvatar.myAddPurchaseOrderButtonTwoRecipe().prepare())
	sysFunctions.setInnerHTMLForElement("myPurchaseOrderGridDiv", myAvatar.myPurchaseOrderGrid().prepare())
	sysFunctions.setInnerHTMLForElement("otherDiv", myProgram.myOtherGrid().prepare())
	sysFunctions.setInnerHTMLForElement("materialDiv", myProgram.myMaterialGrid().prepare())
}
window.myAvatar.myChangePurchaseOrder._methodName='myChangePurchaseOrder'
window.myAvatar.myChangePurchaseOrderButtonRecipe = function()
{
	var the_button_recipe=new GUIInputFieldRecipe('{"initialConfigurationName":"generic_button_input_field",\
						"titleAttribute":"click to change your purchase order",\
						"valueAttribute":"Change Purchase Order","onclickAttribute":"myAvatar.myChangePurchaseOrder()"\
						}')
	return the_button_recipe
}
window.myAvatar.myChangePurchaseOrderButtonRecipe._methodName='myChangePurchaseOrderButtonRecipe'
window.myAvatar.myResourcesTree = function()
{
	the_recipe=new GUITreeRecipe('{"initialConfigurationName":"example_tree_a","finalIngredients":{}}')
	return the_recipe
}
window.myAvatar.myResourcesTree._methodName='myResourcesTree'
window.myAvatar.showTreeNodes = function(top_node)
{
	var the_child_nodes=top_node.childNodes
	var node_count=the_child_nodes.length
	if(top_node.myisleaf=='yes')
	{
		top_node.parentNode.style.display='block'
	}
	for(var node_index=0;node_index<node_count;node_index++)
	{
		var next_child=the_child_nodes[node_index]
		myAvatar.showTreeNodes(next_child)
	}
}
window.myAvatar.showTreeNodes._methodName='showTreeNodes'
window.myAvatar.hideTreeNodes = function(top_node)
{
	var the_child_nodes=top_node.childNodes
	var node_count=the_child_nodes.length
	if(top_node.myisleaf=='yes')
	{
		if(!(top_node.nextSibling.firstChild.myisvisible=='yes'))
		{
			top_node.parentNode.style.display='none'
		}
	}
	for(var node_index=0;node_index<node_count;node_index++)
	{
		var next_child=the_child_nodes[node_index]
		myAvatar.hideTreeNodes(next_child)
	}
}
window.myAvatar.hideTreeNodes._methodName='hideTreeNodes'
window.myAvatar.mySaveSignature = function(child_window, dateTimeStamp)
{
	var signature_string=myProgram.myGetSignatureString(child_window)
	
	var the_first_name_element=child_window['customerNameInputElement']
	
	var first_name_string=the_first_name_element.value
	
	var current_date=new Date
	
	var values={}
	values['Date and Time']=dateTimeStamp
	values['Work Order Id']=myProgram.mainDS.current_workorder_id
	values['Signature']=signature_string
	values['First Name']=first_name_string
	values['Last Name']=""
	values['Transmitted']="n"
		
	var the_row=myProgram.mainDS.wo_signature_headings.dbCreateRow(values, "wo_signature")
	myProgram.mainDS.wo_signature_list.dbPush(the_row)
	myProgram.tempDS.current_signature_window = null;
	//sysFunctions.setInnerHTMLForElement("acceptanceSignaturesDiv", myAvatar.myAcceptanceSignaturePage().prepare())
}
window.myAvatar.mySaveSignature._methodName='mySaveSignature'
window.myAvatar.setContextParent = function(this_object)
{
	if(this_object.parentNode.previousSibling.myisleaf=='yes')
	{
		var this_color=this_object.style.backgroundColor
		if(this_color=='lightgreen')
		{
			this_object.style.backgroundColor='yellow'
			this_object.myisvisible='no'
		}
		else
		{
			this_object.style.backgroundColor='lightgreen'
			this_object.myisvisible='yes'
		}
	}
	var context_parent=window['context_menu'].mycontextparent
	if(context_parent!=null)
	{
		context_parent.innerHTML=''
		the_clone_nodes=window['context_menu'].lastChild.cloneNode(true)
		context_parent.appendChild(the_clone_nodes)
		myAvatar.hideTreeNodes(context_parent.firstChild)
	}
}
window.myAvatar.setContextParent._methodName='setContextParent'
window.myAvatar.myLaborGrid2 = function()
{
  var the_recipe= __("myLaborGrid")
  the_recipe.alert=true
  return the_recipe
}
window.myAvatar.myLaborGrid2._methodName='myLaborGrid2'
window.myAvatar.GUISimpleGridRecipe_generic_simple_grid_tabs = function(this_object)
{
			this_object.headingOnClick=[]
//			this.cellDefaultStyle="border-color:black;text-align:left;vertical-align:top"
			this_object.cellDefaultStyle='font-family:arial;color:black;font-size:10; background-color:white;border-style:solid;border-color:white;'
			
			this_object.headingDefaultStyle='font-family:arial;color:black;font-size:10; background-color:#ffff66;border-style:solid;border-color:#ffff66;;'
//			this.headingDefaultStyle='font-family:arial;color:black;font-size:10; background-color:#ffff66;border-style:solid;border-color:black;'

			this_object.gridStyle='font-family:arial;font-size:10;color:black;;text-align:left;vertical-align:top;background-color:white;border-color:black'

}
window.myAvatar.GUISimpleGridRecipe_generic_simple_grid_tabs._methodName='GUISimpleGridRecipe_generic_simple_grid_tabs'
window.myAvatar.GUISimpleGridRecipe_generic_simple_grid_with_horizontal_scrolling = function(this_object)
{
	this_object.gridUnits="pt"
	this_object.gridHeight=220
	this_object.gridWidth=200
	//scrollingHeight must be set if grid recipes are to appear with correct indentation in tree recipes
	this_object.scrollingHeight=100
	this_object.headingHeight=14
	this_object.gridHeadingRowTag="div"
	this_object.gridHeadingRowTagAttributes=""
	this_object.gridHeadingTag="div"
	this_object.gridTag="div"
	this_object.gridRowTag="div"
	this_object.gridCellTag="div"
	this_object.cellDefaultStyle="white-space:nowrap;display:inline;border:1 solid black;overflow:hidden;text-overflow:ellipsis;font-family:arial;color:black;;text-align:left;vertical-align:top;background-color:white;"
	this_object.headingDefaultStyle="white-space:nowrap;display:inline;border:1 solid black;overflow:hidden;text-overflow:ellipsis;font-family:arial;color:black;;text-align:left;vertical-align:top;background-color:#EEEEEE;"
	this_object.gridStyle='display:inline;overflow:hidden;font-family:arial;font-size:10;color:black;;text-align:left;vertical-align:top;background-color:white;border-color:black'

}
window.myAvatar.GUISimpleGridRecipe_generic_simple_grid_with_horizontal_scrolling._methodName='GUISimpleGridRecipe_generic_simple_grid_with_horizontal_scrolling'
window.myAvatar.myChangeStatusComboBox = function()
{
	if(myProgram.isWorkOrderUnbilled())
	{
		return myUnbilledPage.myPendingChargesStatusDivRecipe()
	}
	else if(myProgram.isWorkOrderCompleted())
	{
		return myCompletedPage.myCompletedStatusDivRecipe()
	}
	else if(myProgram.isWorkOrderQuote())
	{
		return myProgram.myQuoteStatusDiv()
	}
	else
	{
		return myProgram.myChangeStatusComboBox()
	}
}
window.myAvatar.myChangeStatusComboBox._methodName='myChangeStatusComboBox'
window.myAvatar.myCellOnClick = function()
{
	myProgram.myFormGridCellOnClick()
}
window.myAvatar.myCellOnClick._methodName='myCellOnClick'
window.myAvatar.GUIFormGridRecipe_example_navigation_grid_2 = function(this_object)
{
	
	//var equipmentRowArray = myProgram.myPrepareInvoiceDataForWorkOrderId(myProgram.mainDS.current_workorder_id)
	//var invoiceSummaryDict = myProgram.myCODInvoiceSummaryDict(equipmentRowArray)

	this_object.cellBackgroundColor="white"
	this_object.cellHeadingBackgroundColorWhenEnabled="#99cdff"
	this_object.cellHeadings=["<div style='height:54px;width:100%;text-align:center;vertical-align:middle;background-color:white;font-size:11px;color:black;font-family:arial;font-weight: 600;padding:10px'>WO #"+myProgram.mainDS.current_workorder_id+"</div>"//1
							 ,"Date"//2
							 ,"Contact"//3
							 ,"Phone"//4
							 ,"Work Code"//5
							 ,"Work Order Status"//6
							 ,"Address"//7
							 ,"Directions to Site"//8
							 ,"Work Requested"//9
							 ,"Call Script"//10
							 ,"Equipment"//11
							 ,((myProgram.isWorkOrderQuote()) ? "Scope of Quoted Services" : "Work Performed")//12
							 ,"Materials"//13
							 ,"Labor"//14
							 ,((myProgram.isWorkOrderQuote()) ? "Quoted Charges" : "Sub-Contractor Charges")//15
							 ,"<table style='width:100%;font-size:11px;font-weight:900;height:10px' cellpadding='0' cellspacing='0'><tr><td width='90%'>Recommendations</td><td width=10%>"+((myProgram.isWorkOrderReadOnly()) ? "" : myProgram.mySubmitRecommendationsButtonHTML())+"</td></tr></table>"//16
							 ,"&nbsp;"//17
							 ,"&nbsp;"//18
							]
						
	this_object.cellContents=[null//1
							 ,myProgram.myDateScheduledForFormView()//2
							 ,myProgram.myContactForFormView()//3
							 ,myProgram.myPhoneForFormView()//4                   
							 ,myProgram.myWorkCodeForFormView()//5
							 ,__('myChangeStatusComboBox')//6
							 ,myProgram.myCustomerAddress()//7
							 ,myProgram.myDirectionsForFormView()//8
							 ,myProgram.myWorkRequestedForFormView()//9
							 ,myProgram.myIncomingCallScriptGrid()//10
							 ,myProgram.myCurrentEquipmentGrid()//11
							 ,myProgram.myWorkPerformedGridForFormView()//12
							 ,//myProgram.myMaterialSummaryGridDiv()//13
							 ,//myProgram.myLaborSummaryGridDiv()//14
							 ,myProgram.myOtherSummaryGridDiv()//15
							 ,myProgram.myViewRecommendationsForFormView()//16 
							 ,myProgram.myPaymentAreaHTMLForFormView()//17
							 ,myProgram.myBottomRowButtons()//18
							 								
								]
								
	this_object.cellHotSpotEnabled=[false,false,
									false,false,false,false,false,false,false,
									false,false,false,
									false,false,false,false,false,
									false,
									false,false,false,
									false,
									false,
									false,false,false,
									false,false,
									false,false,
									false,false,false,false,false,false,
									false,false,false,false,false			
									]
	this_object.cellBorders=[["top","right","left"],
							 ["top","right"],
							 ["top","right"],
							 ["top","right"],
							 ["top","right"],
							 ["top","right"],
							 ["top","right","left","bottom"],
							 ["top","right","bottom"],
							 ["top","right","bottom"],
							 ["top","right","left","bottom"],
							 ["top","right","left","bottom"],
							 ["top","right","left","bottom"],
							 ["top","right","bottom","left"],
							 ["top","right","bottom","left"],
							 ["top","right","bottom","left"],
							 ["top","bottom","left"],
							 ["top","bottom","left","right"],//17
							  [],
							  [],
							  ["left","right","top","bottom"],["left","right"],
							  null,
							  ["bottom"],
							  ["left","right","top"],["left","right","top"],["left","right","top"],
							  "all",["top","bottom","right"],
							  "all","all",
							  "all","all","all","all","all","all",
							  "all","all","all","all","all"
								]
    var offset = 18	
	var rowOneWidths = sysFunctions.makeColumnWidthsEqualTotal([123,123,123,123,123,123], sysFunctions.getTechAnywhereScreenWidth()-offset)
	var rowTwoWidths = sysFunctions.makeColumnWidthsEqualTotal([250,250,250], sysFunctions.getTechAnywhereScreenWidth()-offset)
	var rowThreeWidths = sysFunctions.makeColumnWidthsEqualTotal([750], sysFunctions.getTechAnywhereScreenWidth()-offset)
	var rowFourWidths = sysFunctions.makeColumnWidthsEqualTotal([750], sysFunctions.getTechAnywhereScreenWidth()-offset)
	var rowFiveWidths = sysFunctions.makeColumnWidthsEqualTotal([750], sysFunctions.getTechAnywhereScreenWidth()-offset)
	var rowSixWidths = sysFunctions.makeColumnWidthsEqualTotal([750], sysFunctions.getTechAnywhereScreenWidth()-offset)
	var rowSevenWidths = sysFunctions.makeColumnWidthsEqualTotal([750], sysFunctions.getTechAnywhereScreenWidth()-offset)
	var rowEightWidths = sysFunctions.makeColumnWidthsEqualTotal([750], sysFunctions.getTechAnywhereScreenWidth()-offset)
	var rowNineWidths = sysFunctions.makeColumnWidthsEqualTotal([375,375], sysFunctions.getTechAnywhereScreenWidth()-offset)
	var rowTenWidths = sysFunctions.makeColumnWidthsEqualTotal([750], sysFunctions.getTechAnywhereScreenWidth()-offset)
	var rowElevenWidths = sysFunctions.makeColumnWidthsEqualTotal([750], sysFunctions.getTechAnywhereScreenWidth()-offset)
	this_object.cellExtents=[[rowOneWidths[0],36]//1
							,[rowOneWidths[1],36]//2
							,[rowOneWidths[2],36]//3
							,[rowOneWidths[3],36]//4
							,[rowOneWidths[4],36]//5
							,[rowOneWidths[5],36]//6
							,[rowTwoWidths[0],83]//7
							,[rowTwoWidths[1],83]//8
							,[rowTwoWidths[2],83]//9
							,[rowThreeWidths[0],101]//10 750
							,[rowFourWidths[0],84/*101*/]//11 750
							,[rowFiveWidths[0],84/*101*/]//12
							,[0,0]//[rowSixWidths[0],101]//13
							,[0,0]//[rowSevenWidths[0],101]//14
							,[rowEightWidths[0],84/*101*/]//15
							,[rowNineWidths[0],121]//16
							,[rowNineWidths[1],121]//17
							,[rowTenWidths[0],82]//18
							]//41
							
	this_object.cellPositions=[[0,0]//1
							  ,[rowOneWidths[0]+2,0]//2
							  ,[rowOneWidths[0]+rowOneWidths[1]+3,0]//3
							  ,[rowOneWidths[0]+rowOneWidths[1]+rowOneWidths[2]+4,0]//4 375
							  ,[rowOneWidths[0]+rowOneWidths[1]+rowOneWidths[2]+rowOneWidths[3]+5,0]//5 500
							  ,[rowOneWidths[0]+rowOneWidths[1]+rowOneWidths[2]+rowOneWidths[3]+rowOneWidths[4]+6,0]//6 625
							  ,[0,36]//7
							  ,[rowTwoWidths[0]+2,36]//8 250
							  ,[rowTwoWidths[0]+rowTwoWidths[1]+3,36]//9 500
							  ,[0,122]//10
							  ,[0,226]//11
							  ,[0,313/*330*/]//12 //326
							  ,[0,0]//13 //415
							  ,[0,0]//14
							  ,[0,400/*434*/]//15
							  ,[0,489/*538*/]//16
							  ,[rowNineWidths[0],489/*538*/]//17 375
							  ,[0,613/*665*/]//18
							  ]//41
							  
							 /* [0,0]//1
							  ,[rowOneWidths[0],0]//2
							  ,[rowOneWidths[0]+rowOneWidths[1],0]//3
							  ,[rowOneWidths[0]+rowOneWidths[1]+rowOneWidths[2],0]//4 375
							  ,[rowOneWidths[0]+rowOneWidths[1]+rowOneWidths[2]+rowOneWidths[3],0]//5 500
							  ,[rowOneWidths[0]+rowOneWidths[1]+rowOneWidths[2]+rowOneWidths[3]+rowOneWidths[4],0]//6 625
							  ,[0,36]//7
							  ,[rowTwoWidths[0],36]//8 250
							  ,[rowTwoWidths[0]+rowTwoWidths[1],36]//9 500
							  ,[0,122]//10
							  ,[0,226]//11
							  ,[0,330]//12 //326
							  ,[0,0]//13 //415
							  ,[0,0]//14
							  ,[0,642]//15
							  ,[0,746]//16
							  ,[rowNineWidths[0],746]//17 375
							  ,[0,870]//18
							  ,[1,435]//19*/
	this_object.cellOnClickEnabled=[false,//1
									false,//2
									false,//3
									false,//4
									false,//5
									false,//6
									false,//7
									false,//8
									false,//9
									false,//10
									false,//11
									false,//12
									false,//13
									false,//14
									false,//15
									false,//16
									false,//17
									false,//18
									]//41
	this_object.cellIds=[]
	this_object.cellIds[10]="addEquipment"
	this_object.cellIds[21]="addEquipment1"
	this_object.cellIds[23]="addMaterial"
	this_object.cellIds[24]="addLabor"
	this_object.cellIds[25]="addOther"
	this_object.cellIds[27]="addPurchaseOrder"
	this_object.cellIds[29]="addSignature"
	this_object.cellIds[38]="addWorkPerformed"
	this_object.cellIds[11]="viewWorkPerformed"
	this_object.cellIds[39]="viewEquipmentInformation"
	this_object.cellIds[40]="addMetrics"
	this_object.cellIds[19]="addEditEquipmentDiv"

	this_object.cellWidth = 1
	this_object.cellHeight = 1
	this_object.gridUnits="px"
	this_object.gridLeftMargin=1
	this_object.gridTopMargin=1
	this_object.cellHeadingStyles[1] = ";padding-left:5px;text-align:left"				
	this_object.cellHeadingStyles[2] = ";padding-left:5px;text-align:left"				
	this_object.cellHeadingStyles[3] = ";padding-left:5px;text-align:left"				
	this_object.cellHeadingStyles[4] = ";padding-left:5px;text-align:left"				
	this_object.cellHeadingStyles[5] = "display:none"
	this_object.cellHeadingStyles[4] = ";padding-left:5px;text-align:left"				
	//this_object.cellContentStyles[5] = "padding:6px;text-align:center"				
	this_object.cellHeadingStyles[6] = ";padding-left:5px;text-align:left"				
	this_object.cellHeadingStyles[7] = ";padding-left:5px;text-align:left"
	this_object.cellHeadingStyles[11] = ";text-align:right;"
	this_object.cellHeadingStyles[12] = ";text-align:right;"
	this_object.cellHeadingStyles[13] = ";text-align:right;"
	this_object.cellHeadingStyles[14] = ";text-align:right;"
	this_object.cellHeadingStyles[19] = ";text-align:right"			
	this_object.cellHeadingStyles[8] = ";padding-left:5px;text-align:left"
	//this_object.cellHeadingStyles[11] = "display:block"
	this_object.cellHeadingStyles[17] = "display:none"
	this_object.cellContentStyles[19] = "display:none"
	this_object.cellHeadingStyles[15] = ";padding-left:5px;text-align:left"
	this_object.cellHeadingStyles[16] = ";padding-left:5px;text-align:left;display:block;"
	this_object.cellFontSize = "11"
	this_object.cellDefaultBorderStyle = "1px solid #99bbe8"			
	this_object.breakpointOnPrepare=false
	this_object.styleAttribute += ";background-color:white;"
	
	for(var i = 0; i < this_object.cellHeadings.length; i++)
	{
		this_object.cellHeadingStyles[i] += ";border-color: #99bbe8;font-weight:900;height:15px;border-right:1px;text-align:center;background-color:#d3e1f1;;font-size:11px;display:block;background-image: url(images/titlebg.gif);background-repeat: repeat-x;font-family:arial;border-bottom:1px solid #99bbe8;text-align:center;padding:1px;"
	}
	
}
window.myAvatar.GUIFormGridRecipe_example_navigation_grid_2._methodName='GUIFormGridRecipe_example_navigation_grid_2'
window.myAvatar.GUISimpleGridRecipe_formview_grid = function(this_object)
{
    this_object.outerDivBorderWidth = "0px"
    
	/*this_object.headingDefaultStyle="font-family:arial;color:black;font-size:11; background-color:#99cdff;border-style:solid;border-color:#676566;border-width:0 1 1 0;padding:1"
	this_object.rowStyle="height:10"
	this_object.cellDefaultStyle = "font-size:11;color:black;border-color:#676566;text-align:left;vertical-align:top;border-width:0 1 1 0;padding:1;font-family:arial;"
	this_object.gridStyle+=";border-width:0;"
	this_object.styleAttribute+=";border-width:0;"
	this_object.outerDivBorderWidth="0 0 0 0"//Changed tell Bill*/
}
window.myAvatar.GUISimpleGridRecipe_formview_grid._methodName='GUISimpleGridRecipe_formview_grid'
window.myAvatar.GUISimpleGridRecipe_generic_simple_data_entry_grid_ = function(this_object)
{
	this_object.gridUnits="pt"
	this_object.gridHeight=220
	this_object.gridWidth=500
	//scrollingHeight must be set if grid recipes are to appear with correct indentation in tree recipes
	this_object.scrollingHeight=100
	this_object.headingHeight=20
	this_object.gridHeadingRowTag="div"
	this_object.gridHeadingRowTagAttributes=""
	this_object.gridHeadingTag="div"
	this_object.gridTag="div"
	this_object.gridRowTag="div"
	this_object.gridCellTag="div"
	this_object.cellDefaultStyle="white-space:nowrap;display:inline;border:1 solid black;overflow:hidden;text-overflow:ellipsis;font-family:arial;color:black;;text-align:left;vertical-align:top;background-color:white;"
	this_object.headingDefaultStyle="white-space:nowrap;display:inline;border:1 solid black;overflow:hidden;text-overflow:ellipsis;font-family:arial;color:black;;text-align:left;vertical-align:top;background-color:red;"
	this_object.gridStyle='display:inline;overflow:hidden;font-family:arial;font-size:20;color:black;;text-align:left;vertical-align:top;background-color:white;border-color:black'

}
window.myAvatar.GUISimpleGridRecipe_generic_simple_data_entry_grid_._methodName='GUISimpleGridRecipe_generic_simple_data_entry_grid_'
window.MyRecipe._superclass = function TopObject() {}
window.MyRecipe._superclass._methodName='_superclass'
window.MyRecipe._superclassName = "TopObject"
window.myData.example_data = {
"example_data_entry_grid_rows":
[
["100.00","300","column c","column d",2],
["300.1","column f","column g","column h",1]],
"example_data_entry_grid_headings":
["heading 1","heading 2","heading 3","heading 4","RN"],
"example_data_entry_data_rows":
[
[1,"300.1","column f","column g","column h"],
[2,"100.00","300","column c","column d"]],
"example_data_entry_data_headings":
["RN","heading 1","heading 2","heading 3","heading 4"]}
window.myData.grid_widths = {
"myFormGridForOther":
[60,170]}
window.myData.grid_headings = {
"myEquipmentGrid":
["Equipment Id","Manufacturer","Model","Serial Number","Equipment Name","Metrics","Task List","Parts List","RN"],
"myOtherGridCOD":
["Quantity","Other Rate Id","Other Rate Description","Equipment Id","PO#","Unit Price","BillQty","Price","Taxable","Work Order Id","Status","RN","ServerPO"],
"myOtherGridNonCOD":
["Quantity","Other Rate Id","Other Rate Description","Equipment Id","PO#","Work Order Id","BillQty","Transmitted","RN","ServerPO"],
"myCODLaborGrid":
["Technician Id","Equipment Id","Hours","Labor Type Id","Pay Type Id","Period Id","Date","Unit Price","BillHours","Price","Taxable","Work Order Id","Description","Transmitted","RN"],
"myClosingScriptGrid":
["Question","Response","RN"],
"myEditMetricsGrid":
["Equipment Id","Description","Metrics Date","Metrics Measurement","RN"],
"myMaterialGridCOD":
["Quantity","Part Number","","Description","Equipment Id","Location Id","PO#","Unit Price","BillQty","Price","Taxable","Work Order Id","Transmitted","RN","ServerPO"],
"myMaterialGridNonCOD":
["Quantity","Part Number","","Description","Equipment Id","Location Id","PO#","BillQty","Transmitted","Work Order Id","RN","Transmitted","ServerPO"],
"myPMPartsGrid":
["Quantity","Part Number","Part Description",""],
"myPMTasksGrid":
["Task Description",""],
"myNonCODLaborGrid":
["Technician Id","Equipment Id","Hours","Labor Type Id","Pay Type Id","Period Id","Date","BillHours","Work Order Id","Description","Transmitted","RN"],
"myFlatRateGrid":
["Quantity","Flat Rate Id","Description","Equipment Id","Price Level","Unit Price","Price","Taxable","Work Order Id","Transmitted","RN"],
"myPOMaterialGrid":
["Quantity","Part Number","","Description","Equipment Id","Unit Cost","PO#","Work Order Id","Transmitted","RN","POQty","BillQty"],
"myPOOtherGrid":
["Quantity","Other Rate Id","Other Rate Description","Equipment Id","Unit Cost","PO#","Work Order Id","RN","Transmitted","POQty","BillQty"]}
window.MyRecipe.prototype.myUploadCollateralFiles = function(workOrderId)
{
    myProgram.myCreateCollateralFolderIfItDoesntExist()
    myProgram.myCreateWorkOrderCollateralFolder(workOrderId)
    
    //var fso = new ActiveXObject("Scripting.FileSystemObject")
    //var folder = fso.GetFolder(myProgram.mySpecifiedCurrentDirectory+"/Collateral/"+workOrderId)
    var folderName = myProgram.mySpecifiedCurrentDirectory+"/Collateral/"+workOrderId.trim()
    myProgram.mydbLogMessage("UPLOAD DEBUG", "", "Processing Folder \""+folderName+"\" Started.");
    
    return myProgram.myProcessCollateralFolder(folderName)
}
window.MyRecipe.prototype.myUploadCollateralFiles._methodName='myUploadCollateralFiles'
window.MyRecipe.prototype.myPrepareFileForUpload = function(file, RN)
{
    var tokens = file.split("\\")
    
    this.myCreateFolderIfDoesNotExist(this.mainDS.current_workorder_id.trim())
    
    var fileName = tokens[tokens.length - 1]
    var newName = "["+this.mainDS.current_workorder_id.trim()+" "+RN+"] "+fileName
    this.myCopyFileOrFolder(file, this.myCurrentDirectory('back', false)+"\\Collateral\\"+this.mainDS.current_workorder_id.trim()+"\\"+newName)
    
    return newName
}
window.MyRecipe.prototype.myPrepareFileForUpload._methodName='myPrepareFileForUpload'
window.MyRecipe.prototype.areChargeQuantitiesValid = function()
{
    var the_table=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'})
    the_table.sourceRows=((myProgram.isWorkOrderQuote()) ? this.mainDS.wo_quote_list : this.mainDS.wo_other_list)
    the_table.sourceHeadings=this.mainDS.wo_other_headings
    the_table.targetHeadings=this.mainDS.wo_other_headings
    the_table.filterOnSourceHeadings=[].dbPush("Quantity")
    the_table.filterValues=[].dbPush(function(val)
                                     {
                                         var quantity = val.value
                                         if(quantity.trim() == "" || quantity.trim() == ".") quantity = 0
                                         return (parseFloat(quantity) == 0.0)
                                     })
    var results=the_table.prepare()
    return (results.length == 0)
}
window.MyRecipe.prototype.areChargeQuantitiesValid._methodName='areChargeQuantitiesValid'
window.MyRecipe.prototype.myTransmitCharges = function(messageDisplayed)
{
    if(!myProgram.areChargesAvailableToTransmitted()) 
    {
        alert("No charges found to submit"); 
        return
    }
    if(!myProgram.areChargeQuantitiesValid())
    {
        alert("Quantities must be greater than zero.")
        return
    }
    if(messageDisplayed == null)
    {
        document.body.style.cursor='wait'
        window.setTimeout("myProgram.setInformationMessage('Please wait while changes are submitted...');myProgram.myTransmitCharges(true)",1000)
        return
    }
    
    if(myProgram.mySendTransmitChargesMessage())
    {
                
        //myProgram.myReloadData([((myProgram.isWorkOrderQuote()) ? "wo_quote_list" : "wo_other_list")])
               
                myProgram.myRefreshOtherSummaryGridForFormView()
        myProgram.myRefreshPaymentArea()
        //alert("Your charges have been successfully sent.")
        document.body.style.cursor='auto'
        myProgram.disableInformationMessage()
        myProgram.myHideSecondLayerWindow()
        return true
    }
    else
    {
        alert("A problem occurred trying to post your changes.  Your changes have NOT been submitted.  Please try again.")
        document.body.style.cursor='auto'
        myProgram.disableInformationMessage()
        myProgram.myHideSecondLayerWindow()
        //myProgram.myShowAddEditOther()
        return false
    }
}
window.MyRecipe.prototype.myTransmitCharges._methodName='myTransmitCharges'
window.MyRecipe.prototype.myQuantityFieldHasChanged = function(quantityInputElement)
{
    /*
    2008-04-11 (jc)-[2075]-PO Edits
    */
    if(myProgram.isElementTransmitted(quantityInputElement))
    {
        return "[Ref Code:7] This entry has already been submitted. Additional changes are not permitted"            
    }
    
    /*
    Material Quantity can be changed in any way if not part of a PO or part of a server PO, except if qty is negative
    Other quantity cannot be changed in any way if part of a PO or server PO 
    */
    if(myProgram.isElementPartOfPO(quantityInputElement))
    {
        if(myProgram.getTypeOfGrid(quantityInputElement) == "other")
        {
            return "[Ref Code:6] This other item is part of a purchase order and cannot be changed"
        }
        
        if(myProgram.isElementPartOfServerPO(quantityInputElement))
        {
            if(quantityInputElement.value*1 < 0)
            {
                return "[Ref Code:43] This item has a negative quantity and so cannot be changed."
            }
        }
            
        if(myProgram.isQuantityAbovePOQuantity(quantityInputElement))
        {
            //quantityInputElement.mycurrentvalue = myProgram.myPOQtyForMaterialElement(quantityInputElement)
            return "[Ref Code:21] The Quantity must be less than or equal to the original purchase order quantity."
        }
    }
        
    var billQuantityInputElement = sysFunctions.locateAdjacentColumnInputNode(quantityInputElement, "BillQty")
    if(billQuantityInputElement != null)//Null on Add Purchase Order Page
    {
        billQuantityInputElement.value = billQuantityInputElement.mycurrentvalue = quantityInputElement.value
        sysFunctions.updateDataValue(billQuantityInputElement, billQuantityInputElement.value)
        myProgram.myBillQuantityHasChanged(billQuantityInputElement)
    }
}
window.MyRecipe.prototype.myQuantityFieldHasChanged._methodName='myQuantityFieldHasChanged'
window.MyRecipe.prototype.myCheckoutDialogHTML = function(workOrderId, dateScheduled, timeScheduled, oldStatus)
{
    
    if(timeScheduled.split(":").length > 2)
    {
        var tokens = timeScheduled.split(":")
        var timeArray = [tokens[0],tokens[1]]
        timeScheduled = timeArray.join(":")
    }
    
    return "<div style='padding:20px'><table style='font-size:12px;font-family:arial;'>\
                <tr>\
                    <td><input checked onclick='document.getElementById(\"returntripdatetimerow\").style.visibility=\"hidden\"' value='finishjob' name='checkoutradio' type='radio' style='font-size:12px;font-family:arial;'/></td>\
                    <td>Finish job</td>\
                    <td>&nbsp;</td>\
                </tr>\
                <tr>\
                    <td><input onclick='document.getElementById(\"returntripdatetimerow\").style.visibility=\"visible\"' value='returntrip' name='checkoutradio' type='radio' style='font-size:12px;font-family:arial;'/></td>\
                    <td>Return Trip</td>\
                    <td>&nbsp;</td>\
                </tr>\
                <tr id='returntripdatetimerow' style='visibility:hidden'>\
                    <td>&nbsp;</td>\
                    <td>&nbsp;</td>\
                    <td>\
                        <table>\
                            <tr>\
                                <td><span style='font-family:arial;font-size:12;vertical-align:center'>ETA Date:&nbsp;</td><td>"+myPendingWorkOrderPage.myETADateInputField(dateScheduled).prepare()+"<button style='border:none;width:27px;height:22px;' id='trigger'><img src='calendar.gif'/></button></td>\
                            </tr>\
                            <tr>\
                                <td><span style='font-family:arial;font-size:12;vertical-align:center'>ETA Time:&nbsp;</td><td>"+myPendingWorkOrderPage.myETATimeInputField(timeScheduled).prepare()+"</td>\
                            </tr>\
                        </table>\
                    </td>\
                </tr>\
                <tr>\
                    <td>&nbsp;</td>\
                    <td>"+this.myCloseCheckoutDialogButton(workOrderId, dateScheduled, timeScheduled, oldStatus).prepare()+"</td>\
                    <td>&nbsp;</td>\
                </tr>\
            </table></div>"
}
window.MyRecipe.prototype.myCheckoutDialogHTML._methodName='myCheckoutDialogHTML'
window.MyRecipe.prototype.validateReturnTripForm = function()
{
    var dateScheduled = document.getElementById("eta_date_input_field").value
    var timeScheduled = document.getElementById("eta_time_input_field").value
    
    var messages = []
    if(!dateScheduled.validateFormat('generic_date'))
    {
        messages.push("- The date entered is not a valid military date format.")
    }
    if(!timeScheduled.validateFormat('generic_time_without_seconds'))
    {
        messages.push("- The time entered is not a valid military time format.")
    }
    if(timeScheduled.trim() == "00:00")
    {
        messages.push("- The time entered is not valid.")
    }
    if(messages.length > 0)
    {
        var messageString = "Please correct the following:\r\r"+messages.join("\r")
        alert(messageString)
        return false
    }
    return true
}
window.MyRecipe.prototype.validateReturnTripForm._methodName='validateReturnTripForm'
window.MyPendingWorkOrderPage.prototype.myAcceptPendingWorkOrder = function(messageDisplayed)
{
        if(!messageDisplayed)
        {
            myProgram.setInformationMessage()
            window.setTimeout("myPendingWorkOrderPage.myAcceptPendingWorkOrder(true)",100)
            return
        }
    var userETADate = document.getElementById("eta_date_input_field").value
    var userETATime = document.getElementById("eta_time_input_field").value
    
    var messages = []
    if(!userETADate.validateFormat('generic_date'))
    {
        messages.push("- The ETA date entered is not a valid military date format.")
    }
    if(!userETATime.validateFormat('generic_time_without_seconds'))
    {
        messages.push("- The ETA time entered is not a valid military time format.")
    }
    if(userETATime.trim() == "00:00")
    {
        messages.push("- The ETA time entered is not valid.")
    }
    if(messages.length > 0)
    {
        var messageString = "Please correct the following:\r\r"+messages.join("\r")
        myProgram.disableInformationMessage()
                alert(messageString)
        return
    }
    
    var originalETADate = myProgram.mainDS.pending_workorder_date_scheduled
    var originalETATime = myProgram.mainDS.pending_workorder_time_scheduled
    
    if(originalETADate.trim() != userETADate.trim())
    {
        //Set current pending workorder status to "Rescheduled"
        var newStatus = "Rescheduled"
    }
    else
    {
        //Set current pending workorder status to "Waiting Service"
        var newStatus = "Waiting Service"
    }
    
    
    if(myAvatar.myAcknowledgeWorkOrderDo(newStatus, userETADate, userETATime))
    {
        myProgram.myHideSecondLayerWindow()
    }
}
window.MyPendingWorkOrderPage.prototype.myAcceptPendingWorkOrder._methodName='myAcceptPendingWorkOrder'
window.MyQuotePage.prototype.myGrid = function(parms)
{
    if(parms == null)
    {
        var parms={}
        parms.dateScheduledFilter = myProgram.tempDS.current_wo_filter
        parms.filter_function=this.myGridFilterFunction
        parms.page="view_quote_workorder_page"
        parms.list = "quote_wo_list"
    }
    var open_wos_grid=new GUISimpleGridRecipe('{"initialConfigurationName":"formview_grid",minRowCount:10}')
    
    open_wos_grid.idAttribute="quote"
    var wo_table=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'})
    open_wos_grid.columnWidths=sysFunctions.makeColumnWidthsEqualTotal([70,169,85,85,40,80,91], sysFunctions.getTechAnywhereScreenWidth()-63)
    open_wos_grid.gridHeight=400
    open_wos_grid.scrollingHeight="0;height:187px;overflow:scroll;"
    open_wos_grid.gridWidth=sysFunctions.getTechAnywhereScreenWidth()-14//740
    wo_table.sourceRows=myProgram.mainDS.wo_list
    wo_table.sourceHeadings=myProgram.mainDS.wo_headings
    var filter_function=function(val){return(val.value=='n')}
    wo_table.filterOnSourceHeadings=[].dbPush(myProgram.mainDS.wo_pending_heading).dbPush('Status')
    wo_table.filterValues=[].dbPush('n').dbPush(parms.filter_function)
    
    //2006-04-14 (jc)-[791] Adding Work order Date filter functionality.
    if(parms.dateScheduledFilter != null)
    {
        wo_table.filterOnSourceHeadings.dbPush('Date Scheduled')
        wo_table.filterValues.dbPush(parms.dateScheduledFilter)
    }
    
    open_wos_grid.sortColumnHeadings = myProgram.mainDS.quote_wo_headings
    open_wos_grid.gridInstanceString = "myQuotePage.myGrid()" //
    open_wos_grid.sortRowsLocation = "myProgram.mainDS.quote_wo_list"
    
    wo_table.sortOnSourceHeadings=[].dbPush("DateCompleted").dbPush(myProgram.mainDS.wo_id_heading)
    wo_table.targetHeadings=myProgram.mainDS.quote_wo_headings
    open_wos_grid.columnCount = myProgram.mainDS.quote_wo_headings.length-1
    wo_table.sortDescending = true
    myProgram.mainDS[parms.list]=wo_table.prepare()
    open_wos_grid.rows=myProgram.mainDS[parms.list]
    open_wos_grid.defaultColumnWidth=null
    open_wos_grid.headings=wo_table.targetHeadings
    open_wos_grid.cellOnClick=["myProgram.myNewPage('"+parms.page+"','_row_number_','_column_number_')"]
    open_wos_grid.cellToolTips=["Click here to view the Completed Work Order"]
    for(var i = 0; i < open_wos_grid.cellOnClick.length; i++)
    {
        open_wos_grid.cellOnClickTemplates[i] = '<a href="#abc" style="color:#0800be;font-family:verdana" onclick="_cell_on_click_">_cell_contents_</a>'
    }
//  alert(open_wos_grid.prepare())
    return open_wos_grid
}
window.MyQuotePage.prototype.myGrid._methodName='myGrid'
window.MyCompletedWorkOrderPage.prototype.myGrid = function(parms)
{
    if(parms == null)
    {
        var parms={}
        parms.dateScheduledFilter = myProgram.tempDS.current_wo_filter
        parms.filter_function=this.myGridFilterFunction
        parms.page="view_completed_workorder_page"
        parms.list = "completed_wo_list"
    }
    var open_wos_grid = new GUISimpleGridRecipe('{"initialConfigurationName":"formview_grid",minRowCount:10}')
    open_wos_grid.idAttribute = "completed_wo_grid"
    var wo_table=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'})
    open_wos_grid.columnWidths=sysFunctions.makeColumnWidthsEqualTotal([70,169,85,85,40,80,91,91], sysFunctions.getTechAnywhereScreenWidth()-70)
    open_wos_grid.gridHeight=400
    open_wos_grid.scrollingHeight="0;height:187px;overflow:scroll;"
    open_wos_grid.gridWidth=sysFunctions.getTechAnywhereScreenWidth()-14//740
    wo_table.sourceRows=myProgram.mainDS.wo_list
    wo_table.sourceHeadings=myProgram.mainDS.wo_headings
    var filter_function=function(val){return(val.value=='n')}
    wo_table.filterOnSourceHeadings=[].dbPush(myProgram.mainDS.wo_pending_heading).dbPush('Status')
    wo_table.filterValues=[].dbPush('n').dbPush(parms.filter_function)
    
    //2006-04-14 JC(791) Adding Work order Date filter functionality.
    if(parms.dateScheduledFilter != null)
    {
        wo_table.filterOnSourceHeadings.dbPush('Date Scheduled')
        wo_table.filterValues.dbPush(parms.dateScheduledFilter)
    }

    open_wos_grid.sortColumnHeadings = myProgram.mainDS.completed_wo_headings
    open_wos_grid.gridInstanceString = "myCompletedPage.myGrid()" //
    open_wos_grid.sortRowsLocation = "myProgram.mainDS.completed_wo_list"
    
    wo_table.sortOnSourceHeadings=[].dbPush("DateCompleted").dbPush(myProgram.mainDS.wo_id_heading)
    wo_table.targetHeadings=myProgram.mainDS.completed_wo_headings
    wo_table.sortDescending = true
    myProgram.mainDS[parms.list]=wo_table.prepare()
    open_wos_grid.rows=myProgram.mainDS[parms.list]
    open_wos_grid.defaultColumnWidth=null
    open_wos_grid.headings=wo_table.targetHeadings
    open_wos_grid.cellOnClick=["myProgram.myNewPage('"+parms.page+"','_row_number_','_column_number_')"]
    open_wos_grid.cellToolTips=["Click here to view the Completed Work Order"]
    for(var i = 0; i < open_wos_grid.cellOnClick.length; i++)
    {
        open_wos_grid.cellOnClickTemplates[i] = '<a href="#abc" style="color:#0800be;font-family:verdana" onclick="_cell_on_click_">_cell_contents_</a>'
    }
//  alert(open_wos_grid.prepare())
    return open_wos_grid 
}
window.MyCompletedWorkOrderPage.prototype.myGrid._methodName='myGrid'
window.MyUnbilledPage.prototype.myGrid = function(parms)
{
    if(parms == null)
    {
        var parms={}
        parms.dateScheduledFilter = myProgram.tempDS.current_wo_filter
        parms.filter_function=function(val){return (val.value.trim().toLowerCase()=='pending' || val.value.trim().toLowerCase()=='checked out')}
        parms.list = "unbilled_wo_list"
    }
    var gridRecipe=new GUISimpleGridRecipe('{"initialConfigurationName":"formview_grid",minRowCount:10}')
    gridRecipe.idAttribute = this.myGridId()
    var columnWidthArray = [70,169,85,85,40,80,91]
    gridRecipe.columnCount = columnWidthArray.length
    gridRecipe.columnWidths=sysFunctions.makeColumnWidthsEqualTotal(columnWidthArray, sysFunctions.getTechAnywhereScreenWidth()-64)
    gridRecipe.gridHeight=400
    gridRecipe.scrollingHeight="0;height:187px;overflow:scroll;"
    gridRecipe.gridWidth=sysFunctions.getTechAnywhereScreenWidth()-14//740

    gridRecipe.sortColumnHeadings = myProgram.mainDS.unbilled_wo_grid_headings
    gridRecipe.gridInstanceString = "myUnbilledPage.myGrid()" //
    gridRecipe.sortRowsLocation = "myProgram.mainDS.unbilled_wo_list"
    
    myProgram.mainDS[parms.list]=this.myGridRows(parms)
    gridRecipe.rows=myProgram.mainDS[parms.list]
    gridRecipe.defaultColumnWidth=null
    gridRecipe.headings=myProgram.mainDS.unbilled_wo_grid_headings
    gridRecipe.cellOnClick=["myProgram.myNewPage('unbilled_page','_row_number_','_column_number_')"]
    gridRecipe.cellToolTips=["Click here to view the Unbilled Work Order"]
    gridRecipe.cellOnClickDefault=null
    for(var i = 0; i < gridRecipe.cellOnClick.length; i++)
    {
        gridRecipe.cellOnClickTemplates[i] = '<a href="#abc" style="color:#0800be;font-family:verdana" onclick="_cell_on_click_">_cell_contents_</a>'
    }

    return gridRecipe
}
window.MyUnbilledPage.prototype.myGrid._methodName='myGrid'
window.MyRecipe.prototype.getWorkOrderPONumber = function(workOrderId, dateScheduled) {
    if(dateScheduled == null) dateScheduled = myProgram.mainDS.current_workorder_date_scheduled
    return sysFunctions.getColumnValueForTable(myProgram.mainDS.wo_list, myProgram.mainDS.wo_headings, "DefaultPO", ["Work Order Id","Date Scheduled"], [workOrderId, dateScheduled])
}
window.MyRecipe.prototype.getWorkOrderPONumber._methodName='getWorkOrderPONumber'
window.MyRecipe.prototype.myFilterDictForWOSpecificRAQList = function(raqList, workOrderId, techId, dateScheduled)
{
    var filterDict = []
    for(var i = 0; i < raqList.length; i++)
    {
        filterDict[raqList[i]+"_filters"] = {'wrkordr_id':workOrderId,'tchncn_id':techId,'prchseordr_id':myProgram.getWorkOrderPONumber(workOrderId, dateScheduled)}
    }
    return filterDict
}
window.MyRecipe.prototype.myFilterDictForWOSpecificRAQList._methodName='myFilterDictForWOSpecificRAQList'
window.MyRecipe.prototype.myLoadDataForWorkOrderAndTech = function(workOrderId, techId, dateScheduled)
{
    var raqList = myProgram.getWorkOrderSpecificStructureNames()
    myProgram.myReloadData(raqList, myProgram.myFilterDictForWOSpecificRAQList(raqList, workOrderId, techId, dateScheduled))
    myProgram.processCallScripts()
    myProgram.myPopulateMetricsRows(workOrderId)
}
window.MyRecipe.prototype.myLoadDataForWorkOrderAndTech._methodName='myLoadDataForWorkOrderAndTech'
window.MyPendingWorkOrderPage.prototype.load = function(passed_row_index, passed_column_index)
{
    myProgram.mainDS.pending_workorder_id=myProgram.mainDS.pending_wo_list[passed_row_index][passed_column_index]    
    var wo_date_scheduled_index=myProgram.mainDS.pending_wo_headings.dbIndexOf("Date Scheduled")
    myProgram.mainDS.pending_workorder_date_scheduled = myProgram.mainDS.pending_wo_list[passed_row_index][wo_date_scheduled_index]
    var wo_time_scheduled_index=myProgram.mainDS.pending_wo_headings.dbIndexOf("Time Scheduled")
    myProgram.mainDS.pending_workorder_time_scheduled = myProgram.mainDS.pending_wo_list[passed_row_index][wo_time_scheduled_index]
    var wo_rn_index=myProgram.mainDS.pending_wo_headings.dbIndexOf("WOTechRn")
    myProgram.mainDS.pending_workorder_rn = myProgram.mainDS.pending_wo_list[passed_row_index][wo_rn_index]
    
    myProgram.myLoadDataForWorkOrderAndTech(myProgram.mainDS.pending_workorder_id, myProgram.mainDS.tech_id, myProgram.mainDS.pending_workorder_date_scheduled)
    
    var the_recipe=new GUITemplateRecipe({initialConfigurationName:"generic_template"})
    var the_template=the_recipe.template
    the_template.dbPush('<div>')//
    var infoRecipe = myProgram.myWorkOrderInfo({"enableEditStatus":false,"showButtons":false})
    delete(infoRecipe.parentElementId)
    the_template.dbPush(infoRecipe)
    the_template.dbPush("<br/>")
    the_template.dbPush(myPendingWorkOrderPage.myAcceptUnacknowledgedWorkOrderButton())
    the_template.dbPush("&nbsp;&nbsp;&nbsp;")
    the_template.dbPush(myPendingWorkOrderPage.myDeclineUnacknowledgedWorkOrderButton())
    the_template.dbPush('<br/><br/><div style="font-family:arial;font-size:15px;color:black">Call Script</div>')
    the_template.dbPush(myProgram.myCallScriptGrid())
    delete(the_template.parentElementId)
    
    sysFunctions.setInnerHTMLForElement("pendingPageDiv", the_recipe.prepare())
}
window.MyPendingWorkOrderPage.prototype.load._methodName='load'
window.MyRecipe.prototype.updatePriceField = function(sourceElement)
{
    if(myProgram.isWorkOrderCOD())
    {    
        var unitPrice = this.parseQuantity(sysFunctions.locateAdjacentColumnInputNode(sourceElement, "Unit Price").value)
        var billQuantityElement = sysFunctions.locateAdjacentColumnInputNode(sourceElement, "BillQty")
        if(billQuantityElement == null)
        {
            var billQuantityElement = sysFunctions.locateAdjacentColumnInputNode(sourceElement, "BillHours")
        }
        if(billQuantityElement == null)
        {
            var billQuantityElement = sysFunctions.locateAdjacentColumnInputNode(sourceElement, "Quantity")
        }
        var quantity = this.parseQuantity(billQuantityElement.value)
        var price = sysFunctions.locateAdjacentColumnInputNode(sourceElement, "Price")
        price.value = (unitPrice*quantity).toFixed(2)
        sysFunctions.updateDataValue(price, price.value)
    }
}
window.MyRecipe.prototype.updatePriceField._methodName='updatePriceField'
window.MyRecipe.prototype.parseQuantity = function(quantity) {
    if (quantity.toString().trim() == ".") return 0.0
    return quantity
}
window.MyRecipe.prototype.parseQuantity._methodName='parseQuantity'
window.MyRecipe.prototype.myDateQualified = function()
{
    return "_t90706"
}
window.MyRecipe.prototype.myDateQualified._methodName='myDateQualified'
window.MyRecipe.prototype._superclass = function TopObject() {}
window.MyRecipe.prototype._superclass._methodName='_superclass'
window.MyRecipe.prototype.init = function()
{
    var johnversion = this.mySubAnywhereVersion()

	//myProgram.checkJavaVersion()
	this.myCheckFolders()
	this.myLoadData()
	//this.mySendLogFilesToDataBasics()
	//this.myDeleteTempFolder()
	this.myLoadGlobalVariableDefaultValues()
	this.mydbLogMessage("SubAnywhere_Startup", "", "SubAnywhere Session started.");
	__('myHomePage')
	this.mainDS['current_page']='home_page'
	this.myCurrentPage()
	
	sysFunctions.configure(this,this.finalIngredients)
}
window.MyRecipe.prototype.init._methodName='init'
window.MyRecipe.prototype.myInitialData = function()
{  
   var the_data = myProgram.myGetFileContents(myProgram.myInitialDataFilenameAndPath()).dbEval()
   
   var counter = 1;
   var the_rows=[]
	for(var i=0;i<2000;i++)
	{
		var the_id='id-'+i
		var the_description='description for id '+i
		var the_group='group-'+counter
		if(i > 333)counter=2 
		if(i > 667)counter=3 
		if(i > 999)counter=4 
		if(i > 1332)counter=5
		if(i > 1667)counter=6
		var the_row=[]
		the_row.push(the_id)
		the_row.push(the_description)
		the_row.push(the_group)
		the_rows.push(the_row)
	}
	the_data.static_part_list=the_rows
	return the_data
}
window.MyRecipe.prototype.myInitialData._methodName='myInitialData'
window.MyRecipe.prototype.mySubAnywhereVersion = function()
{
	var techAnywhereVersion;
	
	techAnywhereVersion = this.mySubAnywhereMainVersion()+"."+this.myBuildNumber()+this.myDateQualified(); 
	
	return techAnywhereVersion;
}
window.MyRecipe.prototype.mySubAnywhereVersion._methodName='mySubAnywhereVersion'
window.MyRecipe.prototype.myExpectedServerDatabaseRevisionLevel = function()
{
	return "436"
}
window.MyRecipe.prototype.myExpectedServerDatabaseRevisionLevel._methodName='myExpectedServerDatabaseRevisionLevel'
window.MyRecipe.prototype.mySubAnywhereMainVersion = function()
{
	var techAnywhereMainVersion = "1.0";
	
	return techAnywhereMainVersion;
}
window.MyRecipe.prototype.mySubAnywhereMainVersion._methodName='mySubAnywhereMainVersion'
window.MyRecipe.prototype.myExpectedDatastoreVersion = function()
{
	var expectedDatastoreVersion = "000";
	
	return expectedDatastoreVersion;
}
window.MyRecipe.prototype.myExpectedDatastoreVersion._methodName='myExpectedDatastoreVersion'
window.MyRecipe.prototype.myBuildNumber = function()
{
	var buildNumber = "000";
	
	return buildNumber;
}
window.MyRecipe.prototype.myBuildNumber._methodName='myBuildNumber'
window.MyRecipe.prototype.getRAQVersion = function()
{
	return this.mySubAnywhereMainVersion()+"."+this.myExpectedDatastoreVersion()
}
window.MyRecipe.prototype.getRAQVersion._methodName='getRAQVersion'
window.MyRecipe.prototype.myInitialDataFilenameAndPath = function()
{
	return myProgram.mySpecifiedCurrentDirectory+"/MyData/mainds_initial_data.txt"
}
window.MyRecipe.prototype.myInitialDataFilenameAndPath._methodName='myInitialDataFilenameAndPath'
window.MyRecipe.prototype.myShowModalDialogWithInnerHTML = function(innerHTML)
{
	var smd = showModelessDialog("");
	var dSource = innerHTML
	smd.document.open();
	smd.document.write(dSource);
	smd.document.close();
	smd.focus()
}
window.MyRecipe.prototype.myShowModalDialogWithInnerHTML._methodName='myShowModalDialogWithInnerHTML'
window.MyRecipe.prototype.checkJavaVersion = function()
{
	try
	{
		var version = MyWaitApplet.getJavaVersion();
		if(parseFloat(version) < 1.6)
		{
			alert("You must have at least Java Runtime Environment 1.6 installed to use this software.\r\rPlease contact technical support.\r\rThis application will now close.")
			window.close()
		}
	}
	catch(e)
	{
		alert("You must have at least Java Runtime Environment 1.6 installed to use this software.\r\rPlease contact technical support.\r\rThis application will now close.")
		window.close()
	}
}
window.MyRecipe.prototype.checkJavaVersion._methodName='checkJavaVersion'
window.MyRecipe.prototype.refreshWOList = function(tabId)
{
    if(myProgram.checkForWorkOrders())
    {
        myProgram.myLoadData()
        myProgram.myRefreshSubAnywherePages()
    }
}
window.MyRecipe.prototype.refreshWOList._methodName='refreshWOList'
window.MyRecipe.prototype.checkForWorkOrders = function()
{
    var serverWOList = this.getServerWOList()
    var clientWOList = this.getClientWOList()
    
    return (sysFunctions.stringify(serverWOList).trim().toLowerCase() != sysFunctions.stringify(clientWOList).trim().toLowerCase())
}
window.MyRecipe.prototype.checkForWorkOrders._methodName='checkForWorkOrders'
window.MyRecipe.prototype.getClientWOList = function()
{
    return myProgram.mainDS.wo_list
    /*var woList = []
    var woIdIndex = myProgram.mainDS.wo_headings.dbIndexOf("Work Order Id")
    var dateIndex = myProgram.mainDS.wo_headings.dbIndexOf("Date Scheduled")
    
    for(var woIndex = 0; woIndex < myProgram.mainDS.wo_list.length; woIndex++)
    {
        var woRow = myProgram.mainDS.wo_list[woIndex]
        woList.push([woRow[woIdIndex], woRow[dateIndex]])    
    }
    
    return woList*/
}
window.MyRecipe.prototype.getClientWOList._methodName='getClientWOList'
window.MyRecipe.prototype.getServerWOList = function()
{
    return this.executeRpc("rpcGetWorkOrderIdList", {tchncn_id:myProgram.mainDS.tech_id})
}
window.MyRecipe.prototype.getServerWOList._methodName='getServerWOList'
window.MyRecipe.prototype.executeRpc = function(rpc, withDict)
{
    //Prepare the request payload
	var the_request=myProgram.getRequestTemplate()
	the_request.call=[rpc]
	
	for(var key in withDict)
	{
	    the_request["with"][key] = withDict[key]   
	}
	
	the_request_string=sysFunctions.stringify(the_request)
	
	var the_request_string='payload='+this.myPrepareMessageString(the_request_string)
	the_request_recipe=new DUIHttpRequestRecipe({initialConfigurationName:"generic_post_request"})
	the_request_recipe.url=myProgram.mainDS.url
	the_request_recipe.request=the_request_string
	
	if(!the_request_recipe.prepare())return false;
    var the_response=the_request_recipe.httpObject.responseText.dbEval()
    
    return the_response["with"][rpc]
}
window.MyRecipe.prototype.executeRpc._methodName='executeRpc'
window.MyRecipe.prototype.myCurrentWorkOrderHasAttachments = function()
{
	if(myProgram.mainDS.current_workorder_id == null) return false
	//Locate the SiteId value for this work order.
	var the_locator_recipe=new SUITableCellValueLocatorRecipe({"initialConfigurationName":"generic_table_cell_value_locator"})
	the_locator_recipe.tableRows=this.mainDS.wo_list
	the_locator_recipe.tableHeadings=this.mainDS.wo_headings
	the_locator_recipe.tableLocatorHeading=[].dbPush(this.mainDS.wo_id_heading).dbPush("Date Scheduled").dbPush("Time Scheduled")
	the_locator_recipe.tableLocatorFilter=[].dbPush(this.mainDS.current_workorder_id).dbPush(this.mainDS.current_workorder_date_scheduled).dbPush(this.mainDS.current_workorder_time_scheduled)
	the_locator_recipe.tableTargetCellHeading="SiteId"
	var site_id=the_locator_recipe.prepare()
	
	var the_recipe=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'})
	the_recipe.sourceRows=this.attachmentsDS.static_document_list
	the_recipe.sourceHeadings=this.attachmentsDS.static_document_headings
	the_recipe.targetHeadings=this.mainDS.static_document_grid_headings
	the_recipe.filterOnSourceHeadings=[]
	the_recipe.filterValues=[]
	the_recipe.filterOnSourceHeadings.dbPush("ReferenceId").dbPush("ReferenceType");
	the_recipe.filterValues.dbPush(this.mainDS.current_workorder_id).dbPush("WorkOrders");
	if(the_recipe.prepare().length > 0) return true
	
	var the_recipe=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'})
	the_recipe.sourceRows=this.attachmentsDS.static_document_list
	the_recipe.sourceHeadings=this.attachmentsDS.static_document_headings
	the_recipe.targetHeadings=this.mainDS.static_document_grid_headings
	the_recipe.filterOnSourceHeadings=[]
	the_recipe.filterValues=[]
	the_recipe.filterOnSourceHeadings.dbPush("ReferenceId").dbPush("ReferenceType");
	the_recipe.filterValues.dbPush(site_id).dbPush("ClientSites");
	if(the_recipe.prepare().length > 0) return true
	
	return false
}
window.MyRecipe.prototype.myCurrentWorkOrderHasAttachments._methodName='myCurrentWorkOrderHasAttachments'
window.MyRecipe.prototype.myDatastoreVersion = function()
{
	return myProgram.myGetValueFromPersistentStorage("current_datastore_version")
}
window.MyRecipe.prototype.myDatastoreVersion._methodName='myDatastoreVersion'
window.MyRecipe.prototype.myDatastoreFilePathAndName = function()
{
	return localDataSource
}
window.MyRecipe.prototype.myDatastoreFilePathAndName._methodName='myDatastoreFilePathAndName'
window.MyRecipe.prototype.myLaborTypeOnChange = function(laborTypeInputElement)
{
	if(myProgram.isElementTransmitted(laborTypeInputElement))
	{
		return "[Ref Code:7] This entry has already been submitted. Additional changes are not permitted"			
	}
	
	sysFunctions.updateDataValue(laborTypeInputElement, laborTypeInputElement.getAttribute("mynewvalue"))		
	myProgram.updateLaborDescriptionField(laborTypeInputElement)
	
	if(this.isWorkOrderCOD())
	{
		var laborTypeId = laborTypeInputElement.getAttribute("mynewvalue");
		var unitPrice = this.getUnitPriceForLaborTypeId(laborTypeId)
		var unitPriceInputElement = sysFunctions.locateAdjacentColumnInputNode(laborTypeInputElement, "Unit Price")
		this.updateUnitPriceField(unitPrice, unitPriceInputElement)
	}
	
	myProgram.myRefreshLaborSummaryGridForFormView()
}
window.MyRecipe.prototype.myLaborTypeOnChange._methodName='myLaborTypeOnChange'
window.MyRecipe.prototype.myPOPartNumberChanged = function(partNumberInputElement)
{
	var partNumber = partNumberInputElement.getAttribute("mynewvalue");
	var description = this.getDescriptionForPartNumber(partNumber)
	var descriptionElement = sysFunctions.locateAdjacentColumnInputNode(partNumberInputElement, "Description")
	descriptionElement.value = description
	
	var unitCost = this.getUnitCostForPartNumber(partNumber)
	var unitCostInputElement = sysFunctions.locateAdjacentColumnInputNode(partNumberInputElement, "Unit Cost")
	unitCostInputElement.value = unitCost
	
	sysFunctions.updateDataValue(descriptionElement, description)
	sysFunctions.updateDataValue(unitCostInputElement, unitCost)
	sysFunctions.updateDataValue(partNumberInputElement, partNumberInputElement.getAttribute("mynewvalue"))
}
window.MyRecipe.prototype.myPOPartNumberChanged._methodName='myPOPartNumberChanged'
window.MyRecipe.prototype.myPartNumberChanged = function(partNumberInputField)
{
	if(myProgram.isElementPartOfPO(partNumberInputField))
	{
		return "[Ref Code:6] This material item is part of a purchase order and cannot be changed"
	}
	
	var partNumber = partNumberInputField.getAttribute("mynewvalue");
	var description = this.getDescriptionForPartNumber(partNumber)
	var descriptionElement = sysFunctions.locateAdjacentColumnInputNode(partNumberInputField, "Description")
	descriptionElement.value = description
	
	var unitPrice = this.calculateUnitPriceForPartNumber(partNumber)
	var unitPriceInputElement = sysFunctions.locateAdjacentColumnInputNode(partNumberInputField, "Unit Price")
	this.updateUnitPriceField(unitPrice, unitPriceInputElement)
	
	sysFunctions.updateDataValue(descriptionElement, description)
	sysFunctions.updateDataValue(partNumberInputField, partNumberInputField.getAttribute("mynewvalue"))
	myProgram.myRefreshMaterialSummaryGridForFormView()

}
window.MyRecipe.prototype.myPartNumberChanged._methodName='myPartNumberChanged'
window.MyRecipe.prototype.updateUnitPriceField = function(unitPrice, unitPriceInputElement)
{
	if(unitPriceInputElement != null)
	{
		unitPriceInputElement.value = unitPrice
		sysFunctions.updateDataValue(unitPriceInputElement, unitPrice)
		this.myUnitPriceHasChanged(unitPriceInputElement)
	}
}
window.MyRecipe.prototype.updateUnitPriceField._methodName='updateUnitPriceField'
window.MyRecipe.prototype.myFlatRateQuantityFieldHasChanged = function()
{
	if(event.srcElement.id == "add_quantity_field")
	{
		if(event.srcElement.value.validateFormat('generic_positive_decimal_two','Quantity',false))
		{
			this.myRefreshTotals()
		}
	}

}
window.MyRecipe.prototype.myFlatRateQuantityFieldHasChanged._methodName='myFlatRateQuantityFieldHasChanged'
window.MyRecipe.prototype.myClosingScriptHasChanged = function()
{
	//this.mySaveData()
}
window.MyRecipe.prototype.myClosingScriptHasChanged._methodName='myClosingScriptHasChanged'
window.MyRecipe.prototype.myClosingScriptHasChangedCodeString = function()
{
	return "function(){myProgram.myClosingScriptHasChanged(this)}"
}
window.MyRecipe.prototype.myClosingScriptHasChangedCodeString._methodName='myClosingScriptHasChangedCodeString'
window.MyRecipe.prototype.myBillHoursHasChangedCodeString = function(billHoursInputElement)
{
	return "function(){return myProgram.myBillHoursHasChanged(this)}"
}
window.MyRecipe.prototype.myBillHoursHasChangedCodeString._methodName='myBillHoursHasChangedCodeString'
window.MyRecipe.prototype.myBillQuantityHasChangedCodeString = function(billQuantityInputElement)
{
	return "function(){return myProgram.myBillQuantityHasChanged(this)}"
}
window.MyRecipe.prototype.myBillQuantityHasChangedCodeString._methodName='myBillQuantityHasChangedCodeString'
window.MyRecipe.prototype.myBillHoursHasChanged = function(sourceElement)
{
	if(myProgram.isElementTransmitted(sourceElement))
	{
		return "[Ref Code:7] This entry has already been submitted. Additional changes are not permitted"			
	}	
	this.updatePriceField(sourceElement)
}
window.MyRecipe.prototype.myBillHoursHasChanged._methodName='myBillHoursHasChanged'
window.MyRecipe.prototype.myBillQuantityHasChanged = function(sourceElement)
{
	if(myProgram.isElementTransmitted(sourceElement))
	{
		return "[Ref Code:7] This entry has already been submitted. Additional changes are not permitted"			
	}	
	this.updatePriceField(sourceElement)
}
window.MyRecipe.prototype.myBillQuantityHasChanged._methodName='myBillQuantityHasChanged'
window.MyRecipe.prototype.myUnitPriceHasChangedCodeString = function()
{
	return "function(){return myProgram.myUnitPriceHasChanged(this)}"
}
window.MyRecipe.prototype.myUnitPriceHasChangedCodeString._methodName='myUnitPriceHasChangedCodeString'
window.MyRecipe.prototype.myUnitPriceHasChanged = function(sourceElement)
{
	if(myProgram.isElementTransmitted(sourceElement))
	{
		return "[Ref Code:7] This entry has already been submitted. Additional changes are not permitted"			
	}	
	this.updatePriceField(sourceElement)
}
window.MyRecipe.prototype.myUnitPriceHasChanged._methodName='myUnitPriceHasChanged'
window.MyRecipe.prototype.myLaborTypeDescriptionForId = function(laborTypeId)
{
	var the_cell_locator=new SUITableCellValueLocatorRecipe({initialConfigurationName:"generic_table_cell_value_locator"})
	the_cell_locator.tableRows=this.mainDS.static_labor_type_list
	the_cell_locator.tableHeadings=this.mainDS.static_labor_type_headings
	the_cell_locator.tableLocatorHeading="Labor Type Id"
	the_cell_locator.tableLocatorFilter=laborTypeId
	the_cell_locator.tableTargetCellHeading="Description"
	return the_cell_locator.prepare()
}
window.MyRecipe.prototype.myLaborTypeDescriptionForId._methodName='myLaborTypeDescriptionForId'
window.MyRecipe.prototype.updateLaborDescriptionField = function(laborTypeInputElement)
{
	laborTypeId = sysFunctions.locateAdjacentColumnInputNode(laborTypeInputElement, "Labor Type Id").getAttribute("mynewvalue")
	var descriptionElement = sysFunctions.locateAdjacentColumnInputNode(laborTypeInputElement, "Description")
	descriptionElement.value = this.myLaborTypeDescriptionForId(laborTypeId)
	sysFunctions.updateDataValue(descriptionElement, descriptionElement.value)
}
window.MyRecipe.prototype.updateLaborDescriptionField._methodName='updateLaborDescriptionField'
window.MyRecipe.prototype.getBillableQuantity = function()
{
	if(window["add_billHours_combobox"] != null)
	{
		var combobox = window["add_billHours_combobox"]
		var selectedIndex = combobox.selectedIndex;
		var billHours = combobox.options[selectedIndex].value;
		
		return billHours
	}
	else
	{
		return window["add_bill_quantity_field"].value
	}
}
window.MyRecipe.prototype.getBillableQuantity._methodName='getBillableQuantity'
window.MyRecipe.prototype.isElementTransmittedOrig20080623 = function(inputElement)
{
	var transmittedInputElement = sysFunctions.locateAdjacentColumnInputNode(inputElement, "Transmitted")
	if(transmittedInputElement.value.trim().toLowerCase() == "y") return true
	return false
}
window.MyRecipe.prototype.isElementTransmittedOrig20080623._methodName='isElementTransmittedOrig20080623'
window.MyRecipe.prototype.isElementTransmitted = function(inputElement)
{
	var statusInputElement = sysFunctions.locateAdjacentColumnInputNode(inputElement, "Status")
	if(statusInputElement.value.trim().toLowerCase() == "submitted") return true
	return false
}
window.MyRecipe.prototype.isElementTransmitted._methodName='isElementTransmitted'
window.MyRecipe.prototype.isElementPartOfPO = function(inputElement)
{
	return false //Ok to modify PO lines.  TODO: Remove this functionality all together.
	var poInputElement = sysFunctions.locateAdjacentColumnInputNode(inputElement, "PO#")
	if(poInputElement == null) return false
	if(poInputElement.value == null) return false
	if(poInputElement.value.trim() == "") return false
	return true
}
window.MyRecipe.prototype.isElementPartOfPO._methodName='isElementPartOfPO'
window.MyRecipe.prototype.isElementPartOfSubPO = function(inputElement)
{
	return (myProgram.isElementPartOfPO(inputElement) && !myProgram.isElementPartOfServerPO(inputElement))
}
window.MyRecipe.prototype.isElementPartOfSubPO._methodName='isElementPartOfSubPO'
window.MyRecipe.prototype.isElementPartOfServerPO = function(inputElement)
{
	var serverPOElement = sysFunctions.locateAdjacentColumnInputNode(inputElement, "ServerPO")
	return (serverPOElement.value.trim().toLowerCase() == "y")
}
window.MyRecipe.prototype.isElementPartOfServerPO._methodName='isElementPartOfServerPO'
window.MyRecipe.prototype.myPOQuantityFieldHasChanged = function(quantityInputElement)
{
	var poQuantityInputElement = sysFunctions.locateAdjacentColumnInputNode(quantityInputElement, "POQty")
	poQuantityInputElement.value = quantityInputElement.value
	sysFunctions.updateDataValue(poQuantityInputElement, poQuantityInputElement.value)
	var billQuantityInputElement = sysFunctions.locateAdjacentColumnInputNode(quantityInputElement, "BillQty")
	billQuantityInputElement.value = quantityInputElement.value
	sysFunctions.updateDataValue(billQuantityInputElement, billQuantityInputElement.value)
}
window.MyRecipe.prototype.myPOQuantityFieldHasChanged._methodName='myPOQuantityFieldHasChanged'
window.MyRecipe.prototype.getTypeOfGrid = function(inputElement)
{
	if(inputElement.parentElement.id.indexOf("material")!=-1)
	{
		return "material"
	}
	else
	{
		return "other"
	}
}
window.MyRecipe.prototype.getTypeOfGrid._methodName='getTypeOfGrid'
window.MyRecipe.prototype.otherDescriptionChanged = function(inputElement)
{
	return myProgram.myCheckIfPO(inputElement)
}
window.MyRecipe.prototype.otherDescriptionChanged._methodName='otherDescriptionChanged'
window.MyRecipe.prototype.myCheckIfPO = function(inputElement)
{
	if(myProgram.isElementPartOfPO(inputElement))
	{
		return "This item is part of a purchase order and cannot be changed."
	}
}
window.MyRecipe.prototype.myCheckIfPO._methodName='myCheckIfPO'
window.MyRecipe.prototype.myServerWait = function(seconds)
{
	//Prepare the request payload
	var the_request=myProgram.getRequestTemplate()
	the_request.call=['wait']
	the_request["with"]["tchncn_id"]=this.mainDS.tech_id;
	the_request["with"]["password"]=this.tempDS.password;
	the_request["with"]["seconds"]=seconds
	//2006-09-28 (jc)-[1105]-Adding the odbc params from the config.txt file. 
	the_request["with"]["odbcName"]=this.mainDS.odbcName;
	the_request["with"]["dbOwner"]=this.mainDS.dbOwner;
	the_request["with"]["dbPassword"]=this.mainDS.dbPassword;
	
	//2006-10-25 (jc)-[1095]-All communications from the JS client to the VW server must include (a) the 
	//application name ("TechAnywhere"), (b) the major version number, (c) the 
	//expected datastore version number, (d) the build number and (e) the date-qualifier
	the_request["with"]["applicationName"]="TechAnywhere";
	the_request["with"]["majorVersionNumber"]=this.mySubAnywhereMainVersion();
	the_request["with"]["expectedDatastoreVersion"]=this.myExpectedDatastoreVersion();
	the_request["with"]["buildNumber"]=this.myBuildNumber();
	the_request["with"]["dateQualifier"]=this.myDateQualified();
	the_request["with"]["expectedServerDatabaseRevisionLevel"]=this.myExpectedServerDatabaseRevisionLevel()
	
	the_request_string=sysFunctions.stringify(the_request)
	
	var the_request_string='payload='+this.myPrepareMessageString(the_request_string)
	the_request_recipe=new DUIHttpRequestRecipe({initialConfigurationName:"generic_post_request"})
	the_request_recipe.url=this.mainDS.url
	the_request_recipe.request=the_request_string
	if(!the_request_recipe.prepare())return;
    var the_response_text=the_request_recipe.httpObject.responseText
}
window.MyRecipe.prototype.myServerWait._methodName='myServerWait'
window.MyRecipe.prototype.isExternalFTP = function()
{
    if(typeof(isExternalFTP) == "undefined") isExternalFTP = true
        
    return isExternalFTP
}
window.MyRecipe.prototype.isExternalFTP._methodName='isExternalFTP'
window.MyRecipe.prototype.getDBExchangeFTPHost = function()
{
    if(this.isExternalFTP())
    {
        if(this.mainDS.configDBExchangeFTPHost == null) this.mainDS.configDBExchangeFTPHost = ""
	return this.mainDS.configDBExchangeFTPHost
    }
    else
    {
        if(this.mainDS.configInternalFTPHost == null) this.mainDS.configInternalFTPHost = ""
	return this.mainDS.configInternalFTPHost
    }
}
window.MyRecipe.prototype.getDBExchangeFTPHost._methodName='getDBExchangeFTPHost'
window.MyRecipe.prototype.getDBExchangeFTPPassword = function()
{
    if(this.isExternalFTP())
    {
         if(this.mainDS.configDBExchangeFTPPassword == null) this.mainDS.configDBExchangeFTPPassword = ""
	 return this.mainDS.configDBExchangeFTPPassword
    }
    else
    {
        if(this.mainDS.configInternalFTPPassword == null) this.mainDS.configInternalFTPPassword = ""
	return this.mainDS.configInternalFTPPassword
    }
}
window.MyRecipe.prototype.getDBExchangeFTPPassword._methodName='getDBExchangeFTPPassword'
window.MyRecipe.prototype.getDBExchangeFTPUsername = function()
{
    if(this.isExternalFTP())
    {
        if(this.mainDS.configDBExchangeFTPUsername == null) this.mainDS.configDBExchangeFTPUsername = ""
	return this.mainDS.configDBExchangeFTPUsername
    }
    else
    {
        if(this.mainDS.configInternalFTPUsername == null) this.mainDS.configInternalFTPUsername = ""
	return this.mainDS.configInternalFTPUsername
    }
}
window.MyRecipe.prototype.getDBExchangeFTPUsername._methodName='getDBExchangeFTPUsername'
window.MyRecipe.prototype.myUploadFileToServer = function(fileName)
{
	var tokens = fileName.split("\\")
	var remoteFilename = tokens[tokens.length-1]
	var localFilename = fileName
	var filenameArray = [{"localFilename":localFilename,"remoteFilename":remoteFilename}];
	
	var host = this.getDBExchangeFTPHost()
	var username = this.getDBExchangeFTPUsername()
	var password = this.getDBExchangeFTPPassword()
	//filenameArray, quietMode, host, username, password, numtries
	
	var resultArray = this.myFTPPutFiles(filenameArray, true, host, username, password)
	return resultArray[0]	
}
window.MyRecipe.prototype.myUploadFileToServer._methodName='myUploadFileToServer'
window.MyRecipe.prototype.myPDFTest = function()
{
	// create pdf library object
	var PDF = new ActiveXObject("PDFCreatorPilot2.piPDFDocument")
	// initialize PDF Engine
	PDF.StartEngine("demo@demo", "demo")
	// Set AutoLaunch property to TRUE to automatically launch PDF Reader
	PDF.AutoLaunch = true
	PDF.FileName = "johntest.pdf"
	// start document generation
	PDF.BeginDoc()
	// draw "HELLO, PDF" message on the current PDF page
	PDF.PDFPAGE_SetActiveFont("Verdana", true, false, false, false, 14, 0)
	PDF.PDFPAGE_TextOut(10, 20, 0, "HELLO, PDF!")
	// finalize document generation
	PDF.EndDoc()
	// disconnect from library
	var PDF = null
}
window.MyRecipe.prototype.myPDFTest._methodName='myPDFTest'
window.MyRecipe.prototype.myMainTabs = function()
{
	var main_tabs=new GUISimpleGridRecipe('{"initialConfigurationName":"generic_simple_grid"}')
	main_tabs.headingDefaultStyle="text-align:center;background-color:white;border-width:1;border-style:solid;border-style:none"
	main_tabs.columnWidths=[160,160,160,160]
	main_tabs.headings=this.tempDS.main_tab_list
	main_tabs.rows=[]
	main_tabs.gridStyle=this.tempDS.main_tab_grid_style
	var heading_on_click=[]
	for (var index=0;index<main_tabs.headings.length;index++)
	{
		var the_start_onclick_text=this.tempDS.main_tab_onclick
		if(main_tabs.headings[index]==this.tempDS.main_tab_list_selected_tab)
		{
			the_onclick_text=null
		}
		else
		{
			the_onclick_text=the_start_onclick_text.replace(/_tab_name_/g,main_tabs.headings[index])
 		}
 		heading_on_click.push(the_onclick_text)
	}
	main_tabs.headingOnClick=heading_on_click 
	return main_tabs
}
window.MyRecipe.prototype.myMainTabs._methodName='myMainTabs'
window.MyRecipe.prototype.mySignatureE1 = function(the_signature)
{
	var this_recipe=new SUITableCellValueLocatorRecipe('{"initialConfigurationName":"generic_table_cell_value_locator"}')
    var the_wo_list=this.mainDS.wo_list
    this_recipe.tableRows=the_wo_list
	this_recipe.tableHeadings=this.mainDS.wo_headings
	this_recipe.tableLocatorHeading=this.mainDS.wo_id_heading
	this_recipe.tableLocatorFilter=this.mainDS.current_workorder_id
	this_recipe.tableTargetCellHeading=this.mainDS.wo_signature_heading
	the_signature=this_recipe.prepare()
	the_wo_list[row_index][the_signature_column_index]=the_signature
}
window.MyRecipe.prototype.mySignatureE1._methodName='mySignatureE1'
window.MyRecipe.prototype.mySignatureE2 = function()
{
	var this_recipe=new SUITableCellValueLocatorRecipe('{"initialConfigurationName":"generic_table_cell_value_locator"}')
    var the_wo_list=this.mainDS.wo_list
    this_recipe.tableRows=the_wo_list
	this_recipe.tableHeadings=this.mainDS.wo_headings
	this_recipe.tableLocatorHeading=this.mainDS.wo_id_heading
	this_recipe.tableLocatorFilter=this.mainDS.current_workorder_id
	this_recipe.tableTargetCellHeading=this.mainDS.wo_signature_heading
	this_recipe.tableCellValue=the_signature
}
window.MyRecipe.prototype.mySignatureE2._methodName='mySignatureE2'
window.MyRecipe.prototype.myNewMainTab = function(the_tab_name)
{
	var the_headings=this.tempDS.main_tab_list
	var the_index=the_headings.dbIndexOf(the_tab_name)
	this.tempDS.main_tab_list_selected_tab=the_headings[the_index]
	var the_page=this.tempDS.main_tab_list_pages[the_index]
	this.myNewPage(the_page)
}
window.MyRecipe.prototype.myNewMainTab._methodName='myNewMainTab'
window.MyRecipe.prototype.myViewWorkPerformed = function(the_tab_name)
{
	var the_recipe=new GUITemplateRecipe({initialConfigurationName:"generic_template"})
	var the_template=the_recipe.template
	the_template.dbPush('<div>')//
	the_template.dbPush('<div style="border-width:2;overflow-y:auto;border-style:solid;width:700;height:200">')
	var the_table=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'})
	the_table.sourceRows=this.mainDS.wo_equipment_list
	the_table.sourceHeadings=this.mainDS.wo_equipment_headings
	the_table.filterOnSourceHeadings=[].dbPush(this.mainDS.wo_id_heading)
	the_table.filterOnSourceHeadings.dbPush("Specified")
	the_table.filterValues=[].dbPush(this.mainDS.current_workorder_id)
	the_table.filterValues.dbPush("y")
	the_table.sortOnSourceHeadings=[].dbPush(this.mainDS.wo_id_heading)
	the_table.targetHeadings=this.mainDS.work_performed_headings//['Equipment Id','Work Performed',"RN"]
	var work_performed_list=the_table.prepare()
	this.mainDS.work_performed_list=work_performed_list
	for (var the_index=0;the_index<work_performed_list.length;the_index++)
	{
		var the_equipment_id=work_performed_list[the_index][0]
		var the_header='Work Performed For:'+the_equipment_id+'<a href=#abc onclick="myProgram.myNewPage(\'update_work_performed_page\',\''+the_index+'\')">[update]</a>'
		var the_text=work_performed_list[the_index][1]
		while(the_text.indexOf("\x0d") != -1)
		{
			the_text=the_text.replace(/\x0d/g,'<br/>')
			//the_text=the_text.replace(/\n/g,'<br/>')
		}
		the_template.dbPush(the_header).dbPush('<br/><br/>')
		the_template.dbPush('<div style="background-color:white;color:green;font-size:12;font-family:times new roman;border:1;text-align:left;overflow-y:auto;border-style:solid;width:650;height:75">')
		the_template.dbPush(the_text).dbPush('<br/>')
		the_template.dbPush('</div>').dbPush('<br/>')
	}
	the_template.dbPush('</div>')
	the_template.dbPush('</div>')//
	return the_recipe
}
window.MyRecipe.prototype.myViewWorkPerformed._methodName='myViewWorkPerformed'
window.MyRecipe.prototype.myWorkPerformedTextAreaRecipe = function()
{
	var the_textarea_configuration='{"initialConfigurationName":"generic_textarea",\
			"rowsAttribute":"17","colsAttribute":"117","styleAttribute":"overflow:scroll;word-wrap:normal","idAttribute":"work_performed_text_area"}'
	var the_recipe=new GUITextAreaRecipe(the_textarea_configuration)
	the_recipe.styleAttribute=";word-wrap:break-word;font-size:11px;font-family:arial;background-color:white;border:1px solid #676566;width:100%"
	the_recipe.contents=this.mainDS.current_work_performed
	
	return the_recipe
}
window.MyRecipe.prototype.myWorkPerformedTextAreaRecipe._methodName='myWorkPerformedTextAreaRecipe'
window.MyRecipe.prototype.myWorkRequestedTextAreaRecipe = function(equipmentId)
{
    var the_recipe = this.myWorkPerformedTextAreaRecipe()
	the_recipe.contents = this.myWorkRequestedForEquipmentIdUnderWorkOrderId(equipmentId,this.mainDS.current_workorder_id)
	return the_recipe
}
window.MyRecipe.prototype.myWorkRequestedTextAreaRecipe._methodName='myWorkRequestedTextAreaRecipe'
window.MyRecipe.prototype.myDetailedSiteNotesAreaRecipe = function()
{
	var the_textarea_configuration='{"initialConfigurationName":"generic_textarea",\
			"rowsAttribute":"6","colsAttribute":"90","styleAttribute":"overflow:scroll;word-wrap:normal","idAttribute":"detailed_notes_area"}'
	var the_recipe=new GUITextAreaRecipe(the_textarea_configuration)
	the_recipe.styleAttribute="word-wrap:break-word;color:green;font-size:12;font-family:times new roman;"
	the_recipe.readonlyAttribute = "true";
	return the_recipe
}
window.MyRecipe.prototype.myDetailedSiteNotesAreaRecipe._methodName='myDetailedSiteNotesAreaRecipe'
window.MyRecipe.prototype.myPartsSearchKeywordTextAreaRecipe = function()
{
	var initial_data = '';
	if(this.mainDS.current_parts_grid_search_filter_array != null)
	{
		var keyword_filter = myProgram.mainDS.current_parts_grid_search_filter_array;
		for(i = 0; i < keyword_filter.length; i++)
		{
			if(i == 0)
			{
				initial_data += "\'"+keyword_filter[i]+"\'";
			}
			else
			{
				initial_data += " and \'"+keyword_filter[i]+"\'";
			}
		}
	}
	var the_textarea_configuration='{"initialConfigurationName":"keyword_textarea","initial_data":"'+initial_data+'",\
			"rowsAttribute":"5","colsAttribute":"110","readonly":"true","styleAttribute":"overflow:scroll;word-wrap:normal","idAttribute":"keyword_text_area"}'
	var the_recipe=new GUITextAreaRecipe(the_textarea_configuration)
	the_recipe.styleAttribute="word-wrap:break-word;color:green;font-size:12;font-family:times new roman;"
	the_recipe.readonlyAttribute="true"
	
	return the_recipe
}
window.MyRecipe.prototype.myPartsSearchKeywordTextAreaRecipe._methodName='myPartsSearchKeywordTextAreaRecipe'
window.MyRecipe.prototype.myProblemDescriptionRecipe = function()
{
	var the_textarea_configuration='{"initialConfigurationName":"generic_textarea",\
			"rowsAttribute":"20","colsAttribute":"100","styleAttribute":"overflow:scroll;word-wrap:normal","idAttribute":"problem_description_textarea"}'
	var the_recipe=new GUITextAreaRecipe(the_textarea_configuration)
	the_recipe.styleAttribute="word-wrap:break-word;color:green;font-size:12;font-family:times new roman;"
	the_recipe.contents=""
	return the_recipe
}
window.MyRecipe.prototype.myProblemDescriptionRecipe._methodName='myProblemDescriptionRecipe'
window.MyRecipe.prototype.myUpdateWorkOrderNoteRow = function(the_value, workOrderId)
{
	if(the_value == null) the_value = document.getElementById("workorder_note_text_area").value
        if(workOrderId == null) workOrderId = this.mainDS.current_workorder_id
            
	var the_locator_recipe=new SUITableCellValueLocatorRecipe({"initialConfigurationName":"generic_table_cell_value_locator"})
	the_locator_recipe.tableRows=this.mainDS.wo_note_list
	the_locator_recipe.tableHeadings=this.mainDS.wo_note_headings
	the_locator_recipe.tableLocatorHeading=this.mainDS.wo_id_heading
	the_locator_recipe.tableLocatorFilter=workOrderId
	the_locator_recipe.tableCellNewValue=the_value
	the_locator_recipe.tableTargetCellHeading='Work Order Note'
	var the_orig_note=the_locator_recipe.prepare()
	
	if(the_orig_note == null)
	{
		var the_values = {}
		the_values["Work Order Id"] = workOrderId
		the_values["Work Order Note"] = the_value
		the_values["ServerRN"] = "0"
		
		var the_row = myProgram.mainDS.wo_note_headings.dbCreateRow(the_values, "wo_note")
		this.mainDS.wo_note_list.push(the_row)
	}
         
        return the_orig_note
}
window.MyRecipe.prototype.myUpdateWorkOrderNoteRow._methodName='myUpdateWorkOrderNoteRow'
window.MyRecipe.prototype.myWorkOrderNoteTextArea = function()
{
	var the_textarea_configuration='{"initialConfigurationName":"generic_textarea",\
			"rowsAttribute":"20","colsAttribute":"100","onchangeAttribute":"myProgram.myUpdateWorkOrderNoteRow()","styleAttribute":"overflow:scroll;word-wrap:normal","idAttribute":"workorder_note_text_area"}'
	var the_recipe=new GUITextAreaRecipe(the_textarea_configuration)
	the_recipe.styleAttribute="word-wrap:break-word;width:530px;"
	the_recipe.classAttribute="text"
	var the_locator_recipe=new SUITableCellValueLocatorRecipe({"initialConfigurationName":"generic_table_cell_value_locator"})
	the_locator_recipe.tableRows=this.mainDS.wo_note_list
	the_locator_recipe.tableHeadings=this.mainDS.wo_note_headings
	the_locator_recipe.tableLocatorHeading=this.mainDS.wo_id_heading
	the_locator_recipe.tableLocatorFilter=this.mainDS.current_workorder_id
	the_locator_recipe.tableTargetCellHeading='Work Order Note'
	var the_note=the_locator_recipe.prepare()
	if(the_note == null)the_note = ""
	the_recipe.contents=unescape(the_note)
	return the_recipe
}
window.MyRecipe.prototype.myWorkOrderNoteTextArea._methodName='myWorkOrderNoteTextArea'
window.MyRecipe.prototype.myRecommendationTextAreaRecipe = function()
{
	var the_textarea_configuration='{"initialConfigurationName":"generic_textarea","styleAttribute":"overflow:scroll;word-wrap:normal","idAttribute":"recommendation_text_area"}'
	var the_recipe=new GUITextAreaRecipe(the_textarea_configuration)
	the_recipe.styleAttribute += ";font-size:11px;"
	var the_locator_recipe=new SUITableCellValueLocatorRecipe({"initialConfigurationName":"generic_table_cell_value_locator"})
	the_locator_recipe.tableRows=this.mainDS.wo_recommendation_list
	the_locator_recipe.tableHeadings=this.mainDS.wo_recommendation_headings
	the_locator_recipe.tableLocatorHeading=this.mainDS.wo_id_heading
	the_locator_recipe.tableLocatorFilter=this.mainDS.current_workorder_id
	the_locator_recipe.tableTargetCellHeading='Recommendation'
	var the_recommendation=the_locator_recipe.prepare()
	if(the_recommendation == null)the_recommendation = ""
	the_recipe.contents=unescape(the_recommendation)
	
	if(myProgram.isWorkOrderReadOnly()) the_recipe.disabledAttribute = true
	
	return the_recipe
}
window.MyRecipe.prototype.myRecommendationTextAreaRecipe._methodName='myRecommendationTextAreaRecipe'
window.MyRecipe.prototype.myUpdateWorkPerformedDo = function()
{
	var the_element=window['work_performed_text_area']
	if(the_element!=null)
	{
		var the_value=the_element.value
		/*while(the_value.indexOf("\r\n") != -1)
		{
			//alert(the_value)
			the_value = the_value.replace("\r\n","\x0d")
			//alert(the_value)
		}*/
		
		var the_locator_recipe=new SUITableCellValueLocatorRecipe({"initialConfigurationName":"generic_table_cell_value_locator"})
		the_locator_recipe.tableRows=this.mainDS.wo_equipment_list
		the_locator_recipe.tableHeadings=this.mainDS.wo_equipment_headings
		the_locator_recipe.tableCellNewValue=the_value
		the_locator_recipe.tableLocatorHeading=[].dbPush("RN").dbPush(this.mainDS.wo_id_heading)
		the_locator_recipe.tableLocatorFilter=[].dbPush(this.mainDS.current_equipment_rn).dbPush(this.mainDS.current_workorder_id)
		the_locator_recipe.tableTargetCellHeading='Work Performed'
		var the_old_value=the_locator_recipe.prepare()
		
		var the_locator_recipe=new SUITableCellValueLocatorRecipe({"initialConfigurationName":"generic_table_cell_value_locator"})
		the_locator_recipe.tableRows=this.mainDS.wo_equipment_list
		the_locator_recipe.tableHeadings=this.mainDS.wo_equipment_headings
		the_locator_recipe.tableCellNewValue='n'
		the_locator_recipe.tableLocatorHeading=[].dbPush("RN").dbPush(this.mainDS.wo_id_heading)
		the_locator_recipe.tableLocatorFilter=[].dbPush(this.mainDS.current_equipment_rn).dbPush(this.mainDS.current_workorder_id)
		the_locator_recipe.tableTargetCellHeading='Transmitted'
		var the_old_value=the_locator_recipe.prepare()
		this.mySaveData()
	}
}
window.MyRecipe.prototype.myUpdateWorkPerformedDo._methodName='myUpdateWorkPerformedDo'
window.MyRecipe.prototype.myUpdateRecommendationDo = function()
{
	var the_element=window['recommendation_text_area']
	if(the_element!=null)
	{
		var the_locator_recipe=new SUITableCellValueLocatorRecipe({"initialConfigurationName":"generic_table_cell_value_locator"})
		the_locator_recipe.tableRows=this.mainDS.wo_recommendation_list
		the_locator_recipe.tableHeadings=this.mainDS.wo_recommendation_headings
		the_locator_recipe.tableLocatorHeading=this.mainDS.wo_id_heading
		the_locator_recipe.tableLocatorFilter=this.mainDS.current_workorder_id
		the_locator_recipe.tableTargetCellHeading='Transmitted'
		var transmitted_value=the_locator_recipe.prepare()
		
		if(transmitted_value == "y")
		{
			var the_locator_recipe=new SUITableCellValueLocatorRecipe({"initialConfigurationName":"generic_table_cell_value_locator"})
			the_locator_recipe.tableRows=this.mainDS.wo_recommendation_list
			the_locator_recipe.tableHeadings=this.mainDS.wo_recommendation_headings
			the_locator_recipe.tableLocatorHeading=this.mainDS.wo_id_heading
			the_locator_recipe.tableLocatorFilter=this.mainDS.current_workorder_id
			the_locator_recipe.tableTargetCellHeading='Recommendation'
			var the_old_value=the_locator_recipe.prepare()
		
			if(the_old_value != the_element.value)
			{
				alert("[Ref Code:34] This work orders recommendations have already been transmitted. Additional changes are not permitted")
			}
			return;
		}
		
		var the_value=the_element.value
//		alert(the_value)
		var the_locator_recipe=new SUITableCellValueLocatorRecipe({"initialConfigurationName":"generic_table_cell_value_locator"})
		the_locator_recipe.tableRows=this.mainDS.wo_recommendation_list
		the_locator_recipe.tableHeadings=this.mainDS.wo_recommendation_headings
		the_locator_recipe.tableCellNewValue=the_value
		the_locator_recipe.tableLocatorHeading=this.mainDS.wo_id_heading
		the_locator_recipe.tableLocatorFilter=this.mainDS.current_workorder_id
		the_locator_recipe.tableTargetCellHeading='Recommendation'
		var the_old_value=the_locator_recipe.prepare()
		
		var the_locator_recipe=new SUITableCellValueLocatorRecipe({"initialConfigurationName":"generic_table_cell_value_locator"})
		the_locator_recipe.tableRows=this.mainDS.wo_recommendation_list
		the_locator_recipe.tableHeadings=this.mainDS.wo_recommendation_headings
		the_locator_recipe.tableCellNewValue="n"
		the_locator_recipe.tableLocatorHeading=this.mainDS.wo_id_heading
		the_locator_recipe.tableLocatorFilter=this.mainDS.current_workorder_id
		the_locator_recipe.tableTargetCellHeading='Transmitted'
		var the_old_value=the_locator_recipe.prepare()
		
		//2005-12-14 (jc)-[325]-Changed this check to compare to null, as locator recipe returns null or the located value.
		if(the_old_value == null)
		{
			//Insert the row.
			the_values = {};
			the_values["Work Order Id"] = this.mainDS.current_workorder_id
			the_values["Recommendation"] = the_value
			the_values["ServerRN"] = "0"
			
			var the_row = this.mainDS.wo_recommendation_headings.dbCreateRow(the_values, "wo_recommendation")
			
			this.mainDS.wo_recommendation_list.push(the_row);
		}
		this.mySaveData()
	}
}
window.MyRecipe.prototype.myUpdateRecommendationDo._methodName='myUpdateRecommendationDo'
window.MyRecipe.prototype.myUpdateWorkPerformedPage = function()
{
	var the_equipment_id=this.mainDS.current_equipment_id
	var the_recipe=this.myWorkOrderInfo()
	var the_template=the_recipe.template
	the_template.dbUnshift(this.myReturnToWorkOrderDetailButtonRecipe())
	the_template.dbUnshift(this.myHelpButtonRecipe())
	the_template.dbUnshift('<div style="font-family:arial;font-size:20;color:black">Update Work Performed</div>')
	the_template.dbPush('<div style="font-family:arial;font-size:20;color:black">Work Performed :'+the_equipment_id+'</div>')
 	the_template.dbPush(this.myWorkPerformedTextAreaRecipe())
 	//the_template.dbPush('<div style="font-family:arial;font-size:14;color:red">Common Phrases</div>')
 	the_template.dbPush(this.myCommonPhraseComboBox().prepare()+this.myAddCommonPhraseButtonRecipe().prepare())
 	the_template.dbPush('<br/>')
	the_template.dbPush(this.myReturnToWorkOrderDetailButtonRecipe())
	the_recipe.parentElementId="main_division"
	the_recipe.breakpointOnPrepare=false
	this.tempDS.current_page_recipe=the_recipe
	this.mainDS.start_focus_id='work_performed_text_area'
}
window.MyRecipe.prototype.myUpdateWorkPerformedPage._methodName='myUpdateWorkPerformedPage'
window.MyRecipe.prototype.myViewRecommendationPage = function()
{
	var the_workorder_id=this.mainDS.current_workorder_id
	var the_recipe=this.myWorkOrderInfo()
	var the_template=the_recipe.template
	the_template.dbUnshift(this.myReturnToWorkOrderDetailButtonRecipe())
	the_template.dbUnshift(this.myRecommendationHelpButtonRecipe())
	the_template.dbUnshift('<div style="font-family:arial;font-size:20;color:black">Update Recommendations</div>')
	the_template.dbPush('<br/>')
	the_template.dbPush('<div style="font-family:arial;font-size:20px;color:black">Recommendations For Work Order:'+the_workorder_id+'</div>')
 	the_template.dbPush('<br/>')
 	the_template.dbPush(this.myRecommendationTextAreaRecipe())
 	the_template.dbPush('<br/>')
	the_template.dbPush(this.myReturnToWorkOrderDetailButtonRecipe())
	the_recipe.parentElementId="main_division"
	the_recipe.breakpointOnPrepare=false
	this.tempDS.current_page_recipe=the_recipe
	this.mainDS.start_focus_id='recommendation_text_area'
	return the_recipe
}
window.MyRecipe.prototype.myViewRecommendationPage._methodName='myViewRecommendationPage'
window.MyRecipe.prototype.myMetricsGrid = function()
{
	var the_labor_grid=new GUISimpleGridRecipe('{"initialConfigurationName":"generic_simple_grid",minRowCount:5}')
	the_labor_grid.scrollingHeight=100
	the_labor_grid.columnWidths=[100,355]
	the_labor_grid.columnCount=2
	the_labor_grid.disallowEditTransmittedAttribute = true
	
	the_labor_grid.idAttribute='wo_metrics_'
	the_labor_grid.alert=false
	//the_labor_grid.cellOnClick=[null,"myProgram.myEditControl('_cell_escaped_contents_','_grid_id_','_cell_id_','_heading_contents_','_row_number_','_column_number_')"]
	var the_table=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'})
	the_table.sourceRows=this.mainDS.static_metrics_list
	the_table.sourceHeadings=this.mainDS.static_metrics_headings
	the_table.filterOnSourceHeadings=[].dbPush(this.mainDS.wo_id_heading).dbPush("Equipment Id").dbPush(this.mainDS.static_metrics_id_heading)
	the_table.filterValues=[].dbPush(this.mainDS.current_workorder_id).dbPush(this.mainDS.current_equipment_id).dbPush(myProgram.myStaticMetricsGridFilter)
	the_table.sortOnSourceHeadings=[].dbPush(this.mainDS.wo_id_heading)
	the_table.targetHeadings=this.mainDS.static_metrics_grid_headings
	this.tempDS.static_metrics_grid_list=the_table.prepare()
	the_labor_grid.rows=this.tempDS.static_metrics_grid_list
	the_labor_grid.defaultColumnWidth=null
	the_labor_grid.headings=the_table.targetHeadings
//	the_labor_grid.cellOnClick=["myProgram.myNewPage('edit_labor_page','_row_number_','_column_number_')"]
	return the_labor_grid
}
window.MyRecipe.prototype.myMetricsGrid._methodName='myMetricsGrid'
window.MyRecipe.prototype.myStaticMetricsGridFilter = function(val)
{
	//Locate the equipment row that contains the current selected equipment.
	var the_locator_recipe=new SUITableCellValueLocatorRecipe({"initialConfigurationName":"generic_table_cell_value_locator"})
	the_locator_recipe.tableRows=myProgram.mainDS.wo_equipment_list
	the_locator_recipe.tableHeadings=myProgram.mainDS.wo_equipment_headings
	the_locator_recipe.tableLocatorHeading="Equipment Id"
	the_locator_recipe.tableLocatorFilter=myProgram.mainDS.current_equipment_id
	the_locator_recipe.tableTargetCellHeading="Metrics Id"
	var metrics_id=the_locator_recipe.prepare()
	
	if(val.row[0] == metrics_id)
	{
		return true;
	}
	else
	{
		return false;
	}
}
window.MyRecipe.prototype.myStaticMetricsGridFilter._methodName='myStaticMetricsGridFilter'
window.MyRecipe.prototype.myOnCollateralLineDeletion = function(params)
{
	var the_rn = params.RN.toString()
	
	var the_rows_recipe=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'});
	the_rows_recipe.filterValues=[].dbPush(the_rn);
	the_rows_recipe.filterOnSourceHeadings=[].dbPush("RN");
	the_rows_recipe.sourceRows=this.mainDS.wo_collateral_list;
	the_rows_recipe.sourceHeadings=myProgram.mainDS.wo_collateral_headings;
	the_rows_recipe.targetHeadings=myProgram.mainDS.wo_collateral_headings;
	var result_rows=the_rows_recipe.prepare();
	
	var collateral_row = result_rows[0]
	
	var work_order_id_index = this.mainDS.wo_collateral_headings.dbIndexOf("Work Order Id")
	var work_order_id_value = collateral_row[work_order_id_index]
	
	var fileName_index = this.mainDS.wo_collateral_headings.dbIndexOf("File")
	var fileName = collateral_row[fileName_index]
	
	this.myDeleteCollateralFileForWorkOrder(fileName, work_order_id_value)
}
window.MyRecipe.prototype.myOnCollateralLineDeletion._methodName='myOnCollateralLineDeletion'
window.MyRecipe.prototype.myDeleteCollateralFileForWorkOrder = function(fileName, work_order_id_value)
{
	var fso = new ActiveXObject("Scripting.FileSystemObject")
	var parentFolderObject = fso.getFolder(this.myCurrentDirectory('back', false)+"\\Collateral\\"+work_order_id_value)
	
	fso.DeleteFile(this.myCurrentDirectory('back', false)+"\\Collateral\\"+work_order_id_value+"\\"+fileName)
	
	if(parentFolderObject.Files.Count == 0)
	{
		fso.DeleteFolder(this.myCurrentDirectory('back', false)+"\\Collateral\\"+work_order_id_value)
	}
}
window.MyRecipe.prototype.myDeleteCollateralFileForWorkOrder._methodName='myDeleteCollateralFileForWorkOrder'
window.MyRecipe.prototype.myRODocumentManagementGrid = function()
{
	if(this.mainDS.static_document_management_headings == null)
	{
		this.mainDS.static_document_management_headings = ["Done","SiteId","ReferenceId","ReferenceType","Category","Description","FileLocation","Work Order Id","DateLogged","TimeLogged","KeyWords","RN"]
	}
	
	this.mainDS.static_document_management_grid_headings = ["Done","SiteId","ReferenceId","ReferenceType","Category","Description","FileLocation","RN"]
	
	if(this.mainDS.static_document_management_list == null)
	{
		this.mainDS.static_document_management_list = []
	}
	var the_document_grid=new GUISimpleGridRecipe('{"initialConfigurationName":"generic_simple_grid_with_horizontal_scrolling",minRowCount:5}')
	the_document_grid.scrollingHeight=100
	the_document_grid.columnWidths=[40,100,100,120,100,100,100]
	the_document_grid.columnCount=7
	the_document_grid.gridHeight=150
	the_document_grid.gridWidth=665
	//the_collateral_grid.disallowEditTransmittedAttribute = true
	//the_collateral_grid.onDeleteFunctionAttribute = "myProgram.myOnCollateralLineDeletion"
	
	/*the_row_numbers_string='{"rn_heading":"Line","rn_width":75,\
			"rn_cell_on_click_template":"_cell_contents_\
			<a id=\\\"collateral_line__cell_contents_\\\" href=#abc onclick=\\\"myProgram.myDeleteItem(\'_grid_id_\',\'_row_number_\',\'_column_number_\')\\\" >\
				<img src=\'mydeleteitem.gif\' alt=\'Delete Row\' style=\'border-width:1;vertical-align:bottom\'></a>"\
			}'*/
	
	the_row_numbers_string='{"rn_heading":"Line","rn_width":75,\
							 "rn_cell_on_click":"myProgram.myViewRODocument(\'_row_number_\',\'_column_number_\')",\
							 "rn_cell_on_click_template":"_cell_contents_\
							 <a id=\\\"__cell_contents_\\\" href=#abc onclick=\\\"myProgram.myViewRODocument(\'_row_number_\',\'_column_number_\')\\\" >\
							 <img src=\'myselectitem.gif\' alt=\'View Document\' style=\'border-width:1;vertical-align:bottom\'></a>"\}'
	
	the_document_grid.addRowNumbers=the_row_numbers_string		
	
	if(this.mainDS.static_document_management_grid_list_base_name == null) this.mainDS.static_document_management_grid_list_base_name = "static_document_management_grid"
	if(this.mainDS.static_document_management_list_base_name == null) this.mainDS.static_document_management_list_base_name = "static_document_management"
	the_document_grid.idAttribute='static_document_management_'
	
	the_document_grid.alert=false
	the_document_grid.cellOnClickDefault="myProgram.myEditControl('_cell_escaped_contents_','_grid_id_','_cell_id_','_heading_contents_','_row_number_','_column_number_')"
	var the_table=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'})
	the_table.sourceRows=this.mainDS.static_document_management_list
	the_table.sourceHeadings=this.mainDS.static_document_management_headings
	the_table.filterOnSourceHeadings=[].dbPush(this.mainDS.wo_id_heading)
	the_table.filterValues=[].dbPush(this.mainDS.current_workorder_id)
	the_table.targetHeadings=this.mainDS.static_document_management_grid_headings
	this.tempDS.static_document_management_grid_list=the_table.prepare()
	the_document_grid.rows=this.tempDS.static_document_management_grid_list
	the_document_grid.defaultColumnWidth=null
	the_document_grid.headings=the_table.targetHeadings
	the_document_grid.displayOnlyColumnIndices = [2,3,4,5,6,7]
//	the_labor_grid.cellOnClick=["myProgram.myNewPage('edit_labor_page','_row_number_','_column_number_')"]
	return the_document_grid
}
window.MyRecipe.prototype.myRODocumentManagementGrid._methodName='myRODocumentManagementGrid'
window.MyRecipe.prototype.myViewRODocument = function(rowNumber, columnNumber)
{
	var rnIndex = myProgram.mainDS.static_document_management_grid_headings.dbIndexOf("RN")
	var rn = myProgram.tempDS.static_document_management_grid_list[rowNumber][rnIndex]
	
	var the_rows_recipe=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'});
	the_rows_recipe.filterValues=[].dbPush(rn)
	the_rows_recipe.filterOnSourceHeadings=[].dbPush("RN");
	the_rows_recipe.sourceRows=this.mainDS.static_document_management_list;
	the_rows_recipe.sourceHeadings=this.mainDS.static_document_management_headings;
	the_rows_recipe.targetHeadings=this.mainDS.static_document_management_headings;
	the_rows_recipe.sortOnSourceHeadings=[];
	var documentManagementRow = the_rows_recipe.prepare()[0];
	
	var location_index = this.mainDS.static_document_management_headings.dbIndexOf("FileLocation");
	var location_value = documentManagementRow[location_index];
	var dateIndex = this.mainDS.static_document_management_headings.dbIndexOf("DateLogged")
	var timeIndex = this.mainDS.static_document_management_headings.dbIndexOf("TimeLogged")
	var keyWordsIndex = this.mainDS.static_document_management_headings.dbIndexOf("KeyWords")
		
	var dateLogged = documentManagementRow[dateIndex]
	var timeLogged = documentManagementRow[timeIndex]
	var keyWords = documentManagementRow[keyWordsIndex]
		
	var cacheFilename = location_value.split(".")[0]+"_"+dateLogged+"_"+timeLogged.replace(/:/g, "")+"."+location_value.split(".")[1]
	
	var cacheFilenameAndPath = this.myCurrentDirectory()+"DocumentsInProgress\\"+this.mainDS.current_workorder_id+"\\"+cacheFilename
	
	if(!this.myFileExists(cacheFilenameAndPath))
	{
		this.myRankAndProcessDocument(cacheFilename, keyWords)
	}
	
	this.openDocument(cacheFilenameAndPath)	
}
window.MyRecipe.prototype.myViewRODocument._methodName='myViewRODocument'
window.MyRecipe.prototype.prepareRequiredDocuments = function()
{
	var rnIndex = myProgram.mainDS.static_document_management_headings.dbIndexOf("RN")
	var workOrderIndex = myProgram.mainDS.static_document_management_headings.dbIndexOf("Work Order Id")
	
	for(var rowNumber = 0; rowNumber < myProgram.mainDS.static_document_management_list.length; rowNumber++)
	{
		var rn = myProgram.mainDS.static_document_management_list[rowNumber][rnIndex]
		var workOrderId = myProgram.mainDS.static_document_management_list[rowNumber][workOrderIndex]
		
		if(workOrderId == this.mainDS.current_workorder_id)
		{
			var the_rows_recipe=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'});
			the_rows_recipe.filterValues=[].dbPush(rn)
			the_rows_recipe.filterOnSourceHeadings=[].dbPush("RN");
			the_rows_recipe.sourceRows=this.mainDS.static_document_management_list;
			the_rows_recipe.sourceHeadings=this.mainDS.static_document_management_headings;
			the_rows_recipe.targetHeadings=this.mainDS.static_document_management_headings;
			the_rows_recipe.sortOnSourceHeadings=[];
			var documentManagementRow = the_rows_recipe.prepare()[0];
			
			var location_index = this.mainDS.static_document_management_headings.dbIndexOf("FileLocation");
			var location_value = documentManagementRow[location_index];
			var dateIndex = this.mainDS.static_document_management_headings.dbIndexOf("DateLogged")
			var timeIndex = this.mainDS.static_document_management_headings.dbIndexOf("TimeLogged")
			var keyWordsIndex = this.mainDS.static_document_management_headings.dbIndexOf("KeyWords")
				
			var dateLogged = documentManagementRow[dateIndex]
			var timeLogged = documentManagementRow[timeIndex]
			var keyWords = documentManagementRow[keyWordsIndex]
				
			var cacheFilename = location_value.split(".")[0]+"_"+dateLogged+"_"+timeLogged.replace(/:/g, "")+"."+location_value.split(".")[1]
			
			var cacheFilenameAndPath = this.myCurrentDirectory()+"DocumentsInProgress\\"+myProgram.mainDS.current_workorder_id+"\\"+cacheFilename
			
			if(!this.myFileExists(cacheFilenameAndPath))
			{
				this.myRankAndProcessDocument(cacheFilename, keyWords)
			}
		}
	}
}
window.MyRecipe.prototype.prepareRequiredDocuments._methodName='prepareRequiredDocuments'
window.MyRecipe.prototype.myCollateralGrid = function()
{
	var the_collateral_grid=new GUISimpleGridRecipe('{"initialConfigurationName":"generic_simple_grid_with_horizontal_scrolling",minRowCount:5}')
	the_collateral_grid.scrollingHeight=100
	the_collateral_grid.columnWidths=[100,100,100,100]
	the_collateral_grid.columnCount=4
	the_collateral_grid.disallowEditTransmittedAttribute = true
	the_collateral_grid.onDeleteFunctionAttribute = "myProgram.myOnCollateralLineDeletion"
	the_collateral_grid.gridWidth=405
	the_row_numbers_string='{"rn_heading":"Line","rn_width":75,\
			"rn_cell_on_click_template":"_cell_contents_\
			<a id=\\\"collateral_line__cell_contents_\\\" href=#abc onclick=\\\"myProgram.myDeleteItem(\'_grid_id_\',\'_row_number_\',\'_column_number_\')\\\" >\
				<img src=\'mydeleteitem.gif\' alt=\'Delete Row\' style=\'border-width:1;vertical-align:bottom\'></a>"\
			}'
			
	if(this.mainDS.wo_collateral_grid_headings == null) this.mainDS.wo_collateral_grid_headings = ["Equipment Id","Category","Collateral Description","RN"]
	if(this.mainDS.wo_collateral_grid_list_base_name == null) this.mainDS.wo_collateral_grid_list_base_name = "wo_collateral_grid"
	if(this.mainDS.wo_collateral_list_base_name == null) this.mainDS.wo_collateral_list_base_name = "wo_collateral"
	
	the_collateral_grid.addRowNumbers=the_row_numbers_string
	the_collateral_grid.idAttribute='wo_collateral_'
	the_collateral_grid.alert=false
	the_collateral_grid.cellOnClickDefault="myProgram.myEditControl('_cell_escaped_contents_','_grid_id_','_cell_id_','_heading_contents_','_row_number_','_column_number_')"
	var the_table=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'})
	the_table.sourceRows=this.mainDS.wo_collateral_list
	the_table.sourceHeadings=this.mainDS.wo_collateral_headings
	the_table.filterOnSourceHeadings=[].dbPush(this.mainDS.wo_id_heading).dbPush("Transmitted")
	the_table.filterValues=[].dbPush(this.mainDS.current_workorder_id).dbPush(function(val){return val.value != "deleted"})
	the_table.sortOnSourceHeadings=[].dbPush(this.mainDS.wo_id_heading)
	the_table.targetHeadings=this.mainDS.wo_collateral_grid_headings
	this.tempDS.wo_collateral_grid_list=the_table.prepare()
	the_collateral_grid.rows=this.tempDS.wo_collateral_grid_list
	the_collateral_grid.defaultColumnWidth=null
	the_collateral_grid.headings=the_table.targetHeadings
//	the_labor_grid.cellOnClick=["myProgram.myNewPage('edit_labor_page','_row_number_','_column_number_')"]
	return the_collateral_grid
}
window.MyRecipe.prototype.myCollateralGrid._methodName='myCollateralGrid'
window.MyRecipe.prototype.myFlatRateGrid = function()
{
	var this_recipe=new GUIDataEntryGridRecipe('{"initialConfigurationName":"","finalIngredients":{}}')
	this_recipe.idAttribute="wo_flat_rate_"
	this_recipe.gridRecipe = new GUISimpleGridRecipe({"initialConfigurationName":"generic_simple_data_entry_grid","minRowCount":6})
	this_recipe.gridRecipe.gridWidth = 745
	this_recipe.gridRecipe.gridHeight = 300
	this_recipe.gridRecipe.headingDefaultStyle=this_recipe.gridRecipe.headingDefaultStyle+";font-family:arial;color:black;font-size:11; background-color:#7ac98e;border-style:solid;border-color:#676566;border-width:1 1 1 0;padding:1;"
	this_recipe.gridRecipe.cellDefaultStyle=this_recipe.gridRecipe.cellDefaultStyle+";font-size:11;color:black;border-color:#676566;border-width:0 1 1 0;padding:1;font-family:arial;height:20;"
	
	this_recipe.gridRecipe.gridStyle=";border-width:0;"
	this_recipe.gridStyle=";border-width:0;"
	this_recipe.gridRecipe.styleAttribute=";border-width:0;"
	this_recipe.gridRecipe.outerDivBorderWidth="0 0 0 0"//Changed tell Bill
	this_recipe.gridRecipe.scrollingHeight = "0;overflow:scroll;"
	this_recipe.alert=false
	this_recipe.gridRecipe.breakpointOnPrepare=false

	this_recipe.columnDefaultWidth=100
	this_recipe.columnCount=8
	this_recipe.columnWidths=[45,114,211,117,60,70,70,40]
	
	this_recipe.addRowInitialDataValues={"Quantity":1,
										 "Flat Rate Id":myProgram.myFirstFlatRateValue("Flat Rate Id"),
										 "Description":myProgram.myFirstFlatRateValue("Description"),
										 "Equipment Id":myProgram.getDefaultEquipmentIdForWorkOrderId(myProgram.mainDS.current_workorder_id),
									     "Unit Price":myProgram.myUnitPriceFor(myProgram.myFirstFlatRateValue("Flat Rate Id"), myProgram.myFirstPriceLevel()),
										 "Price":(1*myProgram.myUnitPriceFor(myProgram.myFirstFlatRateValue("Flat Rate Id"), myProgram.myFirstPriceLevel())).toFixed(2),
										 "Price Level":myProgram.myFirstPriceLevel(),
										 "Taxable":"N",
										 "Transmitted":"n",
										 "Work Order Id":myProgram.mainDS.current_workorder_id}
	
	this_recipe.headings='myData["grid_headings"]["myFlatRateGrid"]'
	this_recipe.dataHeadings=this.mainDS.wo_flat_rate_headings
	
	this_recipe.inputFieldRecipes = []
	
	this_recipe.inputFieldDefaultRecipe=new GUIInputFieldRecipe({initialConfigurationName:'generic_data_entry_field'})
	this_recipe.inputFieldDefaultRecipe.sizeAttribute="11"
	this_recipe.inputFieldDefaultRecipe.styleAttribute=";border:0 px solid grey;background-color:white;font-size:11;"
	
	var flatRateInputRecipe = new GUIInputFieldRecipe({initialConfigurationName:'generic_text_input_field'})
	flatRateInputRecipe.myischangeokAttribute = __('myFlatRateChangedCodeString')
	flatRateInputRecipe.styleAttribute=";border:0 px solid grey;background-color:white;font-size:11;width:93"
	this_recipe.inputFieldRecipes[1] = flatRateInputRecipe
	
	var quantityInputRecipe = new GUIInputFieldRecipe({initialConfigurationName:'generic_text_input_field'})
	quantityInputRecipe.myischangeokAttribute = __('myBillQuantityHasChangedCodeString')
	quantityInputRecipe.styleAttribute=";border:0 px solid grey;background-color:white;font-size:11;width:93"
	this_recipe.inputFieldRecipes[0] = quantityInputRecipe
	
	var descriptionInputRecipe = new GUIInputFieldRecipe({initialConfigurationName:'generic_text_input_field'})
	descriptionInputRecipe.disabledAttribute = true
	descriptionInputRecipe.styleAttribute=";border:0 px solid grey;background-color:white;color:black;font-size:11;width:205px;"
	this_recipe.inputFieldRecipes[2] = descriptionInputRecipe
	
	var unitPriceInputRecipe = new GUIInputFieldRecipe({initialConfigurationName:'generic_text_input_field'})
	unitPriceInputRecipe.myischangeokAttribute = __('myUnitPriceHasChangedCodeString')
	unitPriceInputRecipe.styleAttribute=";border:0 px solid grey;background-color:white;font-size:11;width:93"
	this_recipe.inputFieldRecipes[5] = unitPriceInputRecipe
	
	
	
	var priceLevelInputRecipe = new GUIInputFieldRecipe({initialConfigurationName:'generic_data_entry_field'})
	//partNumberInputRecipe.oncontextmenuAttribute = __('myPartNumberContextMenuCodeString')
	priceLevelInputRecipe.myischangeokAttribute = __('myPriceLevelChangedCodeString')
	priceLevelInputRecipe.styleAttribute=";border:0 px solid grey;background-color:white;font-size:11;width:39"
	this_recipe.inputFieldRecipes[4] = priceLevelInputRecipe
	
	var priceInputRecipe = new GUIInputFieldRecipe({initialConfigurationName:'generic_text_input_field'})
	priceInputRecipe.disabledAttribute = true
	priceInputRecipe.styleAttribute=";border:0 px solid grey;background-color:white;font-size:11;width:93"
	this_recipe.inputFieldRecipes[6] = priceInputRecipe
	
	var taxableInputRecipe = new GUIInputFieldRecipe({initialConfigurationName:'generic_text_input_field'})
	taxableInputRecipe.disabledAttribute = true
	taxableInputRecipe.styleAttribute=";border:0 px solid grey;background-color:white;font-size:11;width:93"
	this_recipe.inputFieldRecipes[7] = taxableInputRecipe
	
	var listDefaultRecipe = new GUIListRecipe({initialConfigurationName:"constraint_list"})
	listDefaultRecipe.listItemStyle+=";color:black;font-family:arial;background-color:white;font-size:11;"
	listDefaultRecipe.selectedBackgroundColor="gray"
	listDefaultRecipe.mouseOverBackgroundColor="#316ac5"
	//listDefaultRecipe.breakpointOnPrepare=true
	this_recipe.listDefaultRecipe = listDefaultRecipe
	
	this_recipe.rows=this.myFlatRateGridRows()
	this_recipe.dataRows='myProgram.mainDS.wo_flat_rate_list'
	this_recipe.joinColumnName='RN'
	this_recipe.formats=[{format:"number",scale:6,precision:2},
						{format:"list",items:__("myFlatRateItems")},
						{format:"text"},
						{format:"list",items:__("myEquipmentItems")},
						{format:"list",items:__("myPriceLevelItems")},
						{format:"number",scale:10,precision:2},
						{format:"number",scale:10,precision:2},
						{format:"text",length:30}]
	return this_recipe
}
window.MyRecipe.prototype.myFlatRateGrid._methodName='myFlatRateGrid'
window.MyRecipe.prototype.myFirstPriceLevel = function()
{
	return myProgram.flatRateDS.static_flat_rate_price_level_list[0][0]
}
window.MyRecipe.prototype.myFirstPriceLevel._methodName='myFirstPriceLevel'
window.MyRecipe.prototype.myFirstFlatRateValue = function(heading)
{
	var flatRateIdIndex = myProgram.flatRateDS.static_flat_rate_headings.dbIndexOf(heading)
	return myProgram.flatRateDS.static_flat_rate_list[0][flatRateIdIndex]
}
window.MyRecipe.prototype.myFirstFlatRateValue._methodName='myFirstFlatRateValue'
window.MyRecipe.prototype.myFlatRateItems = function()
{
	var the_table=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'})
	the_table.sourceRows=this.flatRateDS["static_flat_rate_list"]
	the_table.sourceHeadings=this.flatRateDS.static_flat_rate_headings
	the_table.sortOnSourceHeadings=[].dbPush("Flat Rate Id")
	the_table.targetHeadings=["Flat Rate Id"]
	return the_table.prepare()
}
window.MyRecipe.prototype.myFlatRateItems._methodName='myFlatRateItems'
window.MyRecipe.prototype.myFlatRateGridRows = function()
{
	var the_table=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'})
	the_table.sourceRows=this.mainDS.wo_flat_rate_list
	the_table.sourceHeadings=this.mainDS.wo_flat_rate_headings
	the_table.filterOnSourceHeadings=[].dbPush(this.mainDS.wo_id_heading).dbPush("Transmitted")
	the_table.filterValues=[].dbPush(this.mainDS.current_workorder_id).dbPush(function(val){return val.value != "deleted"})
	the_table.sortOnSourceHeadings=[].dbPush(this.mainDS.wo_id_heading)
	the_table.targetHeadings=myData["grid_headings"]["myFlatRateGrid"]
	this.tempDS.wo_flat_rate_grid_list=the_table.prepare()
	
	return 'myProgram.tempDS.wo_flat_rate_grid_list'
}
window.MyRecipe.prototype.myFlatRateGridRows._methodName='myFlatRateGridRows'
window.MyRecipe.prototype.myFlatRateGridOBSOLETE = function()
{
	/*
	  Quantity� (validation logic similar to Misc Quantity)
	  Flat Rate Id (drop down list from static_flat_rate_list) link to Flat Rate Locate functionality
	  Price Level (drop down list from static_flat_rate_list)
	  Unit Price (defaulting logic described later in this case)
	  Price (defaulting logic described later in this case)
	  Taxable (defaulting logic described later in this case)
	  Tax Base
	*/
	var the_flat_rate_grid=new GUISimpleGridRecipe('{"initialConfigurationName":"generic_simple_grid",minRowCount:5}')
	the_flat_rate_grid.scrollingHeight=100
	the_flat_rate_grid.columnWidths=[70,70,70,70,80,40,70]
	the_flat_rate_grid.displayOnlyColumnIndices = [1,2,3,4,5,6,7]
	the_flat_rate_grid.columnCount=8
	the_flat_rate_grid.disallowEditTransmittedAttribute = true
	the_row_numbers_string='{"rn_heading":"Line","rn_width":75,\
			"rn_cell_on_click":"myProgram.myNewPage(\'edit_flat_rate_page\',\'_row_number_\',\'_column_number_\')",\
			"rn_cell_on_click_template":"_cell_contents_\
			<a id=\\\"labor_line__cell_contents_\\\" href=#abc onclick=\\\"myProgram.myDeleteItem(\'_grid_id_\',\'_row_number_\',\'_column_number_\')\\\" >\
				<img src=\'mydeleteitem.gif\' alt=\'Delete Row\' style=\'border-width:1;vertical-align:bottom\'></a>"\
			}'
	the_flat_rate_grid.addRowNumbers=the_row_numbers_string
	the_flat_rate_grid.idAttribute='wo_flat_rate_'
	the_flat_rate_grid.alert=false
	the_flat_rate_grid.cellOnClickDefault="myProgram.myEditControl('_cell_escaped_contents_','_grid_id_','_cell_id_','_heading_contents_','_row_number_','_column_number_')"
	var the_table=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'})
	the_table.sourceRows=this.mainDS.wo_flat_rate_list
	the_table.sourceHeadings=this.mainDS.wo_flat_rate_headings
	the_table.filterOnSourceHeadings=[].dbPush(this.mainDS.wo_id_heading).dbPush("Transmitted")
	the_table.filterValues=[].dbPush(this.mainDS.current_workorder_id).dbPush(function(val){return val.value != "deleted"})
	the_table.sortOnSourceHeadings=[].dbPush(this.mainDS.wo_id_heading)
	the_table.targetHeadings=this.mainDS.wo_flat_rate_grid_headings=["Quantity","Flat Rate Id","Description","Price Level","Unit Price","Price","Taxable","Transmitted","RN"]
	this.tempDS.wo_flat_rate_grid_list=the_table.prepare()
	the_flat_rate_grid.rows=this.tempDS.wo_flat_rate_grid_list
	the_flat_rate_grid.defaultColumnWidth=null
	the_flat_rate_grid.headings=the_table.targetHeadings
//	the_flat_rate_grid.cellOnClick=["myProgram.myNewPage('edit_labor_page','_row_number_','_column_number_')"]
	return the_flat_rate_grid
}
window.MyRecipe.prototype.myFlatRateGridOBSOLETE._methodName='myFlatRateGridOBSOLETE'
window.MyRecipe.prototype.myQuoteStatusDiv = function()
{
    var the_locator_recipe=new SUITableCellValueLocatorRecipe({"initialConfigurationName":"generic_table_cell_value_locator"})
	the_locator_recipe.tableRows=this.mainDS.wo_list
	the_locator_recipe.tableHeadings=this.mainDS.wo_headings
	the_locator_recipe.tableLocatorHeading=[].dbPush("Work Order Id").dbPush("Date Scheduled")
	the_locator_recipe.tableLocatorFilter=[].dbPush(this.mainDS.current_workorder_id).dbPush(myProgram.mainDS.current_workorder_date_scheduled)
	the_locator_recipe.tableTargetCellHeading="Status"
	var statusValue=the_locator_recipe.prepare()
	
    return myQuotePage.myStatusDivRecipe(statusValue)
}
window.MyRecipe.prototype.myQuoteStatusDiv._methodName='myQuoteStatusDiv'
window.MyRecipe.prototype.isWorkOrderReadOnly = function()
{
	if(myProgram.isWorkOrderCompleted()) return true
	var the_locator_recipe=new SUITableCellValueLocatorRecipe({"initialConfigurationName":"generic_table_cell_value_locator"})
	the_locator_recipe.tableRows=this.mainDS.wo_list
	the_locator_recipe.tableHeadings=this.mainDS.wo_headings
	the_locator_recipe.tableLocatorHeading=[].dbPush("Work Order Id").dbPush("Date Scheduled")
	the_locator_recipe.tableLocatorFilter=[].dbPush(this.mainDS.current_workorder_id).dbPush(myProgram.mainDS.current_workorder_date_scheduled)
	the_locator_recipe.tableTargetCellHeading="Status"
	var statusValue=the_locator_recipe.prepare()
	
	return (statusValue.trim().toLowerCase()=='waitdispapprvl'
		 || statusValue.trim().toLowerCase()=='waitcustapprvl')
}
window.MyRecipe.prototype.isWorkOrderReadOnly._methodName='isWorkOrderReadOnly'
window.MyRecipe.prototype.isWorkOrderQuote = function()
{
	var the_locator_recipe=new SUITableCellValueLocatorRecipe({"initialConfigurationName":"generic_table_cell_value_locator"})
	the_locator_recipe.tableRows=this.mainDS.wo_list
	the_locator_recipe.tableHeadings=this.mainDS.wo_headings
	the_locator_recipe.tableLocatorHeading=[].dbPush("Work Order Id").dbPush("Date Scheduled")
	the_locator_recipe.tableLocatorFilter=[].dbPush(this.mainDS.current_workorder_id).dbPush(myProgram.mainDS.current_workorder_date_scheduled)
	the_locator_recipe.tableTargetCellHeading="Status"
	var statusValue=the_locator_recipe.prepare()
	
	return myQuotePage.myGridFilterFunction({value:statusValue})
}
window.MyRecipe.prototype.isWorkOrderQuote._methodName='isWorkOrderQuote'
window.MyRecipe.prototype.isWorkOrderCompleted = function()
{
	var the_locator_recipe=new SUITableCellValueLocatorRecipe({"initialConfigurationName":"generic_table_cell_value_locator"})
	the_locator_recipe.tableRows=this.mainDS.wo_list
	the_locator_recipe.tableHeadings=this.mainDS.wo_headings
	the_locator_recipe.tableLocatorHeading=[].dbPush("Work Order Id").dbPush("Date Scheduled")
	the_locator_recipe.tableLocatorFilter=[].dbPush(this.mainDS.current_workorder_id).dbPush(myProgram.mainDS.current_workorder_date_scheduled)
	the_locator_recipe.tableTargetCellHeading="Status"
	var statusValue=the_locator_recipe.prepare()
	
	return myCompletedPage.myGridFilterFunction({value:statusValue})
}
window.MyRecipe.prototype.isWorkOrderCompleted._methodName='isWorkOrderCompleted'
window.MyRecipe.prototype.isWorkOrderUnbilled = function()
{
	var the_locator_recipe=new SUITableCellValueLocatorRecipe({"initialConfigurationName":"generic_table_cell_value_locator"})
	the_locator_recipe.tableRows=this.mainDS.wo_list
	the_locator_recipe.tableHeadings=this.mainDS.wo_headings
	the_locator_recipe.tableLocatorHeading=[].dbPush("Work Order Id").dbPush("Date Scheduled")
	the_locator_recipe.tableLocatorFilter=[].dbPush(this.mainDS.current_workorder_id).dbPush(myProgram.mainDS.current_workorder_date_scheduled)
	the_locator_recipe.tableTargetCellHeading="Status"
	var statusValue=the_locator_recipe.prepare()
	
	return (statusValue.toLowerCase().dbTrim() == "pending" || statusValue.toLowerCase().dbTrim() == "checked out")
}
window.MyRecipe.prototype.isWorkOrderUnbilled._methodName='isWorkOrderUnbilled'
window.MyRecipe.prototype.isWorkOrderCOD = function()
{
	return true
	if(this.mainDS.current_workorder_id == null) return false
	var the_locator_recipe=new SUITableCellValueLocatorRecipe({"initialConfigurationName":"generic_table_cell_value_locator"})
	the_locator_recipe.tableRows=this.mainDS.wo_list
	the_locator_recipe.tableHeadings=this.mainDS.wo_headings
	the_locator_recipe.tableLocatorHeading=[].dbPush("Work Order Id")
	the_locator_recipe.tableLocatorFilter=[].dbPush(this.mainDS.current_workorder_id)
	the_locator_recipe.tableTargetCellHeading="COD"
	var codValue=the_locator_recipe.prepare()
	
	return (codValue.toLowerCase().dbTrim() == "y")
}
window.MyRecipe.prototype.isWorkOrderCOD._methodName='isWorkOrderCOD'
window.MyRecipe.prototype.isWorkOrderTaxable = function()
{
	var the_locator_recipe=new SUITableCellValueLocatorRecipe({"initialConfigurationName":"generic_table_cell_value_locator"})
	the_locator_recipe.tableRows=this.mainDS.wo_list
	the_locator_recipe.tableHeadings=this.mainDS.wo_headings
	the_locator_recipe.tableLocatorHeading=[].dbPush("Work Order Id")
	the_locator_recipe.tableLocatorFilter=[].dbPush(this.mainDS.current_workorder_id)
	the_locator_recipe.tableTargetCellHeading="Taxable"
	var value=the_locator_recipe.prepare()
	
	return (value.toLowerCase().dbTrim() == "y")
}
window.MyRecipe.prototype.isWorkOrderTaxable._methodName='isWorkOrderTaxable'
window.MyRecipe.prototype.myLaborGrid = function()
{
	if(this.isWorkOrderCOD())
	{
		return this.myCODLaborGrid()
	}
	else
	{
		return this.myNonCODLaborGrid()
	}
}
window.MyRecipe.prototype.myLaborGrid._methodName='myLaborGrid'
window.MyRecipe.prototype.myDefaultPayPeriodValue = function()
{
	//Get the start date and the days in the pay period.
	var the_locator_recipe=new SUITableCellValueLocatorRecipe({"initialConfigurationName":"generic_table_cell_value_locator"})
	the_locator_recipe.tableRows=this.mainDS.static_labor_date_list
	the_locator_recipe.tableHeadings=this.mainDS.static_labor_date_headings
	the_locator_recipe.tableLocatorHeading=[].dbPush("Default Period")
	the_locator_recipe.tableLocatorFilter=[].dbPush("Y")
	the_locator_recipe.tableTargetCellHeading="Period Id"
	var periodId = the_locator_recipe.prepare()
		
	if(periodId == null)
	{
		if(this.mainDS.static_labor_date_list.length > 0)
		{
			var periodIdIndex = this.mainDS.static_labor_date_headings.dbIndexOf("Period Id")
			periodId = this.mainDS.static_labor_date_list[0][periodIdIndex]
		}
	}
		
	return periodId
}
window.MyRecipe.prototype.myDefaultPayPeriodValue._methodName='myDefaultPayPeriodValue'
window.MyRecipe.prototype.myDefaultDateWithinDefaultPayPeriod = function()
{
	var current_pay_period_info = this.myFindStartDateAndPayPeriodDays(this.myDefaultPayPeriodValue())
			
	var start_date = current_pay_period_info[0]
	var num_days = current_pay_period_info[1]
	var system_date = this.myEditRecipeFor({recipeName:"System Date"})
	if(start_date != null)
	{
		start_date = sysFunctions.stringToDateFormat(start_date);
		system_date = sysFunctions.stringToDateFormat(system_date);
	
		var converted = Date.parse(start_date);
		var start_date_object = new Date(converted);
		var end_date_object = new Date(start_date_object);
		end_date_object.setDate(start_date_object.getDate()+num_days);
		var converted = Date.parse(system_date)
		var system_date_object = new Date(converted);
			
		if(system_date_object >= start_date_object && system_date_object <= end_date_object)
		{
			return sysFunctions.stringToMilitaryDateFormat(system_date)
		}
		else
		{
			return sysFunctions.stringToMilitaryDateFormat(start_date)
		}
	}	
	else
	{
		return ""
	}		
}
window.MyRecipe.prototype.myDefaultDateWithinDefaultPayPeriod._methodName='myDefaultDateWithinDefaultPayPeriod'
window.MyRecipe.prototype.myDefaultDateValue = function()
{
	/*
	2008-04-08 (jc)-[2078]-Remove pay period
	*/
	if(myProgram.myLaborGridShowPayPeriod())
	{
		return myProgram.myDefaultDateWithinDefaultPayPeriod()
	}
	return myProgram.myMilitaryDateStringForDateObject(new Date())
}
window.MyRecipe.prototype.myDefaultDateValue._methodName='myDefaultDateValue'
window.MyRecipe.prototype.myDatesFromPayPeriodId = function(payPeriodId)
{
	var payPeriodIndex = myProgram.mainDS.static_labor_date_headings.dbIndexOf("Period Id")
	for(var i = 0; i < this.mainDS.static_labor_date_list.length; i++)
	{
		if(this.mainDS.static_labor_date_list[i][payPeriodIndex].toLowerCase().dbTrim() == payPeriodId.toLowerCase().dbTrim())
		{
			var periodRow = this.mainDS.static_labor_date_list[i]
			break
		}
	}
	
	if(periodRow == null) return null
	
	var startDateIndex = this.mainDS.static_labor_date_headings.dbIndexOf("Start Date")
	var daysInPeriodIndex = this.mainDS.static_labor_date_headings.dbIndexOf("Days in Period")
	var startDate = periodRow[startDateIndex]
	var daysInPeriod = periodRow[daysInPeriodIndex]
	
	var start_end_dates_dict = this.myStartEndDateObjects(startDate, daysInPeriod)
	
	var start_date_object = start_end_dates_dict["start_object"]
	var end_date_object = start_end_dates_dict["end_object"]
	
	var start_date_military_format_string = start_end_dates_dict["start_date_full_length"]
	var end_date_military_format_string = start_end_dates_dict["end_date_full_length"]
	
	var returnArray = []
	
	while(start_date_object < end_date_object)
	{
		var military_date_string = this.myMilitaryDateStringForDateObject(start_date_object)
		returnArray.push(military_date_string)
		start_date_object.setDate(start_date_object.getDate()+1);
	}	
	
	return returnArray
}
window.MyRecipe.prototype.myDatesFromPayPeriodId._methodName='myDatesFromPayPeriodId'
window.MyRecipe.prototype.myNonPayPeriodDateItems = function()
{
	/*
	2008-04-08 (jc)-[2078]-Show today minus configLaborDays
	*/
	if(myProgram.mainDS.configLaborDays == null) myProgram.mainDS.configLaborDays = 7
	
	var dateObject = new Date()
	dateObject.setDate(dateObject.getDate()-myProgram.mainDS.configLaborDays*1);
	var startDate = this.myMilitaryDateStringForDateObject(dateObject)
	var daysInPeriod = myProgram.mainDS.configLaborDays*1+1
	
	var start_end_dates_dict = this.myStartEndDateObjects(startDate, daysInPeriod)
	
	var start_date_object = start_end_dates_dict["start_object"]
	var end_date_object = start_end_dates_dict["end_object"]
	
	var start_date_military_format_string = start_end_dates_dict["start_date_full_length"]
	var end_date_military_format_string = start_end_dates_dict["end_date_full_length"]
	
	var returnArray = []
	
	while(start_date_object < end_date_object)
	{
		var military_date_string = this.myMilitaryDateStringForDateObject(start_date_object)
		returnArray.push(military_date_string)
		start_date_object.setDate(start_date_object.getDate()+1);
	}	
	
	return returnArray
}
window.MyRecipe.prototype.myNonPayPeriodDateItems._methodName='myNonPayPeriodDateItems'
window.MyRecipe.prototype.myMilitaryDateStringForDateObject = function(date_object)
{
	var year = date_object.getFullYear();
	var month = date_object.getMonth()+1;
	if(month.toString().length == 1)month = "0"+month;
	var date = date_object.getDate();
	if(date.toString().length == 1)date = "0"+date;
		
	var military_date_string = year+"-"+month+"-"+date;
	return military_date_string;
}
window.MyRecipe.prototype.myMilitaryDateStringForDateObject._methodName='myMilitaryDateStringForDateObject'
window.MyRecipe.prototype.myStartEndDateObjects = function(start_date_string, num_days)
{
	var start_date_string = sysFunctions.stringToDateFormat(start_date_string);
	
	var converted = Date.parse(start_date_string);
	var start_date_object = new Date(converted);
	
	var year = start_date_object.getFullYear();
	var month = start_date_object.getMonth()+1;
	if(month.toString().length == 1)month = "0"+month;
	var date = start_date_object.getDate();
	if(date.toString().length == 1)date = "0"+date;
		
	var start_date_full_length = year+"-"+month+"-"+date;
	
	var end_date_object = new Date(start_date_object);
	end_date_object.setDate(start_date_object.getDate()*1+num_days*1);
	
	var year = end_date_object.getFullYear();
	var month = end_date_object.getMonth()+1;
	if(month.toString().length == 1)month = "0"+month;
	var date = end_date_object.getDate();
	if(date.toString().length == 1)date = "0"+date;
		
	var end_date_full_length = year+"-"+month+"-"+date;
	var return_dict = {}
	
	return_dict.start_object = start_date_object
	return_dict.start_string = start_date_full_length
	
	return_dict.end_object = end_date_object
	return_dict.end_string = end_date_full_length
	
	return return_dict
}
window.MyRecipe.prototype.myStartEndDateObjects._methodName='myStartEndDateObjects'
window.MyRecipe.prototype.myDateItems = function()
{
	if(!myProgram.myLaborGridShowPayPeriod())
	{
		return myProgram.myNonPayPeriodDateItems()
	}
	
	var payPeriodId = this.myDefaultPayPeriodValue()
	if(payPeriodId != null)
	{
		return this.myDatesFromPayPeriodId(payPeriodId)
	}
	else
	{
		return []
	}
}
window.MyRecipe.prototype.myDateItems._methodName='myDateItems'
window.MyRecipe.prototype.myCODLaborGrid = function()
{
	/*
	2008-04-11 (jc)-[2190]-Disallow edits to transmitted labor entries
	2008-04-08 (jc)-[2078]-Remove pay period
	*/
	var this_recipe=new GUIDataEntryGridRecipe('{"initialConfigurationName":"","finalIngredients":{}}')
	this_recipe.idAttribute="wo_labor_"
	//the_code_textarea_contents=sysFunctions.functionTextArea(GUIDataEntryGridRecipe,'recipe')
	//the_code_textarea2_contents=sysFunctions.functionTextArea(GUIDataEntryGridRecipe.prototype.prepare,'prepare')
	this_recipe.gridRecipe = new GUISimpleGridRecipe({"initialConfigurationName":"generic_simple_data_entry_grid","minRowCount":1})
	this_recipe.gridRecipe.gridWidth = (!myProgram.myLaborGridShowPayPeriod() ? 682 : 740)
	this_recipe.gridRecipe.gridHeight = 300
	this_recipe.gridRecipe.headingDefaultStyle=this_recipe.gridRecipe.headingDefaultStyle+";font-family:arial;color:black;font-size:11; background-color:#7ac98e;border-style:solid;border-color:#676566;border-width:1 1 1 0;padding:1;"
	this_recipe.gridRecipe.cellDefaultStyle=this_recipe.gridRecipe.cellDefaultStyle+";font-size:11;color:black;border-color:#676566;border-width:0 1 1 0;padding:1;font-family:arial;height:20;"
	this_recipe.gridRecipe.gridStyle=";border-width:0;"
	this_recipe.gridStyle=";border-width:0;"
	this_recipe.gridRecipe.styleAttribute=";border-width:0;"
	this_recipe.gridRecipe.outerDivBorderWidth="0 0 0 0"//Changed tell Bill
	this_recipe.gridRecipe.scrollingHeight = "0;overflow:scroll;"
	
	this_recipe.onAddRowDone=function()
    {
		var the_javascript=function()
				{
					myProgram.myRefreshLaborSummaryGridForFormView()
				}
				return the_javascript
	}
	//2008-04-08 (jc)-[2078]
	var entering_function=function()
	{
		var the_javascript="function(){myProgram.myEnteringDateList(this)}"
		return the_javascript
	}
	
	this_recipe.alert=false
	this_recipe.gridRecipe.breakpointOnPrepare=false

	this_recipe.columnDefaultWidth=100
	
	this_recipe.columnWidths=[95,102,33,99,86,(!myProgram.myLaborGridShowPayPeriod() ? 0 : 59),72,51,45,36,41,0,0,0]
	this_recipe.columnCount=this_recipe.columnWidths.length
	this_recipe.addRowInitialDataValues={"Technician Id":this.mainDS.tech_id,
									 "Transmitted":"n",
									 "Date":this.myDefaultDateValue(),
									 //2008-04-08 (jc)-[2078]
									 "Period Id":(!myProgram.myLaborGridShowPayPeriod() ? "" : myProgram.myDefaultPayPeriodValue()),
									 "Equipment Id":this.myFirstEquipmentIdForWorkOrderId(this.mainDS.current_workorder_id),
									 "Hours":"1.0",
									 "BillHours":"1.0",
									 "Labor Type Id":this.myDefaultLaborTypeIdValue(),
									 "Pay Type Id":this.myDefaultPayTypeIdValue(),
									 "Description":this.myLaborTypeDescriptionForId(this.myDefaultLaborTypeIdValue()),
									 "Work Order Id":this.mainDS.current_workorder_id,
									 "Unit Price":myProgram.getUnitPriceForLaborTypeId(this.myDefaultLaborTypeIdValue()),
									 "Price":(myProgram.getUnitPriceForLaborTypeId(this.myDefaultLaborTypeIdValue())*1).toFixed(2),
									 "Taxable":this.myDefaultTaxableValue("Labor")}
	this_recipe.headings='myData["grid_headings"]["myCODLaborGrid"]'
	this_recipe.dataHeadings=this.mainDS.wo_labor_headings//'myData.example_data.example_data_entry_data_headings'
	
	this_recipe.inputFieldRecipes = []
	
	this_recipe.inputFieldDefaultRecipe=new GUIInputFieldRecipe({initialConfigurationName:'generic_data_entry_field'})
	this_recipe.inputFieldDefaultRecipe.onchangeAttribute+=';myProgram.myRefreshLaborSummaryGridForFormView();'
	this_recipe.inputFieldDefaultRecipe.sizeAttribute="12"
	this_recipe.inputFieldDefaultRecipe.styleAttribute=";border:0 px solid grey;background-color:white;font-size:11;"
	
	var technicianInputFieldRecipe = new GUIInputFieldRecipe({initialConfigurationName:'generic_text_input_field'})
	technicianInputFieldRecipe.myischangeokAttribute = __('myTechnicianOnChangeCodeString')
	this_recipe.inputFieldRecipes[0] = technicianInputFieldRecipe
	technicianInputFieldRecipe.sizeAttribute="12"
	technicianInputFieldRecipe.styleAttribute=";border:0 px solid grey;background-color:white;font-size:11;"
		
	var payPeriodIdInputRecipe = new GUIInputFieldRecipe({initialConfigurationName:'generic_text_input_field'})
	//2008-04-08 (jc)-[2078]
	if(myProgram.myLaborGridShowPayPeriod()) 
	{
		payPeriodIdInputRecipe.myischangeokAttribute = __('myChangePayPeriodCodeString')
	}
	else
	{
		payPeriodIdInputRecipe.disabledAttribute = true
	}
	this_recipe.inputFieldRecipes[5] = payPeriodIdInputRecipe
	payPeriodIdInputRecipe.sizeAttribute="12"
	payPeriodIdInputRecipe.styleAttribute=";border:0 px solid grey;background-color:white;font-size:11;"
	
	var hourListRecipe = new GUIInputFieldRecipe({initialConfigurationName:'generic_text_input_field'})
	hourListRecipe.myischangeokAttribute = __('myHourOnChangeCodeString')
	this_recipe.inputFieldRecipes[2] = hourListRecipe
	hourListRecipe.styleAttribute=";border:0 px solid grey;background-color:white;width:17;font-size:11;"
	
	var laborTypeIdListRecipe = new GUIInputFieldRecipe({initialConfigurationName:'generic_text_input_field'})
	laborTypeIdListRecipe.myischangeokAttribute = __('myLaborTypeOnChangeCodeString')
	this_recipe.inputFieldRecipes[3] = laborTypeIdListRecipe
	laborTypeIdListRecipe.sizeAttribute="12"
	laborTypeIdListRecipe.styleAttribute=";border:0 px solid grey;background-color:white;font-size:11;"
	
	var dateInputRecipe = new GUIInputFieldRecipe({initialConfigurationName:'generic_text_input_field'})
	dateInputRecipe.myischangeokAttribute = __('myGenericOnChangeCodeString')
	this_recipe.inputFieldRecipes[6] = dateInputRecipe
	dateInputRecipe.sizeAttribute="12"
	dateInputRecipe.styleAttribute=";border:0 px solid grey;background-color:white;width:68;font-size:11;"
	
	var dateListRecipe = new GUIListRecipe({initialConfigurationName:"constraint_list"})
	dateListRecipe.listItemStyle+=";color:black;font-family:arial;background-color:white;font-size:11;"
	dateListRecipe.selectedBackgroundColor="#316ac4"
	dateListRecipe.mouseOverBackgroundColor="#316ac5"
	dateListRecipe.listWidth="105"
	this_recipe.listRecipes[6] = dateListRecipe
	
	var equipmentIdInputRecipe = sysFunctions.cloneObject(this_recipe.inputFieldDefaultRecipe)
	equipmentIdInputRecipe.myischangeokAttribute = __('myGenericOnChangeCodeString')
	this_recipe.inputFieldRecipes[1] = equipmentIdInputRecipe
	
	var payTypeInputRecipe = sysFunctions.cloneObject(this_recipe.inputFieldDefaultRecipe)
	payTypeInputRecipe.myischangeokAttribute = __('myGenericOnChangeCodeString')
	this_recipe.inputFieldRecipes[4] = payTypeInputRecipe
	
	var unitPriceInputRecipe = new GUIInputFieldRecipe({initialConfigurationName:'generic_text_input_field'})
	unitPriceInputRecipe.myischangeokAttribute = __('myUnitPriceHasChangedCodeString')
	unitPriceInputRecipe.styleAttribute=";border:0 px solid grey;background-color:white;font-size:11;"
	this_recipe.inputFieldRecipes[7] = unitPriceInputRecipe
	
	var billHoursInputRecipe = new GUIInputFieldRecipe({initialConfigurationName:'generic_text_input_field'})
	billHoursInputRecipe.styleAttribute=";border:0 px solid grey;background-color:white;font-size:11;"
	billHoursInputRecipe.myischangeokAttribute = __('myBillHoursHasChangedCodeString')
	this_recipe.inputFieldRecipes[8] = billHoursInputRecipe
	
	var priceInputRecipe = new GUIInputFieldRecipe({initialConfigurationName:'generic_text_input_field'})
	priceInputRecipe.styleAttribute=";border:0 px solid grey;background-color:white;font-size:11;"
	priceInputRecipe.disabledAttribute = true
	this_recipe.inputFieldRecipes[9] = priceInputRecipe
	
	var listDefaultRecipe = new GUIListRecipe({initialConfigurationName:"constraint_list"})
	listDefaultRecipe.listItemStyle+=";color:black;font-family:arial;background-color:white;font-size:11;"
	listDefaultRecipe.selectedBackgroundColor="#316ac4"
	listDefaultRecipe.mouseOverBackgroundColor="#316ac5"
	this_recipe.listDefaultRecipe = listDefaultRecipe
	
	//var dateListRecipe = new GUIListRecipe({initialConfigurationName:"constraint_list"})
	//this_recipe.listRecipes[6] = dateListRecipe
	
	if(this.isWorkOrderTaxable())
	{
		var taxableFormat = {format:"list",items:__("myTaxableItems")}
		var taxableInputRecipe = sysFunctions.cloneObject(this_recipe.inputFieldDefaultRecipe)
		taxableInputRecipe.myischangeokAttribute = __('myGenericOnChangeCodeString')
		this_recipe.inputFieldRecipes[10] = taxableInputRecipe
	}
	else
	{
		var taxableFormat = {format:"text",length:30}
		var taxableInputRecipe = new GUIInputFieldRecipe({initialConfigurationName:'generic_text_input_field'})
		taxableInputRecipe.styleAttribute=";border:0 px solid grey;background-color:white;font-size:11;"
		taxableInputRecipe.disabledAttribute = true
		this_recipe.inputFieldRecipes[10] = taxableInputRecipe
	}
	
	var invisibleField = new GUIInputFieldRecipe({initialConfigurationName:'generic_text_input_field'})
	invisibleField.disabledAttribute=true
	this_recipe.inputFieldRecipes[11] = this_recipe.inputFieldRecipes[12] = this_recipe.inputFieldRecipes[13] = invisibleField
	
	this_recipe.rows=this.myLaborGridRows()
	this_recipe.dataRows='myProgram.mainDS.wo_labor_list'
	this_recipe.joinColumnName='RN'
	this_recipe.formats=[{format:"list",items:__("myTechnicianIdItems")},
						 {format:"list",items:__("myEquipmentItems")},
						 {format:"list",items:__("myHoursItems")},
						 {format:"list",items:__("myLaborTypeIdItems")},
						 {format:"list",items:__("myPayTypeIdItems")},
						 {format:"list",items:__("myPeriodIdItems")},
						 {format:"list",items:__("myDateItems"),enteringfield:(myProgram.myLaborGridShowPayPeriod() ? "__('myEnteringDateListCodeString')" : null)},
						 {format:"number",scale:10,precision:2},
						 {format:"number",scale:10,precision:2},
						 {format:"text"},
						 taxableFormat,
						 {format:"text"},
						 {format:"text"},
						 {format:"text"}]
	return this_recipe
}
window.MyRecipe.prototype.myCODLaborGrid._methodName='myCODLaborGrid'
window.MyRecipe.prototype.myEnteringDateListCodeString = function()
{
	return "function(){myProgram.myEnteringDateList(this)}"
}
window.MyRecipe.prototype.myEnteringDateListCodeString._methodName='myEnteringDateListCodeString'
window.MyRecipe.prototype.myEnteringDateList = function(dateInputElement)
{	
	if(dateInputElement == null) return
	var payPeriodIdInputElement = sysFunctions.locateAdjacentColumnInputNode(dateInputElement, "Period Id")
	var payPeriodId = payPeriodIdInputElement.value
	if(payPeriodId.dbTrim() == "") payPeriodId = this.myDefaultPayPeriodValue()
	
	var dateListRecipe = new GUIListRecipe({initialConfigurationName:"constraint_list"})
	dateListRecipe.listItemStyle+=";color:black;font-family:arial;background-color:white;font-size:11;"
	dateListRecipe.selectedBackgroundColor="#316ac4"
	dateListRecipe.mouseOverBackgroundColor="#316ac5"
	dateListRecipe.listWidth="105"
	dateListRecipe.alert=false
	dateListRecipe.displayItems = this.myDatesFromPayPeriodId(payPeriodId)
	
	var div = document.createElement("DIV")
	div.innerHTML = dateListRecipe.prepare()
	
	var children = sysFunctions.getGridConstraintContainer(dateInputElement).children
	if(this.isWorkOrderCOD())
	{
		var itemsDiv = children[myData["grid_headings"]["myCODLaborGrid"].dbIndexOf("Date")]
	}
	else
	{
		var itemsDiv = children[myData["grid_headings"]["myNonCODLaborGrid"].dbIndexOf("Date")]
	}
	
	itemsDiv.removeChild(itemsDiv.firstChild)
	itemsDiv.appendChild(div.firstChild)
	
}
window.MyRecipe.prototype.myEnteringDateList._methodName='myEnteringDateList'
window.MyRecipe.prototype.myPeriodIdItems = function()
{
	var the_rows_recipe=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'});
	the_rows_recipe.sourceRows=this.mainDS.static_labor_date_list;
	the_rows_recipe.sourceHeadings=myProgram.mainDS.static_labor_date_headings;
	the_rows_recipe.targetHeadings=[].dbPush("Period Id");
	the_rows_recipe.sortOnSourceHeadings=[].dbPush("Period Id");
	var rows=the_rows_recipe.prepare();
	var items = []
	for(var i = 0; i < rows.length; i++)
	{
		items.push(rows[i][0])
	}
	return items
}
window.MyRecipe.prototype.myPeriodIdItems._methodName='myPeriodIdItems'
window.MyRecipe.prototype.myPayTypeIdItems = function()
{
	var the_rows_recipe=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'});
	the_rows_recipe.sourceRows=this.mainDS.static_pay_type_list;
	the_rows_recipe.sourceHeadings=myProgram.mainDS.static_pay_type_headings;
	the_rows_recipe.targetHeadings=[].dbPush("Pay Type Id");
	the_rows_recipe.sortOnSourceHeadings=[];
	var rows=the_rows_recipe.prepare();
	var items = []
	for(var i = 0; i < rows.length; i++)
	{
		items.push(rows[i][0])
	}
	return items
}
window.MyRecipe.prototype.myPayTypeIdItems._methodName='myPayTypeIdItems'
window.MyRecipe.prototype.myDefaultLaborUnitPrice = function()
{
	var unitPrice = this.getUnitPriceForLaborTypeId(this.myDefaultLaborTypeIdValue())
}
window.MyRecipe.prototype.myDefaultLaborUnitPrice._methodName='myDefaultLaborUnitPrice'
window.MyRecipe.prototype.myDefaultLaborTypeIdValue = function()
{
	var tech_labor_type_index = this.mainDS.tech_info_headings.dbIndexOf("tech_labor_type_id")
	return this.mainDS.tech_info_list[0][tech_labor_type_index];
}
window.MyRecipe.prototype.myDefaultLaborTypeIdValue._methodName='myDefaultLaborTypeIdValue'
window.MyRecipe.prototype.myDefaultPayTypeIdValue = function()
{
	var tech_pay_type_index = this.mainDS.tech_info_headings.dbIndexOf("tech_pay_type_id")
	return this.mainDS.tech_info_list[0][tech_pay_type_index];
}
window.MyRecipe.prototype.myDefaultPayTypeIdValue._methodName='myDefaultPayTypeIdValue'
window.MyRecipe.prototype.myHoursItems = function()
{

	return this.mainDS.static_labor_hour_list
}
window.MyRecipe.prototype.myHoursItems._methodName='myHoursItems'
window.MyRecipe.prototype.myLaborTypeIdItems = function()
{
	var the_rows_recipe=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'});
	the_rows_recipe.filterValues=[].dbPush(myProgram.mainDS.current_workorder_id);
	the_rows_recipe.filterOnSourceHeadings=[].dbPush(myProgram.mainDS.wo_id_heading);
	the_rows_recipe.sourceRows=this.mainDS.static_labor_type_list;
	the_rows_recipe.sourceHeadings=myProgram.mainDS.static_labor_type_headings;
	the_rows_recipe.targetHeadings=[].dbPush(myProgram.mainDS.static_labor_type_id_heading);
	the_rows_recipe.sortOnSourceHeadings=[];
	var rows=the_rows_recipe.prepare();
	var items = []
	for(var i = 0; i < rows.length; i++)
	{
		items.push(rows[i][0])
	}
	return items
}
window.MyRecipe.prototype.myLaborTypeIdItems._methodName='myLaborTypeIdItems'
window.MyRecipe.prototype.myTechnicianIdItems = function()
{
	myProgram.mainDS.wo_selected_technician = myProgram.mainDS.tech_id
	if(myProgram.mainDS.static_technician_list != null)
	{
		if(myProgram.mainDS.static_technician_list.length > 0)
		{	
				//return myProgram.mainDS.static_technician_list
				var items = []
				var technicianIdIndex = myProgram.mainDS.static_technician_headings.dbIndexOf("Sub Id")
				for(var i = 0; i < myProgram.mainDS.static_technician_list.length; i++)
				{
					items.push(myProgram.mainDS.static_technician_list[i][technicianIdIndex])
				}
		}
		else
		{
				var items = []
				var technicianIdIndex = myProgram.mainDS.wo_technician_headings.dbIndexOf("Sub Id")
				for(var i = 0; i < myProgram.mainDS.wo_technician_list.length; i++)
				{
					items.push(myProgram.mainDS.wo_technician_list[i][technicianIdIndex])
				}
		}
	}
	else
	{
		var items = []
		var technicianIdIndex = myProgram.mainDS.wo_technician_headings.dbIndexOf("Sub Id")
		for(var i = 0; i < myProgram.mainDS.wo_technician_list.length; i++)
		{
			items.push(myProgram.mainDS.wo_technician_list[i][technicianIdIndex])
		}
	}
	return items
}
window.MyRecipe.prototype.myTechnicianIdItems._methodName='myTechnicianIdItems'
window.MyRecipe.prototype.myLaborGridRows = function()
{
	if(this.isWorkOrderCOD())
	{
		var targetHeadings = myData["grid_headings"]["myCODLaborGrid"]
	}
	else
	{
		var targetHeadings = myData["grid_headings"]["myNonCODLaborGrid"]
	}
	var the_table=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'})
	the_table.sourceRows=this.mainDS.wo_labor_list
	the_table.sourceHeadings=this.mainDS.wo_labor_headings
	the_table.filterOnSourceHeadings=[].dbPush(this.mainDS.wo_id_heading).dbPush("Transmitted")
	the_table.filterValues=[].dbPush(this.mainDS.current_workorder_id).dbPush(function(val){return val.value != "deleted"})
	the_table.sortOnSourceHeadings=[].dbPush(this.mainDS.wo_id_heading)
	the_table.targetHeadings=targetHeadings
	this.tempDS.wo_labor_grid_list=the_table.prepare()
	
	return 'myProgram.tempDS.wo_labor_grid_list'
}
window.MyRecipe.prototype.myLaborGridRows._methodName='myLaborGridRows'
window.MyRecipe.prototype.myCODLaborGridOBSOLETE = function()
{
	var the_labor_grid=new GUISimpleGridRecipe('{"initialConfigurationName":"generic_simple_grid",minRowCount:5}')
	the_labor_grid.scrollingHeight=100
	the_labor_grid.columnWidths=[70,70,30,70,80,80,45,70,70,70,70]
	the_labor_grid.columnCount=12
	the_labor_grid.disallowEditTransmittedAttribute = true
	the_row_numbers_string='{"rn_heading":"Line","rn_width":75,\
			"rn_cell_on_click":"myProgram.myNewPage(\'edit_labor_page\',\'_row_number_\',\'_column_number_\')",\
			"rn_cell_on_click_template":"_cell_contents_\
			<a id=\\\"labor_line__cell_contents_\\\" href=#abc onclick=\\\"myProgram.myDeleteItem(\'_grid_id_\',\'_row_number_\',\'_column_number_\')\\\" >\
				<img src=\'mydeleteitem.gif\' alt=\'Delete Row\' style=\'border-width:1;vertical-align:bottom\'></a>"\
			}'
	the_labor_grid.addRowNumbers=the_row_numbers_string
	the_labor_grid.idAttribute='wo_labor_'
	the_labor_grid.alert=false
	the_labor_grid.cellOnClickDefault="myProgram.myEditControl('_cell_escaped_contents_','_grid_id_','_cell_id_','_heading_contents_','_row_number_','_column_number_')"
	var the_table=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'})
	the_table.sourceRows=this.mainDS.wo_labor_list
	the_table.sourceHeadings=this.mainDS.wo_labor_headings
	the_table.filterOnSourceHeadings=[].dbPush(this.mainDS.wo_id_heading).dbPush("Transmitted")
	the_table.filterValues=[].dbPush(this.mainDS.current_workorder_id).dbPush(function(val){return val.value != "deleted"})
	the_table.sortOnSourceHeadings=[].dbPush(this.mainDS.wo_id_heading)
	the_table.targetHeadings=this.mainDS.wo_labor_grid_headings=["Technician Id","Equipment Id","Hours","Labor Type Id","Pay Type Id","Period Id","Date","Unit Price","BillHours","Price","Taxable","Transmitted","RN"]
	this.tempDS.wo_labor_grid_list=the_table.prepare()
	the_labor_grid.rows=this.tempDS.wo_labor_grid_list
	the_labor_grid.defaultColumnWidth=null
	the_labor_grid.headings=the_table.targetHeadings
	the_labor_grid.displayOnlyColumnIndices = [10]
	if(!this.isWorkOrderTaxable())the_labor_grid.displayOnlyColumnIndices.push(11)
//	the_labor_grid.cellOnClick=["myProgram.myNewPage('edit_labor_page','_row_number_','_column_number_')"]
	return the_labor_grid
}
window.MyRecipe.prototype.myCODLaborGridOBSOLETE._methodName='myCODLaborGridOBSOLETE'
window.MyRecipe.prototype.updateHeadingFor = function(id)
{
	switch(id)
	{
		case 'MaterialRequired':
			myProgram.myUpdateMaterialHeading()
		break;
		case 'LaborRequired':
			myProgram.myUpdateLaborHeading()
		break;
		case 'OtherRequired':
			myProgram.myUpdateOtherHeading()
		break;
		case 'WorkPerformedRequired':
			myProgram.myUpdateWorkPerformedHeading()
		break;
	}
}
window.MyRecipe.prototype.updateHeadingFor._methodName='updateHeadingFor'
window.MyRecipe.prototype.myUpdateMaterialHeading = function()
{
	if(myProgram.myMaterialListForCurrentWorkOrder().length == 0 && myProgram.MaterialRequired() && !myProgram.isMaterialRequiredOverridden())
	{
		window["MaterialRequired"].parentElement.parentElement.style.backgroundColor=myProgram.myRequiredHeadingColor()
	}
	else
	{
		window["MaterialRequired"].parentElement.parentElement.style.backgroundColor=myProgram.myNormalHeadingColor()
	}
}
window.MyRecipe.prototype.myUpdateMaterialHeading._methodName='myUpdateMaterialHeading'
window.MyRecipe.prototype.myUpdateLaborHeading = function()
{
	if(myProgram.myLaborListForCurrentWorkOrder().length == 0 && myProgram.LaborRequired() && !myProgram.isLaborRequiredOverridden())
	{
		window["LaborRequired"].parentElement.parentElement.style.backgroundColor=myProgram.myRequiredHeadingColor()
	}
	else
	{
		window["LaborRequired"].parentElement.parentElement.style.backgroundColor=myProgram.myNormalHeadingColor()
	}
}
window.MyRecipe.prototype.myUpdateLaborHeading._methodName='myUpdateLaborHeading'
window.MyRecipe.prototype.myUpdateOtherHeading = function()
{
	if(myProgram.myOtherListForCurrentWorkOrder().length == 0 && myProgram.OtherRequired() && !myProgram.isOtherRequiredOverridden())
	{
		window["OtherRequired"].parentElement.parentElement.style.backgroundColor=myProgram.myRequiredHeadingColor()
	}
	else
	{
		window["OtherRequired"].parentElement.parentElement.style.backgroundColor=myProgram.myNormalHeadingColor()
	}
}
window.MyRecipe.prototype.myUpdateOtherHeading._methodName='myUpdateOtherHeading'
window.MyRecipe.prototype.myUpdateWorkPerformedHeading = function()
{
	if(myProgram.myWorkOrderHasEmptyWorkPerformed(this.mainDS.current_workorder_id) && myProgram.WorkPerformedRequired() && !myProgram.isWorkPerformedRequiredOverridden())
	{
		window["WorkPerformedRequired"].parentElement.parentElement.style.backgroundColor=myProgram.myRequiredHeadingColor()
	}
	else
	{
		window["WorkPerformedRequired"].parentElement.parentElement.style.backgroundColor=myProgram.myNormalHeadingColor()
	}
}
window.MyRecipe.prototype.myUpdateWorkPerformedHeading._methodName='myUpdateWorkPerformedHeading'
window.MyRecipe.prototype.myMetricsGridRows = function()
{
	var equipmentId = this.mainDS.current_equipment_row[myProgram.mainDS.wo_equipment_headings.dbIndexOf("Equipment Id")]
	var the_table=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'})
	the_table.sourceRows=this.mainDS.wo_metrics_list
	the_table.sourceHeadings=this.mainDS.wo_metrics_headings
	the_table.filterOnSourceHeadings=[].dbPush(this.mainDS.wo_id_heading).dbPush("Equipment Id")
	the_table.filterValues=[].dbPush(this.mainDS.current_workorder_id).dbPush(equipmentId)
	the_table.sortOnSourceHeadings=[].dbPush(this.mainDS.wo_id_heading)
	the_table.targetHeadings=myData["grid_headings"]["myEditMetricsGrid"]
	myProgram.tempDS.wo_metrics_grid_list = the_table.prepare()
	
	return 'myProgram.tempDS.wo_metrics_grid_list'
}
window.MyRecipe.prototype.myMetricsGridRows._methodName='myMetricsGridRows'
window.MyRecipe.prototype.myEditMetricsGridOBSOLETE = function()
{
	var the_metrics_grid=new GUISimpleGridRecipe('{"initialConfigurationName":"formview_grid",minRowCount:8}')
	the_metrics_grid.headingDefaultStyle+=";background-color:#7ac98e;border-width:1 1 1 0;"
	the_metrics_grid.borderAttribute=1
	the_metrics_grid.columnCount=5
	the_metrics_grid.columnWidths=[130,327,70,120]
	the_metrics_grid.scrollingHeight = "0;height:153;overflow:scroll;"
	the_metrics_grid.disallowEditTransmittedAttribute = true
	the_row_numbers_string='{"rn_heading":"","rn_width":45,\
			"rn_cell_on_click":"",\
			"rn_cell_on_click_template":"<a id=\\\"metrics_line__cell_contents_\\\" href=#abc onclick=\\\"myProgram.myDeleteItem(\'_grid_id_\',\'_row_number_\',\'_column_number_\')\\\" >\
				<img src=\'remove.gif\' alt=\'Remove Row\' style=\'border-width:0;vertical-align:bottom\'></a>"\
			}'
	the_metrics_grid.addRowNumbers=the_row_numbers_string
	the_metrics_grid.idAttribute='wo_metrics_'
	the_metrics_grid.alert=false
	the_metrics_grid.cellOnClickDefault=null
	
	
	the_metrics_grid.rows=this.tempDS.wo_metrics_grid_list=this.myMetricsGridRows()
	the_metrics_grid.defaultColumnWidth=null
	the_metrics_grid.headings=this.mainDS.wo_metrics_grid_headings

	return the_metrics_grid
}
window.MyRecipe.prototype.myEditMetricsGridOBSOLETE._methodName='myEditMetricsGridOBSOLETE'
window.MyRecipe.prototype.myEditMetricsGrid = function()
{
	var this_recipe=new GUIDataEntryGridRecipe('{"initialConfigurationName":"","finalIngredients":{}}')
	this_recipe.idAttribute="wo_metrics_"
	this_recipe.alert=false
	
	this_recipe.gridRecipe = new GUISimpleGridRecipe({"initialConfigurationName":"generic_simple_data_entry_grid","minRowCount":1})
	this_recipe.gridRecipe.gridWidth = 685
	this_recipe.gridRecipe.gridHeight = 300
	//this_recipe.gridRecipe.headingDefaultStyle=this_recipe.gridRecipe.headingDefaultStyle+";font-family:arial;color:black;font-size:11; background-color:#7ac98e;border-style:solid;border-color:#676566;border-width:1 1 1 0;padding:1;"
	//this_recipe.gridRecipe.cellDefaultStyle=this_recipe.gridRecipe.cellDefaultStyle+";font-size:11;color:black;border-color:#676566;border-width:0 1 1 0;padding:1;font-family:arial;height:20;"
	//this_recipe.gridRecipe.gridStyle=";border-width:0px;"
	//this_recipe.gridStyle=";border-width:0px;"
	//this_recipe.gridRecipe.styleAttribute=";border-width:0px;"
	this_recipe.gridRecipe.outerDivBorderWidth="0px 0px 0px 0px"//Changed tell Bill
	this_recipe.gridRecipe.scrollingHeight = "0px;overflow:scroll;"
	
	this_recipe.columnDefaultWidth=100
	this_recipe.columnCount=4
	this_recipe.listDefaultRecipe.idAttribute="example_constraint_list"
	this_recipe.listDefaultRecipe.listItemCacheOn=false
	this_recipe.columnWidths=[130,227,70,100]
	this_recipe.headings='myData["grid_headings"]["myEditMetricsGrid"]'//'myData.example_data.example_data_entry_grid_headings'   //'["heading 1","heading 2","heading 3","item 0"]'
	this_recipe.dataHeadings=this.mainDS.wo_metrics_headings//'myData.example_data.example_data_entry_data_headings'
																					//myData.example_data.example_data_entry_grid_rows=[["100.20","column 2","column 3","item b"],["300","column 2a","column 3a","item 1"]]
	this_recipe.rows=this.myMetricsGridRows()
	this_recipe.dataRows='myProgram.mainDS.wo_metrics_list'
	this_recipe.joinColumnName='RN'
	this_recipe.formats=[{format:"",length:60},
						 {format:"",length:60},
						 {format:"",length:60},
						 {format:"text",length:60}]
						 
	this_recipe.divTagDefaultRecipe=new GUIDivTagRecipe({"initialConfigurationName":"default_data_entry_div_tag"})
	this_recipe.divTagDefaultRecipe.styleAttribute=";width:16px;height:16px;background-color:white;text-align:center;vertical-align:middle;color:gray;padding-top:2px;"
	
	this_recipe.inputFieldDefaultRecipe=new GUIInputFieldRecipe({initialConfigurationName:'generic_data_entry_field'})
	this_recipe.inputFieldDefaultRecipe.sizeAttribute="11"
	this_recipe.inputFieldDefaultRecipe.styleAttribute=";border:none;background-color:white;font-size:11px;"
	
	
	this_recipe.gridRecipe.addRowButtonRecipe = null
	//this_recipe.gridWidth = 680
	this_recipe.breakpointOnPrepare = false
	return this_recipe
}
window.MyRecipe.prototype.myEditMetricsGrid._methodName='myEditMetricsGrid'
window.MyRecipe.prototype.myClosingScriptGrid = function()
{
	var this_recipe=new GUIDataEntryGridRecipe('{"initialConfigurationName":"","finalIngredients":{}}')
	this_recipe.idAttribute="wo_call_script_"
	this_recipe.alert=false
	
	this_recipe.gridRecipe = new GUISimpleGridRecipe({"initialConfigurationName":"generic_simple_data_entry_grid","minRowCount":1})
	this_recipe.gridRecipe.onclickBlankString = "" //2007-11-12 (jc)-Default of &nbsp;&nbsp;&nbsp; is causing trouble
	//this_recipe.gridRecipe.cellDefaultStyle=this_recipe.gridRecipe.cellDefaultStyle+";font-size:11;color:black;border-color:#676566;border-width:0 1 1 0;padding:1;font-family:arial;height:20;"
	//this_recipe.gridRecipe.gridStyle=";border-width:0px;"
	//this_recipe.gridStyle+=";border-width:0px;"
	//this_recipe.gridRecipe.styleAttribute=";border-width:0px;"
	this_recipe.gridRecipe.outerDivBorderWidth="0px 0px 0px 0px"//Changed tell Bill
	this_recipe.gridRecipe.scrollingHeight = "0px;overflow:scroll;"
	
	this_recipe.columnDefaultWidth=100
	this_recipe.columnCount=2
	this_recipe.listDefaultRecipe.idAttribute="example_constraint_list"
	this_recipe.listDefaultRecipe.listItemCacheOn=false
	this_recipe.columnWidths=[510,200]
	this_recipe.headings='myData["grid_headings"]["myClosingScriptGrid"]'//'myData.example_data.example_data_entry_grid_headings'   //'["heading 1","heading 2","heading 3","item 0"]'
	this_recipe.dataHeadings=this.mainDS.wo_closing_script_headings//'myData.example_data.example_data_entry_data_headings'
																					//myData.example_data.example_data_entry_grid_rows=[["100.20","column 2","column 3","item b"],["300","column 2a","column 3a","item 1"]]
	this_recipe.rows=this.myClosingCallScriptGridRows()
	this_recipe.dataRows='myProgram.mainDS.wo_closing_script_list'
	this_recipe.joinColumnName='RN'
	this_recipe.formats=[{format:"text",length:60},
						{format:"text",length:60}]
						
	var inputRecipe = new GUIInputFieldRecipe({initialConfigurationName:'generic_data_entry_field'})
	inputRecipe.onchangeAttribute += ";myProgram.myClosingScriptHasChanged()"
	inputRecipe.styleAttribute=";border:0px solid grey;width:298px;background-color:white;font-size:11px;"
	this_recipe.inputFieldRecipes[1] = inputRecipe
	
	var responseRecipe = new GUIInputFieldRecipe({initialConfigurationName:'generic_data_entry_field'})
	responseRecipe.disabledAttribute = true
	responseRecipe.sizeAttribute="100"
	responseRecipe.styleAttribute=";border:0px solid grey;background-color:white;color:black;font-size:11px;"
	this_recipe.inputFieldRecipes[0] = responseRecipe
	
	
	this_recipe.gridRecipe.addRowButtonRecipe = null
	this_recipe.gridRecipe.gridWidth = 736
	this_recipe.breakpointOnPrepare = false
	return this_recipe
}
window.MyRecipe.prototype.myClosingScriptGrid._methodName='myClosingScriptGrid'
window.MyRecipe.prototype.myClosingCallScriptGridRows = function()
{
	var the_table=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'});
	the_table.sourceRows=this.mainDS.wo_closing_script_list;
	the_table.sourceHeadings=this.mainDS.wo_closing_script_headings;
	the_table.filterOnSourceHeadings=[].dbPush(this.mainDS.wo_id_heading)
	the_table.filterValues=[].dbPush(this.mainDS.current_workorder_id)
	the_table.sortOnSourceHeadings=[].dbPush(this.mainDS.wo_id_heading);
	the_table.targetHeadings=this.mainDS.wo_closing_script_grid_headings = ["Question","Response","RN"]
	the_table.breakpointOnPrepare=false;
	this.tempDS.wo_closing_script_grid_list=the_table.prepare();
	
	return 'myProgram.tempDS.wo_closing_script_grid_list'
}
window.MyRecipe.prototype.myClosingCallScriptGridRows._methodName='myClosingCallScriptGridRows'
window.MyRecipe.prototype.myNonCODLaborGrid = function()
{
	/*
	2008-04-08 (jc)-[2078]-Remove pay period
	*/
	var this_recipe=new GUIDataEntryGridRecipe('{"initialConfigurationName":"","finalIngredients":{}}')
	this_recipe.idAttribute="wo_labor_"
	//the_code_textarea_contents=sysFunctions.functionTextArea(GUIDataEntryGridRecipe,'recipe')
	//the_code_textarea2_contents=sysFunctions.functionTextArea(GUIDataEntryGridRecipe.prototype.prepare,'prepare')
	this_recipe.gridRecipe = new GUISimpleGridRecipe({"initialConfigurationName":"generic_simple_data_entry_grid","minRowCount":1})
	this_recipe.gridRecipe.gridWidth = ((!myProgram.myLaborGridShowPayPeriod()) ? 620 : 735)
	this_recipe.gridRecipe.gridHeight = 300
	this_recipe.gridRecipe.headingDefaultStyle=this_recipe.gridRecipe.headingDefaultStyle+";font-family:arial;color:black;font-size:11; background-color:#7ac98e;border-style:solid;border-color:#676566;border-width:1 1 1 0;padding:1;"
	this_recipe.gridRecipe.cellDefaultStyle=this_recipe.gridRecipe.cellDefaultStyle+";font-size:11;color:black;border-color:#676566;border-width:0 1 1 0;padding:1;font-family:arial;height:20;"
	this_recipe.gridRecipe.gridStyle=";border-width:0;"
	this_recipe.gridStyle=";border-width:0;"
	this_recipe.gridRecipe.styleAttribute=";border-width:0;"
	this_recipe.gridRecipe.outerDivBorderWidth="0 0 0 0"//Changed tell Bill
	this_recipe.gridRecipe.scrollingHeight = "0;overflow:scroll;"
	
	this_recipe.onAddRowDone=function()
    {
		var the_javascript=function()
				{
					myProgram.myRefreshLaborSummaryGridForFormView()	
				}
				return the_javascript
	}
	
	//2008-04-08 (jc)-[2078]
	var entering_function=function()
	{
		var the_javascript="function(){myProgram.myEnteringDateList(this)}"
		return the_javascript
	}
	
	this_recipe.alert=false
	this_recipe.gridRecipe.breakpointOnPrepare=false

	this_recipe.columnDefaultWidth=100
	this_recipe.columnCount=11
	this_recipe.columnWidths=[117,117,45,117,117,((!myProgram.myLaborGridShowPayPeriod()) ? 0 : 117),85,0,0,0,0]
	this_recipe.addRowInitialDataValues={"Technician Id":this.mainDS.tech_id,
									 "Transmitted":"n",
									 "Date":this.myDefaultDateValue(),
									 //2008-04-08 (jc)-[2078]
									 "Period Id":((!myProgram.myLaborGridShowPayPeriod()) ? "" : myProgram.myDefaultPayPeriodValue()),
									 "Equipment Id":this.myFirstEquipmentIdForWorkOrderId(this.mainDS.current_workorder_id),
									 "Hours":"1.0",
									 "BillHours":"1.0",
									 "Labor Type Id":this.myDefaultLaborTypeIdValue(),
									 "Pay Type Id":this.myDefaultPayTypeIdValue(),
									 "Description":this.myLaborTypeDescriptionForId(this.myDefaultLaborTypeIdValue()),
									 "Work Order Id":this.mainDS.current_workorder_id}
	this_recipe.headings='myData["grid_headings"]["myNonCODLaborGrid"]'
	this_recipe.dataHeadings=this.mainDS.wo_labor_headings//'myData.example_data.example_data_entry_data_headings'
	
	this_recipe.inputFieldRecipes = []
	
	this_recipe.inputFieldDefaultRecipe=new GUIInputFieldRecipe({initialConfigurationName:'generic_data_entry_field'})
	this_recipe.inputFieldDefaultRecipe.onchangeAttribute+=';myProgram.myRefreshLaborSummaryGridForFormView();'
	this_recipe.inputFieldDefaultRecipe.sizeAttribute="12"
	this_recipe.inputFieldDefaultRecipe.styleAttribute=";border:0 px solid grey;background-color:white;font-size:11;"
	
	var technicianInputFieldRecipe = new GUIInputFieldRecipe({initialConfigurationName:'generic_text_input_field'})
	technicianInputFieldRecipe.myischangeokAttribute = __('myTechnicianOnChangeCodeString')
	this_recipe.inputFieldRecipes[0] = technicianInputFieldRecipe
	technicianInputFieldRecipe.sizeAttribute="12"
	technicianInputFieldRecipe.styleAttribute=";border:0 px solid grey;background-color:white;font-size:11;"
	
	var payPeriodIdInputRecipe = new GUIInputFieldRecipe({initialConfigurationName:'generic_text_input_field'})
	//2008-04-08 (jc)-[2078]
	if(!myProgram.myLaborGridShowPayPeriod()) 
	{
		payPeriodIdInputRecipe.disabledAttribute = true
	}
	else
	{
		payPeriodIdInputRecipe.myischangeokAttribute = __('myChangePayPeriodCodeString')
	}
	this_recipe.inputFieldRecipes[5] = payPeriodIdInputRecipe
	payPeriodIdInputRecipe.sizeAttribute="12"
	payPeriodIdInputRecipe.styleAttribute=";border:0 px solid grey;background-color:white;font-size:11;"
	
	var hourListRecipe = new GUIInputFieldRecipe({initialConfigurationName:'generic_text_input_field'})
	hourListRecipe.myischangeokAttribute = __('myHourOnChangeCodeString')
	this_recipe.inputFieldRecipes[2] = hourListRecipe
	hourListRecipe.styleAttribute=";border:0 px solid grey;background-color:white;width:30;font-size:11;"
	
	var laborTypeListRecipe = new GUIInputFieldRecipe({initialConfigurationName:'generic_text_input_field'})
	laborTypeListRecipe.myischangeokAttribute = __('myLaborTypeOnChangeCodeString')
	this_recipe.inputFieldRecipes[3] = laborTypeListRecipe
	laborTypeListRecipe.sizeAttribute="12"
	laborTypeListRecipe.styleAttribute=";border:0 px solid grey;background-color:white;font-size:11;"
	
	var dateInputRecipe = new GUIInputFieldRecipe({initialConfigurationName:'generic_text_input_field'})
	dateInputRecipe.myischangeokAttribute = __('myGenericOnChangeCodeString')
	this_recipe.inputFieldRecipes[6] = dateInputRecipe
	dateInputRecipe.sizeAttribute="12"
	dateInputRecipe.styleAttribute=";border:0 px solid grey;background-color:white;width:68;font-size:11;"
	
	var equipmentIdInputRecipe = sysFunctions.cloneObject(this_recipe.inputFieldDefaultRecipe)
	equipmentIdInputRecipe.myischangeokAttribute = __('myGenericOnChangeCodeString')
	this_recipe.inputFieldRecipes[1] = equipmentIdInputRecipe
	
	var payTypeInputRecipe = sysFunctions.cloneObject(this_recipe.inputFieldDefaultRecipe)
	payTypeInputRecipe.myischangeokAttribute = __('myGenericOnChangeCodeString')
	this_recipe.inputFieldRecipes[4] = payTypeInputRecipe
	
	var dateListRecipe = new GUIListRecipe({initialConfigurationName:"constraint_list"})
	dateListRecipe.listItemStyle+=";color:black;font-family:arial;background-color:white;font-size:11;"
	dateListRecipe.selectedBackgroundColor="#316ac4"
	dateListRecipe.mouseOverBackgroundColor="#316ac5"
	dateListRecipe.listWidth="105"
	this_recipe.listRecipes[6] = dateListRecipe
	
	var descriptionRecipe = new GUIInputFieldRecipe({initialConfigurationName:'generic_text_input_field'})
	descriptionRecipe.disabledAttribute = true
	this_recipe.inputFieldRecipes[7] = descriptionRecipe
	this_recipe.inputFieldRecipes[8] = descriptionRecipe
	this_recipe.inputFieldRecipes[9] = descriptionRecipe
	this_recipe.inputFieldRecipes[10] = descriptionRecipe
	this_recipe.inputFieldRecipes[11] = descriptionRecipe
	
	var listDefaultRecipe = new GUIListRecipe({initialConfigurationName:"constraint_list"})
	listDefaultRecipe.listItemStyle+=";color:black;font-family:arial;background-color:white;font-size:11;"
	listDefaultRecipe.selectedBackgroundColor="#316ac4"
	listDefaultRecipe.mouseOverBackgroundColor="#316ac5"
	this_recipe.listDefaultRecipe = listDefaultRecipe
	
	this_recipe.rows=this.myLaborGridRows()
	this_recipe.dataRows='myProgram.mainDS.wo_labor_list'
	this_recipe.joinColumnName='RN'
	this_recipe.formats=[{format:"list",items:__("myTechnicianIdItems")},
						 {format:"list",items:__("myEquipmentItems")},
						 {format:"list",items:__("myHoursItems")},
						 {format:"list",items:__("myLaborTypeIdItems")},
						 {format:"list",items:__("myPayTypeIdItems")},
						 {format:"list",items:__("myPeriodIdItems")},
						 {format:"list",items:__("myDateItems"),enteringfield:((myProgram.myLaborGridShowPayPeriod()) ? entering_function : null)},
						 {format:"number"},
						 {format:"text"},{format:"text"},{format:"text"},{format:"text"}]
	return this_recipe
}
window.MyRecipe.prototype.myNonCODLaborGrid._methodName='myNonCODLaborGrid'
window.MyRecipe.prototype.myNonCODLaborGridOBSOLETE = function()
{
	var the_labor_grid=new GUISimpleGridRecipe('{"initialConfigurationName":"generic_simple_grid",minRowCount:5}')
	the_labor_grid.scrollingHeight=100
	the_labor_grid.columnWidths=[70,70,30,70,80,80,45]
	the_labor_grid.columnCount=8
	the_labor_grid.disallowEditTransmittedAttribute = true
	the_row_numbers_string='{"rn_heading":"Line","rn_width":75,\
			"rn_cell_on_click":"myProgram.myNewPage(\'edit_labor_page\',\'_row_number_\',\'_column_number_\')",\
			"rn_cell_on_click_template":"_cell_contents_\
			<a id=\\\"labor_line__cell_contents_\\\" href=#abc onclick=\\\"myProgram.myDeleteItem(\'_grid_id_\',\'_row_number_\',\'_column_number_\')\\\" >\
				<img src=\'mydeleteitem.gif\' alt=\'Delete Row\' style=\'border-width:1;vertical-align:bottom\'></a>"\
			}'
	the_labor_grid.addRowNumbers=the_row_numbers_string
	the_labor_grid.idAttribute='wo_labor_'
	the_labor_grid.alert=false
	the_labor_grid.cellOnClickDefault="myProgram.myEditControl('_cell_escaped_contents_','_grid_id_','_cell_id_','_heading_contents_','_row_number_','_column_number_')"
	var the_table=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'})
	the_table.sourceRows=this.mainDS.wo_labor_list
	the_table.sourceHeadings=this.mainDS.wo_labor_headings
	the_table.filterOnSourceHeadings=[].dbPush(this.mainDS.wo_id_heading).dbPush("Transmitted")
	the_table.filterValues=[].dbPush(this.mainDS.current_workorder_id).dbPush(function(val){return val.value != "deleted"})
	the_table.sortOnSourceHeadings=[].dbPush(this.mainDS.wo_id_heading)
	the_table.targetHeadings=this.mainDS.wo_labor_grid_headings=["Technician Id","Equipment Id","Hours","Labor Type Id","Pay Type Id","Period Id","Date",/*"BillHours",*/"Transmitted","RN"]
	this.tempDS.wo_labor_grid_list=the_table.prepare()
	the_labor_grid.rows=this.tempDS.wo_labor_grid_list
	the_labor_grid.defaultColumnWidth=null
	the_labor_grid.headings=the_table.targetHeadings
//	the_labor_grid.cellOnClick=["myProgram.myNewPage('edit_labor_page','_row_number_','_column_number_')"]
	return the_labor_grid
}
window.MyRecipe.prototype.myNonCODLaborGridOBSOLETE._methodName='myNonCODLaborGridOBSOLETE'
window.MyRecipe.prototype.myFilterByFRKeyword = function(val)
{
	var description_value = val.value;
	var flat_rate_id_value = val.row[0];
	if(myProgram.mainDS.current_flat_rate_grid_search_filter_array != null)
	{
		var keyword_filter = myProgram.mainDS.current_flat_rate_grid_search_filter_array;
		var all_keywords_matched = true
		
		for(i = 0; i < keyword_filter.length; i++)
		{	
			var description_result = (description_value.toString().toLowerCase().dbTrim()).indexOf((keyword_filter[i]).toString().toLowerCase().dbTrim())
			var flat_rate_id_result = (flat_rate_id_value.toString().toLowerCase().dbTrim()).indexOf((keyword_filter[i]).toString().toLowerCase().dbTrim())
			//If the keyword is in the description or the part_number than it is a match
			if(description_result < 0 && flat_rate_id_result < 0)
			{
				all_keywords_matched = false;
			}
		}
		if(all_keywords_matched)
		{
			return true;		
		}
		else
		{
			return false;
		}
	}
	else
	{
		return true;
	}	
	return false;
}
window.MyRecipe.prototype.myFilterByFRKeyword._methodName='myFilterByFRKeyword'
window.MyRecipe.prototype.myFilterByKeyword = function(val)
{
	var description_value = val.value;
	var part_number_value = val.row[0];
	if(myProgram.mainDS.current_parts_grid_search_filter_array != null)
	{
		var keyword_filter = myProgram.mainDS.current_parts_grid_search_filter_array;
		var all_keywords_matched = true
		
		for(i = 0; i < keyword_filter.length; i++)
		{	
			var description_result = (description_value.toString().toLowerCase().dbTrim()).indexOf((keyword_filter[i]).toString().toLowerCase().dbTrim())
			var part_number_result = (part_number_value.toString().toLowerCase().dbTrim()).indexOf((keyword_filter[i]).toString().toLowerCase().dbTrim())
			//If the keyword is in the description or the part_number than it is a match
			if(description_result < 0 && part_number_result < 0)
			{
				all_keywords_matched = false;
			}
		}
		if(all_keywords_matched)
		{
			return true;		
		}
		else
		{
			return false;
		}
	}
	else
	{
		return true;
	}	
	return false;
}
window.MyRecipe.prototype.myFilterByKeyword._methodName='myFilterByKeyword'
window.MyRecipe.prototype.myDefaultWorkOrderPO = function()
{
	return sysFunctions.getColumnValueForTable(myProgram.mainDS.wo_list, myProgram.mainDS.wo_headings, "DefaultPO", ["Work Order Id","Date Scheduled"], [myProgram.mainDS.current_workorder_id, myProgram.mainDS.current_workorder_date_scheduled])	
}
window.MyRecipe.prototype.myDefaultWorkOrderPO._methodName='myDefaultWorkOrderPO'
window.MyRecipe.prototype.myOtherGridCOD = function()
{
	var this_recipe=new GUIDataEntryGridRecipe('{"initialConfigurationName":"","finalIngredients":{}}')
	this_recipe.idAttribute="wo_other_"
	//the_code_textarea_contents=sysFunctions.functionTextArea(GUIDataEntryGridRecipe,'recipe')
	//the_code_textarea2_contents=sysFunctions.functionTextArea(GUIDataEntryGridRecipe.prototype.prepare,'prepare')
	this_recipe.alert=false
	//this_recipe.breakpointOnPrepare=true
	this_recipe.gridRecipe = new GUISimpleGridRecipe({"initialConfigurationName":"generic_simple_data_entry_grid","minRowCount":1})
	this_recipe.gridRecipe.gridWidth = ((myProgram.isWorkOrderQuote()) ? 665 : 717) 
	this_recipe.gridRecipe.gridHeight = 300
	//this_recipe.gridRecipe.styleAttribute=";border-width:0px;"
	this_recipe.gridRecipe.outerDivBorderWidth="0px 0px 0px 0px"//Changed tell Bill
	this_recipe.gridRecipe.scrollingHeight = "0px;overflow:scroll;"
	
	this_recipe.onAddRowDone=function()
		    {
				var the_javascript=function(){myProgram.myRefreshOtherSummaryGridForFormView()}
				return the_javascript
		    }
	this_recipe.alert=false
	this_recipe.gridRecipe.breakpointOnPrepare=false

	this_recipe.columnDefaultWidth=100
	this_recipe.columnWidths=[45,114,200,117,((myProgram.isWorkOrderQuote()) ? 0 : 51),55,0/*40*/,54,0/*41*/,0,0,0,0]
	this_recipe.columnCount=this_recipe.columnWidths.length
	this_recipe.addRowInitialDataValues={"Quantity":1,
										"ServerRN":"0",
										"Transmitted":"n",
										"BillQty":1,
										"PO#":myProgram.myDefaultWorkOrderPO(),
										"Other Rate Id":this.getFirstOtherRateId(),
										"Other Rate Description":this.getOtherRateDescriptionForId(this.getFirstOtherRateId()),
										"Equipment Id":this.myFirstEquipmentIdForWorkOrderId(this.mainDS.current_workorder_id),
										"Work Order Id":this.mainDS.current_workorder_id,
										"Taxable":this.myDefaultTaxableValue("Other"),
										"Unit Price":this.getUnitPrice(this.getFirstOtherRateId(), this.myFirstEquipmentIdForWorkOrderId(this.mainDS.current_workorder_id)),
										"Price":this.getUnitPrice(this.getFirstOtherRateId(), this.myFirstEquipmentIdForWorkOrderId(this.mainDS.current_workorder_id)),
										"Status":"Not Submitted"}
	this_recipe.headings='myData["grid_headings"]["myOtherGridCOD"]'//'myData.example_data.example_data_entry_grid_headings'   //'["heading 1","heading 2","heading 3","item 0"]'
	this_recipe.dataHeadings=this.mainDS.wo_other_headings//'myData.example_data.example_data_entry_data_headings'
	
	this_recipe.inputFieldRecipes = []
	
	this_recipe.inputFieldDefaultRecipe=new GUIInputFieldRecipe({initialConfigurationName:'generic_data_entry_field'})
	this_recipe.inputFieldDefaultRecipe.onchangeAttribute+=';myProgram.myRefreshOtherSummaryGridForFormView();'
	this_recipe.inputFieldDefaultRecipe.sizeAttribute="12"
	this_recipe.inputFieldDefaultRecipe.styleAttribute=";border:0px solid grey;background-color:white;font-size:11px;"
	
	var otherRateIdInputRecipe = new GUIInputFieldRecipe({initialConfigurationName:'generic_data_entry_field'})
	otherRateIdInputRecipe.myischangeokAttribute = __('updateOtherRateDescriptionCodeString')
	otherRateIdInputRecipe.onchangeAttribute+=';myProgram.myRefreshOtherSummaryGridForFormView();'
	otherRateIdInputRecipe.styleAttribute=";border:0px solid grey;background-color:white;width:132px;font-size:11px;"
	this_recipe.inputFieldRecipes[1] = otherRateIdInputRecipe
	
	var otherRateDescInputRecipe = new GUIInputFieldRecipe({initialConfigurationName:'generic_data_entry_field'})
	otherRateDescInputRecipe.myischangeokAttribute = __('myGenericMaterialOtherOnChangeCodeString')
	otherRateDescInputRecipe.onchangeAttribute+=';myProgram.myRefreshOtherSummaryGridForFormView();'
	otherRateDescInputRecipe.styleAttribute=";border:0px solid grey;background-color:white;width:197px;font-size:11px;"
	this_recipe.inputFieldRecipes[2] = otherRateDescInputRecipe	
	
	//2008-04-11 (jc)-[2075]
	var equipmentIdInputRecipe = sysFunctions.cloneObject(this_recipe.inputFieldDefaultRecipe)
	equipmentIdInputRecipe.myischangeokAttribute = __('myEquipmentOnChangeCodeString')
	this_recipe.inputFieldRecipes[3] = equipmentIdInputRecipe
	
	//2008-04-11 (jc)-[2075]
	var taxableInputRecipe = sysFunctions.cloneObject(this_recipe.inputFieldDefaultRecipe)
	taxableInputRecipe.myischangeokAttribute = __('myGenericMaterialOtherOnChangeCodeString')
	this_recipe.inputFieldRecipes[8] = taxableInputRecipe
	
	var poInputRecipe = new GUIInputFieldRecipe({initialConfigurationName:'generic_data_entry_field'})
	poInputRecipe.disabledAttribute = true
	poInputRecipe.styleAttribute=";border:0px solid grey;background-color:white;font-size:11px;"
	this_recipe.inputFieldRecipes[4] = poInputRecipe //PO#
	
	var quantityInputRecipe = new GUIInputFieldRecipe({initialConfigurationName:'generic_data_entry_field'})
	quantityInputRecipe.myischangeokAttribute = __('myQuantityFieldHasChangedCodeString')
	this_recipe.inputFieldRecipes[0] = quantityInputRecipe																				
	quantityInputRecipe.onchangeAttribute+=';myProgram.myRefreshOtherSummaryGridForFormView();'
	quantityInputRecipe.styleAttribute=";border:0px solid grey;background-color:white;font-size:11px;"
	
	var unitPriceInputRecipe = new GUIInputFieldRecipe({initialConfigurationName:'generic_text_input_field'})
	unitPriceInputRecipe.myischangeokAttribute = __('myUnitPriceHasChangedCodeString')
	unitPriceInputRecipe.styleAttribute=";border:0px solid grey;background-color:white;font-size:11px;"
	this_recipe.inputFieldRecipes[5] = unitPriceInputRecipe
	
	var billQtyInputRecipe = new GUIInputFieldRecipe({initialConfigurationName:'generic_text_input_field'})
	billQtyInputRecipe.disabledAttribute = true
	billQtyInputRecipe.myischangeokAttribute = __('myBillQuantityHasChangedCodeString')
	billQtyInputRecipe.styleAttribute=";border:0px solid grey;background-color:white;font-size:11px;"
	this_recipe.inputFieldRecipes[6] = billQtyInputRecipe
	
	var priceInputRecipe = new GUIInputFieldRecipe({initialConfigurationName:'generic_text_input_field'})
	priceInputRecipe.disabledAttribute = true
	priceInputRecipe.styleAttribute=";border:0px solid grey;background-color:white;font-size:11px;"
	this_recipe.inputFieldRecipes[7] = priceInputRecipe
	
	var hiddenInputRecipe = new GUIInputFieldRecipe({initialConfigurationName:'generic_data_entry_field'})
	hiddenInputRecipe.styleAttribute=";border:0px solid grey;background-color:white;font-size:11px;"
	hiddenInputRecipe.disabledAttribute=true
	this_recipe.inputFieldRecipes[8] = hiddenInputRecipe
	this_recipe.inputFieldRecipes[9] = hiddenInputRecipe
	this_recipe.inputFieldRecipes[10] = hiddenInputRecipe		
	this_recipe.inputFieldRecipes[11] = hiddenInputRecipe	
	this_recipe.inputFieldRecipes[12] = hiddenInputRecipe
	
	var listDefaultRecipe = new GUIListRecipe({initialConfigurationName:"constraint_list"})
	listDefaultRecipe.listItemStyle+=";color:black;font-family:arial;background-color:white;font-size:11px;"
	listDefaultRecipe.selectedBackgroundColor="#316ac4"
	listDefaultRecipe.mouseOverBackgroundColor="#316ac5"
	this_recipe.listDefaultRecipe = listDefaultRecipe
	
	var quantityFormat = {format:"number",scale:12,precision:6}
	
	if(myProgram.isWorkOrderQuote())
	{
	    var unitPriceFormat = {format:"number",scale:9,precision:3}
	    var priceFormat = {format:"number",scale:8,precision:2}
	}
	else
	{
	    var unitPriceFormat = {format:"number",scale:10,precision:3}
	    var priceFormat = {format:"number",scale:10,precision:2}
	}
	
	for(var i = 0; i < this_recipe.columnWidths.length; i++)
	{
	    if(this_recipe.columnWidths[i] == 0)
	    {
	        this_recipe.gridRecipe.hiddenColumns.push(eval("("+this_recipe.headings+")")[i])
	    }
	}
	
	
	this_recipe.rows=this.myOtherGridRows()
	this_recipe.dataRows=((myProgram.isWorkOrderQuote()) ? 'myProgram.mainDS.wo_quote_list' : 'myProgram.mainDS.wo_other_list')
	this_recipe.joinColumnName='RN'
	this_recipe.formats=[quantityFormat,
						{format:"list",items:__("myOtherRateItems")},
						{format:"text",length:60},
						{format:"list",items:__("myEquipmentItems")},
						{format:"text"},
						unitPriceFormat,
						quantityFormat,
						priceFormat,
						{format:"list",items:__("myTaxableItems")},
						{format:"text"},
						{format:"text"},
						{format:"text"},
						{format:"text"}]
						
	return this_recipe
	
}
window.MyRecipe.prototype.myOtherGridCOD._methodName='myOtherGridCOD'
window.MyRecipe.prototype.myTaxableItems = function()
{
	return ["Y","N"]
}
window.MyRecipe.prototype.myTaxableItems._methodName='myTaxableItems'
window.MyRecipe.prototype.myOtherGridNonCOD = function()
{
	var this_recipe=new GUIDataEntryGridRecipe('{"initialConfigurationName":"","finalIngredients":{}}')
	this_recipe.idAttribute="wo_other_"
	//the_code_textarea_contents=sysFunctions.functionTextArea(GUIDataEntryGridRecipe,'recipe')
	//the_code_textarea2_contents=sysFunctions.functionTextArea(GUIDataEntryGridRecipe.prototype.prepare,'prepare')
	this_recipe.gridRecipe = new GUISimpleGridRecipe({"initialConfigurationName":"generic_simple_data_entry_grid","minRowCount":1})
	this_recipe.gridRecipe.gridWidth = 655
	this_recipe.gridRecipe.gridHeight = 300
	this_recipe.gridRecipe.headingDefaultStyle=this_recipe.gridRecipe.headingDefaultStyle+";font-family:arial;color:black;font-size:11; background-color:#7ac98e;border-style:solid;border-color:#676566;border-width:1 1 1 0;padding:1;"
	this_recipe.gridRecipe.cellDefaultStyle=this_recipe.gridRecipe.cellDefaultStyle+";font-size:11;color:black;border-color:#676566;border-width:0 1 1 0;padding:1;font-family:arial;height:20;"
	this_recipe.gridRecipe.gridStyle=";border-width:0;"
	this_recipe.gridStyle=";border-width:0;"
	this_recipe.gridRecipe.styleAttribute=";border-width:0;"
	this_recipe.gridRecipe.outerDivBorderWidth="0 0 0 0"//Changed tell Bill
	this_recipe.gridRecipe.scrollingHeight = "0;overflow:scroll;"
	this_recipe.onAddRowDone=function()
		    {
				var the_javascript=function(){myProgram.myRefreshOtherSummaryGridForFormView()}
				return the_javascript
		    }
	this_recipe.alert=false
	this_recipe.gridRecipe.breakpointOnPrepare=false

	this_recipe.columnDefaultWidth=100
	this_recipe.columnWidths=[45,150,200,150,90,0,0,0,0,0]
	this_recipe.columnCount=this_recipe.columnWidths.length
	
	this_recipe.addRowInitialDataValues={"Quantity":1,
										"Transmitted":"n",
										"BillQty":1,
										"Other Rate Id":this.getFirstOtherRateId(),
										"Other Rate Description":this.getOtherRateDescriptionForId(this.getFirstOtherRateId()),
										"Equipment Id":this.myFirstEquipmentIdForWorkOrderId(this.mainDS.current_workorder_id),
									 "Work Order Id":this.mainDS.current_workorder_id}
	this_recipe.headings='myData["grid_headings"]["myOtherGridNonCOD"]'//'myData.example_data.example_data_entry_grid_headings'   //'["heading 1","heading 2","heading 3","item 0"]'
	this_recipe.dataHeadings=this.mainDS.wo_other_headings//'myData.example_data.example_data_entry_data_headings'
	
	this_recipe.inputFieldDefaultRecipe=new GUIInputFieldRecipe({initialConfigurationName:'generic_data_entry_field'})
	this_recipe.inputFieldDefaultRecipe.onchangeAttribute+=';myProgram.myRefreshOtherSummaryGridForFormView();'
	this_recipe.inputFieldDefaultRecipe.sizeAttribute="12"
	this_recipe.inputFieldDefaultRecipe.styleAttribute=";border:0 px solid grey;background-color:white;font-size:11;"
	
	var otherRateIdInputRecipe = new GUIInputFieldRecipe({initialConfigurationName:'generic_data_entry_field'})
	otherRateIdInputRecipe.myischangeokAttribute = __('updateOtherRateDescriptionCodeString')
	otherRateIdInputRecipe.onchangeAttribute+=';myProgram.myRefreshOtherSummaryGridForFormView();'
	otherRateIdInputRecipe.styleAttribute=";border:0 px solid grey;background-color:white;width:132;font-size:11;"
	
	this_recipe.inputFieldRecipes = []
	this_recipe.inputFieldRecipes[1] = otherRateIdInputRecipe

	var otherRateDescInputRecipe = new GUIInputFieldRecipe({initialConfigurationName:'generic_data_entry_field'})
	otherRateDescInputRecipe.myischangeokAttribute = __('myGenericMaterialOtherOnChangeCodeString')
	otherRateDescInputRecipe.onchangeAttribute+=';myProgram.myRefreshOtherSummaryGridForFormView();'
	otherRateDescInputRecipe.styleAttribute=";border:0 px solid grey;background-color:white;width:197;font-size:11;"
	this_recipe.inputFieldRecipes[2] = otherRateDescInputRecipe	
	
	//2008-04-11 (jc)-[2075]
	var equipmentIdInputRecipe = sysFunctions.cloneObject(this_recipe.inputFieldDefaultRecipe)
	equipmentIdInputRecipe.myischangeokAttribute = __('myGenericMaterialOtherOnChangeCodeString')
	this_recipe.inputFieldRecipes[3] = equipmentIdInputRecipe
																						
	var quantityInputRecipe = new GUIInputFieldRecipe({initialConfigurationName:'generic_data_entry_field'})
	quantityInputRecipe.myischangeokAttribute = __('myQuantityFieldHasChangedCodeString')
	this_recipe.inputFieldRecipes[0] = quantityInputRecipe																				
	quantityInputRecipe.onchangeAttribute+=';myProgram.myRefreshOtherSummaryGridForFormView();'
	quantityInputRecipe.styleAttribute=";border:0 px solid grey;background-color:white;font-size:11;"
	
	
																					
	var hiddenInputRecipe = new GUIInputFieldRecipe({initialConfigurationName:'generic_data_entry_field'})
	hiddenInputRecipe.styleAttribute=";border:0 px solid grey;background-color:white;font-size:11;"
	hiddenInputRecipe.disabledAttribute=true
	this_recipe.inputFieldRecipes[4] = hiddenInputRecipe
	this_recipe.inputFieldRecipes[5] = hiddenInputRecipe		
	this_recipe.inputFieldRecipes[6] = hiddenInputRecipe	
	this_recipe.inputFieldRecipes[7] = hiddenInputRecipe
	this_recipe.inputFieldRecipes[8] = hiddenInputRecipe	
	this_recipe.inputFieldRecipes[9] = hiddenInputRecipe
	
	var listDefaultRecipe = new GUIListRecipe({initialConfigurationName:"constraint_list"})
	listDefaultRecipe.listItemStyle+=";color:black;font-family:arial;background-color:white;font-size:11;"
	listDefaultRecipe.selectedBackgroundColor="#316ac4"
	listDefaultRecipe.mouseOverBackgroundColor="#316ac5"
	this_recipe.listDefaultRecipe = listDefaultRecipe
	
	this_recipe.rows=this.myOtherGridRows()
	this_recipe.dataRows='myProgram.mainDS.wo_other_list'
	this_recipe.joinColumnName='RN'
	this_recipe.formats=[{format:"number",scale:6,precision:2},
						{format:"list",items:__("myOtherRateItems")},
						{format:"text",length:60},
						{format:"list",items:__("myEquipmentItems")},
						{format:"text"},
						{format:"number"},
						{format:"number"},
						{format:"text"},
						{format:"text"},
						{format:"text"}]//leavingfield:leaving_function,enteringfield:entering_function}]
	return this_recipe
}
window.MyRecipe.prototype.myOtherGridNonCOD._methodName='myOtherGridNonCOD'
window.MyRecipe.prototype.myEquipmentItems = function()
{
	var the_rows_recipe=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'});
	the_rows_recipe.filterValues=[].dbPush(myProgram.mainDS.current_workorder_id).dbPush("y");
	the_rows_recipe.filterOnSourceHeadings=[].dbPush(myProgram.mainDS.wo_id_heading).dbPush("Specified");
	the_rows_recipe.sourceRows=myProgram.mainDS.wo_equipment_list;
	the_rows_recipe.sourceHeadings=myProgram.mainDS.wo_equipment_headings;
	the_rows_recipe.targetHeadings=[].dbPush("Equipment Id");
	the_rows_recipe.sortOnSourceHeadings=[];
	var rows = the_rows_recipe.prepare();
	var returnArray1 = []
	for(var i = 0; i < rows.length; i++)
	{
		returnArray1.push(rows[i][0])
	}
	return returnArray1
}
window.MyRecipe.prototype.myEquipmentItems._methodName='myEquipmentItems'
window.MyRecipe.prototype.myOtherRateItems = function()
{
	var the_rows_recipe=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'});
	the_rows_recipe.filterValues=[].dbPush(myProgram.mainDS.current_workorder_id);
	the_rows_recipe.filterOnSourceHeadings=[].dbPush(myProgram.mainDS.wo_id_heading);
	the_rows_recipe.sourceRows=myProgram.mainDS.static_other_rate_list;
	the_rows_recipe.sourceHeadings=myProgram.mainDS.static_other_rate_headings;
	the_rows_recipe.targetHeadings=[].dbPush(myProgram.mainDS.wo_other_rate_id_heading);
	the_rows_recipe.sortOnSourceHeadings=[];
	var rows = the_rows_recipe.prepare();
	var returnArray = []
	for(var i = 0; i < rows.length; i++)
	{
		returnArray.push(rows[i][0])
	}
	return returnArray
}
window.MyRecipe.prototype.myOtherRateItems._methodName='myOtherRateItems'
window.MyRecipe.prototype.myOtherGridRows = function()
{
    if(this.isWorkOrderCOD())
	{
		var targetHeadings = myData["grid_headings"]["myOtherGridCOD"]
	}
	else
	{
		var targetHeadings = myData["grid_headings"]["myOtherGridNonCOD"]
	}
	
	myProgram.mainDS.wo_other_grid_headings = targetHeadings
	
	var the_table=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'})
	the_table.sourceRows=((myProgram.isWorkOrderQuote()) ? this.mainDS.wo_quote_list : this.mainDS.wo_other_list)
	the_table.sourceHeadings=this.mainDS.wo_other_headings
	the_table.filterOnSourceHeadings=[].dbPush(this.mainDS.wo_id_heading).dbPush("Transmitted")
	the_table.filterValues=[].dbPush(this.mainDS.current_workorder_id).dbPush(function(val){return(val.value!="deleted")})
	the_table.sortOnSourceHeadings=[].dbPush(this.mainDS.wo_id_heading)
	the_table.targetHeadings=targetHeadings
	myProgram.tempDS.wo_other_grid_list=the_table.prepare()
	return 'myProgram.tempDS.wo_other_grid_list'
}
window.MyRecipe.prototype.myOtherGridRows._methodName='myOtherGridRows'
window.MyRecipe.prototype.myOtherGridNonCODOBSOLETE = function()
{
	var the_other_grid=new GUISimpleGridRecipe('{"initialConfigurationName":"generic_simple_grid",minRowCount:5}')
	the_other_grid.scrollingHeight=100
	the_other_grid.columnWidths=[100,100,100,100,100]
	the_other_grid.columnCount=6
	the_other_grid.disallowEditTransmittedAttribute = true
	the_row_numbers_string='{"rn_heading":"Line","rn_width":75,\
			"rn_cell_on_click":"myProgram.myNewPage(\'edit_material_page\',\'_row_number_\',\'_column_number_\')",\
			"rn_cell_on_click_template":"_cell_contents_\
			<a id=\\\"other_line__cell_contents_\\\" href=#abc onclick=\\\"myProgram.myDeleteItem(\'_grid_id_\',\'_row_number_\',\'_column_number_\')\\\" >\
				<img src=\'mydeleteitem.gif\' alt=\'Delete Row\' style=\'border-width:1;vertical-align:bottom\'></a>"\
			}'
	the_other_grid.addRowNumbers=the_row_numbers_string
	the_other_grid.idAttribute='wo_other_'
	the_other_grid.cellOnClickDefault="myProgram.myEditControl('_cell_escaped_contents_','_grid_id_','_cell_id_','_heading_contents_','_row_number_','_column_number_')"
	var the_table=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'})
	the_table.sourceRows=this.mainDS.wo_other_list
	the_table.sourceHeadings=this.mainDS.wo_other_headings
	the_table.filterOnSourceHeadings=[].dbPush(this.mainDS.wo_id_heading).dbPush("Transmitted")
	the_table.filterValues=[].dbPush(this.mainDS.current_workorder_id).dbPush(function(val){return(val.value!="deleted")})
	the_table.sortOnSourceHeadings=[].dbPush(this.mainDS.wo_id_heading)
	the_table.targetHeadings=this.mainDS.wo_other_grid_headings=["Quantity","Other Rate Id","Other Rate Description","Equipment Id","PO#","Transmitted","RN"]
	this.tempDS.wo_other_grid_list=the_table.prepare()
	the_other_grid.rows=this.tempDS.wo_other_grid_list
	the_other_grid.defaultColumnWidth=null
	the_other_grid.headings=the_table.targetHeadings
//	the_labor_grid.cellOnClick=["myProgram.myNewPage('edit_labor_page','_row_number_','_column_number_')"]
	return the_other_grid
}
window.MyRecipe.prototype.myOtherGridNonCODOBSOLETE._methodName='myOtherGridNonCODOBSOLETE'
window.MyRecipe.prototype.myOtherGridCODOBSOLETE = function()
{
	var the_other_grid=new GUISimpleGridRecipe('{"initialConfigurationName":"generic_simple_grid",minRowCount:5}')
	the_other_grid.scrollingHeight=100
	the_other_grid.columnWidths=[100,100,100,100,100,50,50,50,50]
	the_other_grid.columnCount=10
	the_other_grid.disallowEditTransmittedAttribute = true
	the_row_numbers_string='{"rn_heading":"Line","rn_width":75,\
			"rn_cell_on_click":"myProgram.myNewPage(\'edit_material_page\',\'_row_number_\',\'_column_number_\')",\
			"rn_cell_on_click_template":"_cell_contents_\
			<a id=\\\"other_line__cell_contents_\\\" href=#abc onclick=\\\"myProgram.myDeleteItem(\'_grid_id_\',\'_row_number_\',\'_column_number_\')\\\" >\
				<img src=\'mydeleteitem.gif\' alt=\'Delete Row\' style=\'border-width:1;vertical-align:bottom\'></a>"\
			}'
	the_other_grid.addRowNumbers=the_row_numbers_string
	the_other_grid.idAttribute='wo_other_'
	the_other_grid.cellOnClickDefault="myProgram.myEditControl('_cell_escaped_contents_','_grid_id_','_cell_id_','_heading_contents_','_row_number_','_column_number_')"
	var the_table=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'})
	the_table.sourceRows=this.mainDS.wo_other_list
	the_table.sourceHeadings=this.mainDS.wo_other_headings
	the_table.filterOnSourceHeadings=[].dbPush(this.mainDS.wo_id_heading).dbPush("Transmitted")
	the_table.filterValues=[].dbPush(this.mainDS.current_workorder_id).dbPush(function(val){return(val.value!="deleted")})
	the_table.sortOnSourceHeadings=[].dbPush(this.mainDS.wo_id_heading)
	the_table.targetHeadings=this.mainDS.wo_other_grid_headings=["Quantity","Other Rate Id","Other Rate Description","Equipment Id","PO#","Unit Price","BillQty","Price","Taxable","Transmitted","RN"]
	this.tempDS.wo_other_grid_list=the_table.prepare()
	the_other_grid.rows=this.tempDS.wo_other_grid_list
	the_other_grid.displayOnlyColumnIndices = [8]
	if(!this.isWorkOrderTaxable()) the_other_grid.displayOnlyColumnIndices.push(9)
	the_other_grid.defaultColumnWidth=null
	the_other_grid.headings=the_table.targetHeadings
//	the_labor_grid.cellOnClick=["myProgram.myNewPage('edit_labor_page','_row_number_','_column_number_')"]
	return the_other_grid
}
window.MyRecipe.prototype.myOtherGridCODOBSOLETE._methodName='myOtherGridCODOBSOLETE'
window.MyRecipe.prototype.myOtherGrid = function()
{
	if(this.isWorkOrderCOD())
	{
		return this.myOtherGridCOD();
	}
	else
	{
		return this.myOtherGridNonCOD();
	}
}
window.MyRecipe.prototype.myOtherGrid._methodName='myOtherGrid'
window.MyRecipe.prototype.myFlatRateSearchByManufacturer = function(window)
{
	this.tempDS.wo_flat_rate_search_limit = 0;
	
	var manufacturer_combobox = window['manufacturer_combobox'];
	var selectedIndex = manufacturer_combobox.selectedIndex;
	var manufacturer = manufacturer_combobox.options[selectedIndex].value;
	
	this.tempDS.selected_flat_rate_manufacturer = manufacturer;
	
	var myFlatRateSearchGridDiv = window['myFlatRateSearchGrid'];
	myFlatRateSearchGridDiv.innerHTML = this.myFlatRateSearchGrid().prepare();
}
window.MyRecipe.prototype.myFlatRateSearchByManufacturer._methodName='myFlatRateSearchByManufacturer'
window.MyRecipe.prototype.myFlatRateSearchByGroupId = function(window)
{
	this.tempDS.wo_flat_rate_search_limit = 0;
	
	var group_combobox = window['group_combobox'];
	var selectedIndex = group_combobox.selectedIndex;
	var group = group_combobox.options[selectedIndex].value;
	
	this.tempDS.selected_flat_rate_group = group;
	
	var myFlatRateSearchGridDiv = window['myFlatRateSearchGrid'];
	myFlatRateSearchGridDiv.innerHTML = this.myFlatRateSearchGrid().prepare();
}
window.MyRecipe.prototype.myFlatRateSearchByGroupId._methodName='myFlatRateSearchByGroupId'
window.MyRecipe.prototype.myPartsSearchByGroupId = function()
{
	this.tempDS.wo_parts_search_limit = 0;
	
	var group_combobox = window['group_combobox'];
	var selectedIndex = group_combobox.selectedIndex;
	var group_id = group_combobox.options[selectedIndex].value;
	
	this.mainDS.wo_selected_group = group_id;
	
	var myPartsSearchGridDiv = window['myPartsSearchGrid'];
	myPartsSearchGridDiv.innerHTML = this.myPartsSearchGrid().prepare();
}
window.MyRecipe.prototype.myPartsSearchByGroupId._methodName='myPartsSearchByGroupId'
window.MyRecipe.prototype.myPartsSearchResultLimitChange = function(window)
{
	var limit_combobox = window['limit_combobox'];
	var selectedIndex = limit_combobox.selectedIndex;
	var limit = limit_combobox.options[selectedIndex].value;
	
	this.mainDS.maxRowCount = limit;
	
	var myPartsSearchGridDiv = window['myPartsSearchGrid'];
	myPartsSearchGridDiv.innerHTML = this.myPartsSearchGrid().prepare();
}
window.MyRecipe.prototype.myPartsSearchResultLimitChange._methodName='myPartsSearchResultLimitChange'
window.MyRecipe.prototype.myFlatRateSelectItem = function(grid_id, row_number, column_number, window)
{
	var id = this.tempDS.flatRateSearchComboboxId
	var the_input_field=document.all[id]
	this.tempDS.flatRateSearchComboboxId = null
	var flat_rate_id = this.tempDS.wo_flat_rate_search_grid_list[row_number][0];
	
	the_input_field.value = flat_rate_id
	
	this.mainDS.current_flat_rate_grid_search_filter_array = null;
	window.close();
	myProgram.myFlatRateIdHasChanged()
}
window.MyRecipe.prototype.myFlatRateSelectItem._methodName='myFlatRateSelectItem'
window.MyRecipe.prototype.myPartsSelectItem = function(grid_id, row_number, column_number, window)
{
	var the_input_field = this.tempDS.partNumberInputElement
	var part_id = this.tempDS.wo_parts_search_grid_list[row_number][0];
	
	the_input_field.value = part_id
	the_input_field.getAttribute("mynewvalue") = part_id
	
	this.mainDS.current_parts_grid_search_filter_array = null;
	this.myPartNumberChanged(the_input_field)
	delete(this.tempDS.partNumberInputElement)
	myProgram.resetContextDiv()
}
window.MyRecipe.prototype.myPartsSelectItem._methodName='myPartsSelectItem'
window.MyRecipe.prototype.resetCurrentWorkOrderDiv = function()
{
    myProgram.mainDS.current_workorder_id = null
    sysFunctions.setInnerHTMLForElement("currentWorkOrderDiv", "NO WORKORDER HAS BEEN SELECTED")
}
window.MyRecipe.prototype.resetCurrentWorkOrderDiv._methodName='resetCurrentWorkOrderDiv'
window.MyRecipe.prototype.loadIntoCurrentWorkOrderTab = function(html)
{
    sysFunctions.setInnerHTMLForElement("currentWorkOrderDiv", html)
    
    this.myDirectToCurrentWorkOrderPage()
}
window.MyRecipe.prototype.loadIntoCurrentWorkOrderTab._methodName='loadIntoCurrentWorkOrderTab'
window.MyRecipe.prototype.resetContextDiv = function()
{
	window["context_menu"].style.top = 0
	window["context_menu"].style.left = 0
	window["context_menu"].style.width = 400
	window["context_menu"].style.height = 400
	window["context_menu"].innerHTML = ""
	window["context_menu"].style.display = "none"
}
window.MyRecipe.prototype.resetContextDiv._methodName='resetContextDiv'
window.MyRecipe.prototype.myNoLaborDatesTemplate = function()
{
	var the_recipe = new GUITemplateRecipe()
	the_recipe.template=[]
	the_recipe.template.dbPush("No Pay Periods available.  Please contact technical support.")
	return the_recipe
}
window.MyRecipe.prototype.myNoLaborDatesTemplate._methodName='myNoLaborDatesTemplate'
window.MyRecipe.prototype.isCurrentPayPeriodValid = function()
{
	if(this.tempDS.current_pay_period_id == null || this.tempDS.current_pay_period_id.trim() == "")
	{
		return false
	}
	
	var the_locator_recipe=new SUITableCellValueLocatorRecipe({"initialConfigurationName":"generic_table_cell_value_locator"})
	the_locator_recipe.tableRows=this.mainDS.static_labor_date_list
	the_locator_recipe.tableHeadings=this.mainDS.static_labor_date_headings
	the_locator_recipe.tableLocatorHeading=[].dbPush("Period Id")
	the_locator_recipe.tableLocatorFilter=[].dbPush(this.tempDS.current_pay_period_id)
	the_locator_recipe.tableTargetCellHeading="Start Date"
	var start_date_string=the_locator_recipe.prepare()
	return (start_date_string != null)
}
window.MyRecipe.prototype.isCurrentPayPeriodValid._methodName='isCurrentPayPeriodValid'
window.MyRecipe.prototype.myTimeSheetSummaryGrid = function()
{	
	var start_date_string;
	var num_days;
	
	if(!this.isCurrentPayPeriodValid())
	{
		this.tempDS.current_pay_period_id = this.myDefaultPayPeriodValue()
	}
	
	if(this.mainDS.static_labor_date_list != null)
	{
		if(this.mainDS.static_labor_date_list.length == 0)
		{
			return this.myNoLaborDatesTemplate()
		}
		else
		{	
			if(this.tempDS.current_pay_period_id != null)
			{
				//Get the start date and the days in the pay period.
				var the_locator_recipe=new SUITableCellValueLocatorRecipe({"initialConfigurationName":"generic_table_cell_value_locator"})
				the_locator_recipe.tableRows=this.mainDS.static_labor_date_list
				the_locator_recipe.tableHeadings=this.mainDS.static_labor_date_headings
				the_locator_recipe.tableLocatorHeading=[].dbPush("Period Id")
				the_locator_recipe.tableLocatorFilter=[].dbPush(this.tempDS.current_pay_period_id)
				the_locator_recipe.tableTargetCellHeading="Start Date"
				var start_date_string=the_locator_recipe.prepare()
				
				var the_locator_recipe=new SUITableCellValueLocatorRecipe({"initialConfigurationName":"generic_table_cell_value_locator"})
				the_locator_recipe.tableRows=this.mainDS.static_labor_date_list
				the_locator_recipe.tableHeadings=this.mainDS.static_labor_date_headings
				the_locator_recipe.tableLocatorHeading=[].dbPush("Period Id")
				the_locator_recipe.tableLocatorFilter=[].dbPush(this.tempDS.current_pay_period_id)
				the_locator_recipe.tableTargetCellHeading="Days in Period"
				var num_days=the_locator_recipe.prepare()
			
				//Convert to an integer.
				if(num_days != null)num_days = num_days*1
			}
			else
			{
				return this.myNoLaborDatesTemplate()
			}
		}
	}
	else
	{
		return this.myNoLaborDatesTemplate()
	}
	
	if(start_date_string == null) 
	{
		start_date_string = this.myEditRecipeFor({"recipeName":"System Date"})
		num_days = 7
	}
	
	start_date_string = sysFunctions.stringToDateFormat(start_date_string);
	
	var converted = Date.parse(start_date_string);
	var start_date_object = new Date(converted);
	
	var year = start_date_object.getFullYear();
	var month = start_date_object.getMonth()+1;
	if(month.toString().length == 1)month = "0"+month;
	var date = start_date_object.getDate();
	if(date.toString().length == 1)date = "0"+date;
		
	var start_date_full_length = year+"-"+month+"-"+date;
	
	var end_date_object = new Date(start_date_object);
	end_date_object.setDate(start_date_object.getDate()+num_days);
	
	var year = end_date_object.getFullYear();
	var month = end_date_object.getMonth()+1;
	if(month.toString().length == 1)month = "0"+month;
	var date = end_date_object.getDate();
	if(date.toString().length == 1)date = "0"+date;
		
	var end_date_full_length = year+"-"+month+"-"+date;
	
	var time_sheet_headings = new Array();
	var time_sheet_dates = new Array();
	
	time_sheet_headings.push("Work Order ID");
	time_sheet_headings.push("Pay Type ID");
	
	while(start_date_object < end_date_object)
	{
		var year = start_date_object.getFullYear();
		var month = start_date_object.getMonth()+1;
		if(month.toString().length == 1)month = "0"+month;
		var date = start_date_object.getDate();
		if(date.toString().length == 1)date = "0"+date;
		
		var date_heading_short_string = month+"-"+date;
		var date_string = year+"-"+month+"-"+date;
		
		time_sheet_dates.push(date_string);
		time_sheet_headings.push(date_heading_short_string)
		
		start_date_object.setDate(start_date_object.getDate()+1);
	}
	//Add the site name heading...
	time_sheet_headings.push("Site Name");
	time_sheet_headings.push("Overhead");
	
	//Get all of the work orders that are scheduled for these dates for the logged on technician.
	var wo_list = this.mainDS.wo_list;
	var wo_collection = new Array();
	
	var wo_id_index = this.mainDS.wo_headings.dbIndexOf("Work Order Id")
	
	for(i = 0; i < wo_list.length; i++)
	{
		var is_in = false
		for(n = 0; n < wo_collection.length; n++)
		{
			if(wo_list[i][wo_id_index] == wo_collection[n][wo_id_index])
			{
				is_in = true;
				break;
			}
		}
		if(is_in == false)
		{
			wo_collection.push(wo_list[i]);
		}
	}
	
	//Now build the rows.
	//First row will be the some of labour hours for each day (column).
	var row_set = new Array();
	var equipment_list = this.mainDS.wo_equipment_list;
	
	for(i = 0; i < wo_collection.length; i++)
	{
		//Iterate through the labor rows and see if there is a labor added for this work order in the time sheet date range.
		var wo_has_labor = this.myWorkOrderHasLaborForPeriod(wo_collection[i][wo_id_index],start_date_full_length,end_date_full_length)
		
		if(!wo_has_labor)
		{
			continue
		}
		
		var wo_labor_pay_type_collection = this.myGetUniqueLaborPayTypesForWorkOrderForPeriod(wo_collection[i][wo_id_index],start_date_full_length,end_date_full_length)
		
		for(var pay_type_iterator_index = 0; pay_type_iterator_index < wo_labor_pay_type_collection.length; pay_type_iterator_index++)
		{
		
			var row = new Array();
			
			row.push(wo_collection[i][wo_id_index]);
			row.push(wo_labor_pay_type_collection[pay_type_iterator_index].toLowerCase());
			
			//Now iterate through each day in the range, summing each days labor hours done for this work order.
			for(var time_sheet_date_index = 0; time_sheet_date_index < time_sheet_dates.length; time_sheet_date_index++)
			{
				//For each day push the labor hours sum onto the row.
				var labor_hours_sum = 0;
				var labor_list = this.mainDS.wo_labor_list;
			
				var labor_wo_id_index = this.mainDS.wo_labor_headings.dbIndexOf("Work Order Id")
				var labor_date_index = this.mainDS.wo_labor_headings.dbIndexOf("Date")
				var labor_hours_index = this.mainDS.wo_labor_headings.dbIndexOf("Hours")
				var labor_pay_type_index = this.mainDS.wo_labor_headings.dbIndexOf("Pay Type Id")
				var labor_transmitted_index = this.mainDS.wo_labor_headings.dbIndexOf("Transmitted")
				//2008-04-10 (jc)-[2080]-Sub only sees time for herself
				var labor_tech_id_index = this.mainDS.wo_labor_headings.dbIndexOf("Technician Id")
				
				for(n = 0; n < labor_list.length; n++)
				{
					if(labor_list[n][labor_wo_id_index] == wo_collection[i][wo_id_index] && 
					   sysFunctions.stringToMilitaryDateFormat(labor_list[n][labor_date_index]) == time_sheet_dates[time_sheet_date_index] &&
					   labor_list[n][labor_pay_type_index] == wo_labor_pay_type_collection[pay_type_iterator_index] &&
					   labor_list[n][labor_transmitted_index] != "deleted" &&
					   labor_list[n][labor_tech_id_index] == myProgram.mainDS.tech_id)
					{
						labor_hours_sum = labor_hours_sum + (labor_list[n][labor_hours_index])*1;
					}
				}
				//Now push the labor sum for this day into the row.
				row.push(labor_hours_sum);
			}	
			//Put the site name onto the end of the row.
			var wo_site_name_index = this.mainDS.wo_headings.dbIndexOf("Site Name")
			var site_name = wo_collection[i][wo_site_name_index]
			row.push(site_name)
			
			var wo_overhead_index = this.mainDS.wo_headings.dbIndexOf("Overhead")
			var wo_overhead = wo_collection[i][wo_overhead_index]
			row.push(wo_overhead)
			
			//Now push the row into the row_set.
			row_set.push(row);
		}
	}	
	var summary_row = new Array();
	summary_row.push("<span style='color:blue'>Total</span>");
	summary_row.push('');
	
	//Iterate through each row and sum each days labor hours across across all work orders.
	for(x = 2; x <= time_sheet_headings.length-3; x++)
	{
		var day_sum = 0;
		for(i = 0; i < row_set.length; i++)
		{
			day_sum = day_sum + row_set[i][x];
		}
		summary_row.push("<span style='color:blue'>"+day_sum+"</span>");
	}
	summary_row.push("");
	summary_row.push("ZZZZZZZZZZZ");
	row_set.push(summary_row);
		
	column_widths = new Array();
	for(x = 0; x < time_sheet_headings.length; x++)
	{
		if(x == 0)
		{
			column_widths.push(85);
		}
		else if(x == 1)
		{
			column_widths.push(65);
		}
		else if(x == time_sheet_headings.length - 2)
		{
			column_widths.push(130)
		}
		else
		{
			column_widths.push(35);
		}
	}
	
	var the_time_sheet_summary_grid=new GUISimpleGridRecipe('{"initialConfigurationName":"formview_grid",minRowCount:1}')
	the_time_sheet_summary_grid.scrollingHeight=450;
	the_time_sheet_summary_grid.columnWidths=column_widths;
	the_time_sheet_summary_grid.columnCount=time_sheet_headings.length - 1;
	the_time_sheet_summary_grid.scrollingHeight="0;height:800;overflow:auto;"
	
	the_time_sheet_summary_grid.gridWidth=0
	for(var i = 0; i < column_widths.length; i++)
	{
		the_time_sheet_summary_grid.gridWidth=the_time_sheet_summary_grid.gridWidth+(column_widths[i]*1)
	}
	the_time_sheet_summary_grid.gridWidth=the_time_sheet_summary_grid.gridWidth+20
		
	the_time_sheet_summary_grid.alert=false
	
	var the_table=new SUIDataModelRecipe('{"initialConfigurationName":"generic_data_model"}')
	
	the_table.sourceHeadings=time_sheet_headings //Column Headings.
	the_table.sourceRows=row_set //Rows of data.
	the_table.sortOnSourceHeadings=[].dbPush("Overhead").dbPush(this.mainDS.wo_id_heading).dbPush("Pay Type Id")
	the_table.targetHeadings=time_sheet_headings;
	this.tempDS.wo_time_sheet_summary_list=the_table.prepare()
	the_time_sheet_summary_grid.rows=this.tempDS.wo_time_sheet_summary_list
	the_time_sheet_summary_grid.defaultColumnWidth=null
	
	the_time_sheet_summary_grid.headingDefaultStyle+=";border-style:solid;border-color:#676566;border-width:1 1 1 0;padding:1"
	the_time_sheet_summary_grid.gridStyle+=";border-width:0 0 0 1;border-color:#676566;"
	
	
	the_time_sheet_summary_grid.headings=the_table.targetHeadings
	the_time_sheet_summary_grid.cellDefaultStyle = "font-size:11;color:black;border-color:#676566;text-align:left;vertical-align:top;border-width:0 1 1 0;padding:1;font-family:arial;"
	return the_time_sheet_summary_grid
}
window.MyRecipe.prototype.myTimeSheetSummaryGrid._methodName='myTimeSheetSummaryGrid'
window.MyRecipe.prototype.myPriceLevelChangedCodeString = function()
{
	return "function(){myProgram.myPriceLevelChanged(this)}"
}
window.MyRecipe.prototype.myPriceLevelChangedCodeString._methodName='myPriceLevelChangedCodeString'
window.MyRecipe.prototype.myFlatRateChangedCodeString = function()
{
	return "function(){myProgram.myFlatRateIdHasChanged(this)}"
}
window.MyRecipe.prototype.myFlatRateChangedCodeString._methodName='myFlatRateChangedCodeString'
window.MyRecipe.prototype.checkForLeavingContext = function()
{
	var contextDiv = window["context_menu"]
	var mouseX = event.x
	var mouseY = event.y
	
	if(mouseX <= contextDiv.style.pixelLeft || mouseX >= (contextDiv.style.pixelLeft+contextDiv.style.pixelWidth))
	{
		contextDiv.style.display = "none"
	}
	if(mouseY <= contextDiv.style.pixelTop || mouseY >= (contextDiv.style.pixelTop+contextDiv.style.pixelHeight))
	{
		contextDiv.style.display = "none"
	}
}
window.MyRecipe.prototype.checkForLeavingContext._methodName='checkForLeavingContext'
window.MyRecipe.prototype.myPriceLevelChanged = function(priceLevelElement)
{
	var flatRateIdElement = sysFunctions.locateAdjacentColumnInputNode(priceLevelElement, "Flat Rate Id")
	myProgram.myFlatRateIdHasChanged(flatRateIdElement)
}
window.MyRecipe.prototype.myPriceLevelChanged._methodName='myPriceLevelChanged'
window.MyRecipe.prototype.myFlatRateIdHasChanged = function(flatRateInputElement)
{
	var quantityValue = sysFunctions.locateAdjacentColumnInputNode(flatRateInputElement, "Quantity").value
	var flatRateIdValue = flatRateInputElement.value
	if(flatRateIdValue == "")
	{
		return
	}
	var descriptionElement = sysFunctions.locateAdjacentColumnInputNode(flatRateInputElement, "Description")
	var description = myProgram.myFlatRateValueForId(flatRateIdValue, "Description")
	var priceLevelInputElement = sysFunctions.locateAdjacentColumnInputNode(flatRateInputElement, "Price Level")
	var priceLevelValue = priceLevelInputElement.value
	var unitPriceValue = this.myUnitPriceFor(flatRateIdValue, priceLevelValue)
	var priceValue = (quantityValue*unitPriceValue).toFixed(2)
	
	var unitPriceElement = sysFunctions.locateAdjacentColumnInputNode(priceLevelInputElement, "Unit Price")
	var priceElement = sysFunctions.locateAdjacentColumnInputNode(priceLevelInputElement, "Price")
	
	unitPriceElement.value = unitPriceValue.toString()
	unitPriceElement.getAttribute("mynewvalue") = unitPriceValue.toString()
	descriptionElement.value = description
	sysFunctions.updateDataValue(descriptionElement, descriptionElement.value)
	sysFunctions.updateDataValue(unitPriceElement, unitPriceElement.value)
	priceElement.value = priceValue.toString()
	priceElement.getAttribute("mynewvalue") = priceValue.toString()
	sysFunctions.updateDataValue(priceElement, priceElement.value)
}
window.MyRecipe.prototype.myFlatRateIdHasChanged._methodName='myFlatRateIdHasChanged'
window.MyRecipe.prototype.myFlatRateValueForId = function(flatRateId, heading)
{
	var the_locator_recipe=new SUITableCellValueLocatorRecipe({"initialConfigurationName":"generic_table_cell_value_locator"})
	the_locator_recipe.tableRows=this.flatRateDS.static_flat_rate_list
	the_locator_recipe.tableHeadings=this.flatRateDS.static_flat_rate_headings
	the_locator_recipe.tableLocatorHeading="Flat Rate Id"
	the_locator_recipe.tableLocatorFilter=flatRateId
	the_locator_recipe.tableTargetCellHeading=heading
	return the_locator_recipe.prepare()
}
window.MyRecipe.prototype.myFlatRateValueForId._methodName='myFlatRateValueForId'
window.MyRecipe.prototype.myPriceLevelRecipe = function(priceLevelOptions)
{
	var the_combobox=new GUIComboBoxRecipe({initialConfigurationName:'generic_combobox'});
	the_combobox.selectedOptionText=this.getDefaultPriceLevel()
	the_combobox.breakpointOnPrepare=false;
	the_combobox.idAttribute='price_level_combobox';
	the_combobox.options=myProgram.myPriceLevelItems()//this.flatRateDS.static_flat_rate_price_level_list
	the_combobox.onchangeAttribute = "myProgram.myRefreshTotals()"
	
	return the_combobox
}
window.MyRecipe.prototype.myPriceLevelRecipe._methodName='myPriceLevelRecipe'
window.MyRecipe.prototype.myPriceLevelItems = function()
{
	var optionsArray = []
	
	for(var i = 0; i < this.flatRateDS.static_flat_rate_price_level_list.length; i++)
	{
		optionsArray.push(this.flatRateDS.static_flat_rate_price_level_list[i][0])
	}
	
	return optionsArray
}
window.MyRecipe.prototype.myPriceLevelItems._methodName='myPriceLevelItems'
window.MyRecipe.prototype.myTaxBaseFor = function(flatRateIdValue, priceLevelValue)
{
	var the_rows_recipe=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'});
	the_rows_recipe.filterValues=[].dbPush(flatRateIdValue);
	the_rows_recipe.filterOnSourceHeadings=[].dbPush("Flat Rate Id");
	the_rows_recipe.sourceRows=this.flatRateDS.static_flat_rate_list;
	the_rows_recipe.sourceHeadings=this.flatRateDS.static_flat_rate_headings;
	the_rows_recipe.targetHeadings=[].dbPush("TaxBase"+priceLevelValue);
	the_rows_recipe.sortOnSourceHeadings=[];
	the_rows=the_rows_recipe.prepare();
	
	return the_rows[0][0]
}
window.MyRecipe.prototype.myTaxBaseFor._methodName='myTaxBaseFor'
window.MyRecipe.prototype.myUnitPriceFor = function(flatRateIdValue, priceLevelValue)
{
	var the_rows_recipe=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'});
	the_rows_recipe.filterValues=[].dbPush(flatRateIdValue);
	the_rows_recipe.filterOnSourceHeadings=[].dbPush("Flat Rate Id");
	the_rows_recipe.sourceRows=this.flatRateDS.static_flat_rate_list;
	the_rows_recipe.sourceHeadings=this.flatRateDS.static_flat_rate_headings;
	the_rows_recipe.targetHeadings=[].dbPush("UnitPrice"+priceLevelValue);
	the_rows_recipe.sortOnSourceHeadings=[];
	the_rows=the_rows_recipe.prepare();
	
	return the_rows[0][0]
}
window.MyRecipe.prototype.myUnitPriceFor._methodName='myUnitPriceFor'
window.MyRecipe.prototype.myFirstFlatRateId = function()
{
	var flatRateIdIndex = this.flatRateDS.static_flat_rate_headings.dbIndexOf("Flat Rate Id")
	var flatRateId = this.flatRateDS.static_flat_rate_list[0][flatRateIdIndex]
	return flatRateId
}
window.MyRecipe.prototype.myFirstFlatRateId._methodName='myFirstFlatRateId'
window.MyRecipe.prototype.getDefaultPriceLevel = function()
{
	var the_rows_recipe=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'});
	the_rows_recipe.filterValues=[].dbPush(this.mainDS.current_workorder_id);
	the_rows_recipe.filterOnSourceHeadings=[].dbPush("Work Order Id");
	the_rows_recipe.sourceRows=this.mainDS.wo_list;
	the_rows_recipe.sourceHeadings=this.mainDS.wo_headings;
	the_rows_recipe.targetHeadings=[].dbPush("Price Level");
	the_rows_recipe.sortOnSourceHeadings=[];
	the_rows=the_rows_recipe.prepare();
	
	return the_rows[0][0]
}
window.MyRecipe.prototype.getDefaultPriceLevel._methodName='getDefaultPriceLevel'
window.MyRecipe.prototype.myGetFlatRatePriceLevels = function(flatRateId)
{
	var the_rows_recipe=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'});
	the_rows_recipe.filterValues=[].dbPush(flatRateId);
	the_rows_recipe.filterOnSourceHeadings=[].dbPush("Flat Rate Id");
	the_rows_recipe.sourceRows=this.flatRateDS.static_flat_rate_list;
	the_rows_recipe.sourceHeadings=this.flatRateDS.static_flat_rate_headings;
	the_rows_recipe.targetHeadings=this.flatRateDS.static_flat_rate_headings;
	the_rows_recipe.sortOnSourceHeadings=[];
	the_rows=the_rows_recipe.prepare();
	
	if(the_rows == null)
	{
		alert("Ref Code:37 The Flat Rate Id selected is not a valid Flat Rate Id.  Please contact Subnical Support and provide the Reference Code 37.")
		return []
	}
	if(the_rows.length == 0)
	{
		alert("Ref Code:37 The Flat Rate Id selected is not a valid Flat Rate Id.  Please contact Subnical Support and provide the Reference Code 37.")
		return []
	}
	var the_row = the_rows[0]
	
	var priceLevelArrayToReturn = []
	
	for(var i = 1; i <= 9; i++)
	{
		var index = this.flatRateDS.static_flat_rate_headings.dbIndexOf("UnitPrice"+i.toString())
		var priceLevelValue = the_row[index]
		if(priceLevelValue*1 != 0)
		{
			priceLevelArrayToReturn.push(i.toString())
		}
	}
	
	return priceLevelArrayToReturn;
}
window.MyRecipe.prototype.myGetFlatRatePriceLevels._methodName='myGetFlatRatePriceLevels'
window.MyRecipe.prototype.myGetUniqueLaborPayTypesForWorkOrderForPeriod = function(wo_id,start_date_string,end_date_string)
{
	var labor_date;
	var labor_wo_id;
	var labor_tech_id;
	var labor_pay_type_id;
	
	var labor_wo_id_index = this.mainDS.wo_labor_headings.dbIndexOf("Work Order Id");
	var labor_date_index = this.mainDS.wo_labor_headings.dbIndexOf("Date");
	var labor_tech_id_index = this.mainDS.wo_labor_headings.dbIndexOf("Technician Id");
	var labor_pay_type_index = this.mainDS.wo_labor_headings.dbIndexOf("Pay Type Id")
	var labor_transmitted_index = this.mainDS.wo_labor_headings.dbIndexOf("Transmitted")
	
	var pay_type_collection = new Array()
	
	for(var i = 0; i < this.mainDS.wo_labor_list.length; i++)
	{
		labor_date = this.mainDS.wo_labor_list[i][labor_date_index]
		labor_wo_id = this.mainDS.wo_labor_list[i][labor_wo_id_index]
		labor_tech_id = this.mainDS.wo_labor_list[i][labor_tech_id_index]
		labor_pay_type_id = this.mainDS.wo_labor_list[i][labor_pay_type_index]
		labor_transmitted = this.mainDS.wo_labor_list[i][labor_transmitted_index]
		
		if(labor_date >= start_date_string && labor_date <= end_date_string && labor_wo_id == wo_id && labor_tech_id == this.mainDS.tech_id && labor_transmitted != "deleted")
		{
			var is_in = this.myIsInCollection(labor_pay_type_id, pay_type_collection) 
			if(!is_in)
			{
				pay_type_collection.push(labor_pay_type_id)
			}  
		}
	}
	return pay_type_collection
}
window.MyRecipe.prototype.myGetUniqueLaborPayTypesForWorkOrderForPeriod._methodName='myGetUniqueLaborPayTypesForWorkOrderForPeriod'
window.MyRecipe.prototype.myWorkOrderHasLaborForPeriod = function(wo_id,start_date_string,end_date_string)
{
	var labor_date;
	var labor_wo_id;
	var labor_tech_id;
	
	var labor_wo_id_index = this.mainDS.wo_labor_headings.dbIndexOf("Work Order Id");
	var labor_date_index = this.mainDS.wo_labor_headings.dbIndexOf("Date");
	var labor_tech_id_index = this.mainDS.wo_labor_headings.dbIndexOf("Technician Id");
	var labor_transmitted_index = this.mainDS.wo_labor_headings.dbIndexOf("Transmitted");
	
	for(var i = 0; i < this.mainDS.wo_labor_list.length; i++)
	{
		labor_date = this.mainDS.wo_labor_list[i][labor_date_index]
		labor_wo_id = this.mainDS.wo_labor_list[i][labor_wo_id_index]
		labor_tech_id = this.mainDS.wo_labor_list[i][labor_tech_id_index]
		labor_transmitted = this.mainDS.wo_labor_list[i][labor_transmitted_index]
		
		if(labor_date >= start_date_string && labor_date <= end_date_string && labor_wo_id == wo_id && labor_tech_id == this.mainDS.tech_id && labor_transmitted != "deleted")
		{
			return true   
		}
	}
	return false
}
window.MyRecipe.prototype.myWorkOrderHasLaborForPeriod._methodName='myWorkOrderHasLaborForPeriod'
window.MyRecipe.prototype.myFlatRateSearchGrid = function()
{
	var the_flat_rate_search_grid=new GUISimpleGridRecipe('{"initialConfigurationName":"generic_simple_grid",minRowCount:5}')
	the_flat_rate_search_grid.scrollingHeight=100
	the_flat_rate_search_grid.columnWidths=[100,100,100,100,100]
	the_flat_rate_search_grid.columnCount=5
	the_row_numbers_string='{"rn_heading":"Line","rn_width":75,\
			"rn_cell_on_click":"myProgram.myFlatRateSelectItem(\'_row_number_\',\'_column_number_\', window)",\
			"rn_cell_on_click_template":"_cell_contents_\
			<a id=\\\"part_line__cell_contents_\\\" href=#abc onclick=\\\"myProgram.myFlatRateSelectItem(\'_grid_id_\',\'_row_number_\',\'_column_number_\', window)\\\" >\
				<img src=\'myselectitem.gif\' alt=\'Select Part\' style=\'border-width:1;vertical-align:bottom\'></a>"\
			}'
	the_flat_rate_search_grid.addRowNumbers=the_row_numbers_string
	the_flat_rate_search_grid.alert=false
	var maxRowCount = this.mainDS.maxRowCount;
	if(maxRowCount==null)this.mainDS.maxRowCount = maxRowCount = 200;
	var the_table=new SUIDataModelRecipe({"initialConfigurationName":"generic_data_model","maxRowCount":maxRowCount})
	the_table.sourceRows=this.flatRateDS["static_flat_rate_list"]
	the_table.sourceHeadings=this.flatRateDS.static_flat_rate_headings
	
	var keyword_array = this.mainDS.current_flat_rate_grid_search_filter_array;
	var isKeywords;
	if(keyword_array != null)
	{
		if(keyword_array.length == 0)
		{
			isKeywords = false
		}
		else
		{
			isKeywords = true
		}
	}
	else
	{
		isKeywords = false
	}
	
	var group_filter = this.tempDS.selected_flat_rate_group;
	if(this.tempDS.selected_flat_rate_group == 'All')
	{
		group_filter = function(val){return true};
	}
	if(this.tempDS.selected_flat_rate_group == null  && !isKeywords && this.tempDS.selected_flat_rate_manufacturer == null) //Make grid empty when no keyword or group is selected...
	{
		group_filter = function(val){return false};
	}
	if(this.tempDS.selected_flat_rate_group == null && (isKeywords || this.tempDS.selected_flat_rate_manufacturer != null))
	{
		group_filter = function(val){return true};
	}
	
	var manufacturer_filter = this.tempDS.selected_flat_rate_manufacturer;
	if(this.tempDS.selected_flat_rate_manufacturer == 'All')
	{
		manufacturer_filter = function(val){return true};
	}
	if(this.tempDS.selected_flat_rate_manufacturer == null  && !isKeywords && this.tempDS.selected_flat_rate_group == null) //Make grid empty when no keyword or group is selected...
	{
		manufacturer_filter = function(val){return false};
	}
	if(this.tempDS.selected_flat_rate_manufacturer == null && (isKeywords || this.tempDS.selected_flat_rate_group != null))
	{
		manufacturer_filter = function(val){return true};
	}
	
	the_table.filterOnSourceHeadings=[].dbPush("Description")
	the_table.filterOnSourceHeadings.dbPush("Flat Rate Group")
	the_table.filterOnSourceHeadings.dbPush("Manufacturer")
	
	the_table.filterValues=[].dbPush(myProgram.myFilterByFRKeyword)
	the_table.filterValues.dbPush(group_filter)
	the_table.filterValues.dbPush(manufacturer_filter)
	
	the_table.targetHeadings=["Flat Rate Id", "Description", "Flat Rate Group", "Manufacturer"]
	this.tempDS.wo_flat_rate_search_grid_list=the_table.prepare()
	
	the_flat_rate_search_grid.rows=this.tempDS.wo_flat_rate_search_grid_list
	the_flat_rate_search_grid.defaultColumnWidth=null
	the_flat_rate_search_grid.headings=the_table.targetHeadings
	return the_flat_rate_search_grid
}
window.MyRecipe.prototype.myFlatRateSearchGrid._methodName='myFlatRateSearchGrid'
window.MyRecipe.prototype.myPartsSearchGrid = function()
{
	var the_parts_search_grid=new GUISimpleGridRecipe('{"initialConfigurationName":"formview_grid",minRowCount:4}')
	the_parts_search_grid.borderAttribute=1
	the_parts_search_grid.headingDefaultStyle+=";border-top:1 px solid #eeeeee;"
	//the_parts_search_grid.scrollingHeight = "0;height:85;overflow:scroll;"
	if(this.mainDS.configInventoryLookupRowsDisplayed == null) this.mainDS.configInventoryLookupRowsDisplayed = 12
	the_parts_search_grid.minRowCount=12//this.mainDS.configInventoryLookupRowsDisplayed
	the_parts_search_grid.scrollingHeight=(this.mainDS.configInventoryLookupRowsDisplayed*20)+";overflow:scroll;"
	the_parts_search_grid.columnWidths=[100,135,100,100]
	the_parts_search_grid.columnCount=4
	the_row_numbers_string='{"rn_heading":"","rn_width":40,\
			"rn_cell_on_click":"myProgram.myPartsSelectItem(\'_row_number_\',\'_column_number_\', window)",\
			"rn_cell_on_click_template":"\
			<a id=\\\"part_line__cell_contents_\\\" href=#abc onclick=\\\"myProgram.myPartsSelectItem(\'_grid_id_\',\'_row_number_\',\'_column_number_\', window)\\\" >\
				<img src=\'myselectitem.gif\' alt=\'Select Part\' style=\'border-width:0;vertical-align:middle\'></a>"\
			}'
	the_parts_search_grid.addRowNumbers=the_row_numbers_string
	the_parts_search_grid.alert=false
	var maxRowCount = this.mainDS.maxRowCount;
	if(maxRowCount==null)this.mainDS.maxRowCount = maxRowCount = 200;
	var the_table=new SUIDataModelRecipe({"initialConfigurationName":"generic_data_model","maxRowCount":maxRowCount})
	the_table.sourceRows=this.inventoryDS["static_part_list"]
	the_table.sourceHeadings=this.inventoryDS.static_part_headings
	
	var keyword_array = this.mainDS.current_parts_grid_search_filter_array;
	var isKeywords;
	if(keyword_array != null)
	{
		if(keyword_array.length == 0)
		{
			isKeywords = false
		}
		else
		{
			isKeywords = true
		}
	}
	else
	{
		isKeywords = false
	}
	
	var group_filter = this.mainDS.wo_selected_group;
	if(this.mainDS.wo_selected_group == 'All')
	{
		group_filter = function(val){return true};
	}
	if(this.mainDS.wo_selected_group == null  && !isKeywords) //Make grid empty when no keyword or group is selected...
	{
		group_filter = function(val){return false};
	}
	if(this.mainDS.wo_selected_group == null && isKeywords)
	{
		group_filter = function(val){return true};
	}
	
	the_table.filterOnSourceHeadings=[].dbPush("Description")
	the_table.filterOnSourceHeadings.dbPush("Group Id")
	the_table.filterValues=[].dbPush(myProgram.myFilterByKeyword)
	the_table.filterValues.dbPush(group_filter)
	
	the_table.targetHeadings=this.inventoryDS.static_part_headings
	this.tempDS.wo_parts_search_grid_list=the_table.prepare()
	
	//Iterate through the grids rows and replace the grid Group Id's with their corresponding group names.
	for(var i = 0; i < this.tempDS.wo_parts_search_grid_list.length; i++)
	{
		//For each row replace the id with the Vendor Name
		var group_id_index = this.inventoryDS.static_part_headings.dbIndexOf("Group Id")
		var group_id = this.tempDS.wo_parts_search_grid_list[i][group_id_index]
		
		var the_locator_recipe=new SUITableCellValueLocatorRecipe({"initialConfigurationName":"generic_table_cell_value_locator"})
		the_locator_recipe.tableRows=this.mainDS.static_part_group_list
		the_locator_recipe.tableHeadings=this.mainDS.static_part_group_headings
		the_locator_recipe.tableLocatorHeading="Group Id"
		the_locator_recipe.tableLocatorFilter=group_id
		the_locator_recipe.tableTargetCellHeading="Group Name"
		var group_name=the_locator_recipe.prepare()
	
		if(group_name != null)this.tempDS.wo_parts_search_grid_list[i][group_id_index] = group_name
	}
	
	the_parts_search_grid.rows=this.tempDS.wo_parts_search_grid_list
	the_parts_search_grid.defaultColumnWidth=null
	the_parts_search_grid.headings=the_table.targetHeadings
	return the_parts_search_grid
}
window.MyRecipe.prototype.myPartsSearchGrid._methodName='myPartsSearchGrid'
window.MyRecipe.prototype.myPartsSearchlimit = function()
{
	if(myProgram.tempDS.wo_parts_search_limit == null)
	{
		myProgram.tempDS.wo_parts_search_limit = 0;
	}
	if(myProgram.tempDS.wo_parts_search_limit == 500)
	{
		return false;
	}
	else
	{
		myProgram.tempDS.wo_parts_search_limit++;
		return true;
	}
}
window.MyRecipe.prototype.myPartsSearchlimit._methodName='myPartsSearchlimit'
window.MyRecipe.prototype.myMaterialGrid = function()
{
	if(this.isWorkOrderCOD())
	{
		return this.myMaterialGridCOD()
	}
	else
	{
		return this.myMaterialGridNonCOD()
	}
}
window.MyRecipe.prototype.myMaterialGrid._methodName='myMaterialGrid'
window.MyRecipe.prototype.myLaborTaxableDefaultValue = function()
{
	if(this.isWorkOrderTaxable())
	{
		var value = this.myTaxableValue("TaxLabor")
		return value.toUpperCase()
	}
	else
	{
		return "N"
	}	
}
window.MyRecipe.prototype.myLaborTaxableDefaultValue._methodName='myLaborTaxableDefaultValue'
window.MyRecipe.prototype.myMaterialTaxableDefaultValue = function()
{
	if(this.isWorkOrderTaxable())
	{
		var value = this.myTaxableValue("TaxMaterial")
		return value.toUpperCase()
	}
	else
	{
		return "N"
	}	
}
window.MyRecipe.prototype.myMaterialTaxableDefaultValue._methodName='myMaterialTaxableDefaultValue'
window.MyRecipe.prototype.myPOPartNumberChangedCodeString = function()
{
	return "function(){myProgram.myPOPartNumberChanged(this)}"
}
window.MyRecipe.prototype.myPOPartNumberChangedCodeString._methodName='myPOPartNumberChangedCodeString'
window.MyRecipe.prototype.myPartNumberChangedCodeString = function()
{
	return "function(){ return myProgram.myPartNumberChanged(this)}"
}
window.MyRecipe.prototype.myPartNumberChangedCodeString._methodName='myPartNumberChangedCodeString'
window.MyRecipe.prototype.myEquipmentDefaultValue = function()
{
	var equipmentItems = this.myEquipmentItems()
	if(equipmentItems.length == 0) return ""
	
	return equipmentItems[0]		
}
window.MyRecipe.prototype.myEquipmentDefaultValue._methodName='myEquipmentDefaultValue'
window.MyRecipe.prototype.myMaterialGridCOD = function()
{
	/*
	2008-04-11 (jc)-[2075]-PO edits
	*/
	var this_recipe=new GUIDataEntryGridRecipe('{"initialConfigurationName":"","finalIngredients":{}}')
	this_recipe.idAttribute="wo_material_"
	this_recipe.gridRecipe = new GUISimpleGridRecipe({"initialConfigurationName":"generic_simple_data_entry_grid","minRowCount":1})
	this_recipe.gridRecipe.gridWidth = 735
	this_recipe.gridRecipe.gridHeight = 300
	this_recipe.gridRecipe.headingDefaultStyle=this_recipe.gridRecipe.headingDefaultStyle+";font-family:arial;color:black;font-size:11; background-color:#7ac98e;border-style:solid;border-color:#676566;border-width:1 1 1 0;padding:1;"
	this_recipe.gridRecipe.cellDefaultStyle=this_recipe.gridRecipe.cellDefaultStyle+";font-size:11;color:black;border-color:#676566;border-width:0 1 1 0;padding:1;font-family:arial;height:20;"
	
	this_recipe.gridRecipe.gridStyle=";border-width:0;"
	this_recipe.gridStyle=";border-width:0;"
	this_recipe.gridRecipe.styleAttribute=";border-width:0;"
	this_recipe.gridRecipe.outerDivBorderWidth="0 0 0 0"//Changed tell Bill
	this_recipe.gridRecipe.scrollingHeight = "0;overflow:scroll;"
	this_recipe.onAddRowDone=function()
		    {
				var the_javascript=function(){myProgram.myRefreshMaterialSummaryGridForFormView()}
				return the_javascript
		    }
	
	this_recipe.alert=false
	this_recipe.breakpointOnPrepare=false

	this_recipe.columnDefaultWidth=100
	
	this_recipe.columnWidths=[43,98,19,140,101,84,51,50,35,54,40,0,0,0,0]
	this_recipe.columnCount=this_recipe.columnWidths.length
	this_recipe.addRowInitialDataValues=this.myInitialRowValuesForMaterialGrid()
	
	this_recipe.headings='myData["grid_headings"]["myMaterialGridCOD"]'
	this_recipe.dataHeadings=this.mainDS.wo_material_headings
	
	this_recipe.inputFieldRecipes = []
	
	this_recipe.inputFieldDefaultRecipe=new GUIInputFieldRecipe({initialConfigurationName:'generic_data_entry_field'})
	this_recipe.inputFieldDefaultRecipe.onchangeAttribute+=';myProgram.myRefreshMaterialSummaryGridForFormView();'
	this_recipe.inputFieldDefaultRecipe.sizeAttribute="11"
	this_recipe.inputFieldDefaultRecipe.styleAttribute=";border:0 px solid grey;background-color:white;font-size:11;"
	
	var partNumberInputRecipe = new GUIInputFieldRecipe({initialConfigurationName:'generic_data_entry_field'})
	//partNumberInputRecipe.oncontextmenuAttribute = __('myPartNumberContextMenuCodeString')
	partNumberInputRecipe.myischangeokAttribute = __('myPartNumberChangedCodeString')
	partNumberInputRecipe.styleAttribute=";border:0 px solid grey;background-color:white;font-size:11;width:93"
	partNumberInputRecipe.onchangeAttribute+=';myProgram.myRefreshMaterialSummaryGridForFormView();'
	this_recipe.inputFieldRecipes[1] = partNumberInputRecipe
	
	var quantityInputRecipe = new GUIInputFieldRecipe({initialConfigurationName:'generic_data_entry_field'})
	quantityInputRecipe.myischangeokAttribute = __('myQuantityFieldHasChangedCodeString')
	this_recipe.inputFieldRecipes[0] = quantityInputRecipe
	quantityInputRecipe.onchangeAttribute+=';myProgram.myRefreshMaterialSummaryGridForFormView();'
	quantityInputRecipe.styleAttribute=";border:0 px solid grey;background-color:white;font-size:11;"
	
	//2008-04-11 (jc)-[2075]
	var equipmentIdInputRecipe = sysFunctions.cloneObject(this_recipe.inputFieldDefaultRecipe)
	equipmentIdInputRecipe.myischangeokAttribute = __('myGenericMaterialOtherOnChangeCodeString')
	this_recipe.inputFieldRecipes[4] = equipmentIdInputRecipe
	
	//2008-04-11 (jc)-[2075]
	var locationIdInputRecipe = sysFunctions.cloneObject(this_recipe.inputFieldDefaultRecipe)
	locationIdInputRecipe.myischangeokAttribute = __('myGenericMaterialOtherOnChangeCodeString')
	this_recipe.inputFieldRecipes[5] = locationIdInputRecipe
	
	var unitPriceInputRecipe = new GUIInputFieldRecipe({initialConfigurationName:'generic_text_input_field'})
	unitPriceInputRecipe.myischangeokAttribute = __('myUnitPriceHasChangedCodeString')
	unitPriceInputRecipe.styleAttribute=";border:0 px solid grey;background-color:white;font-size:11;"
	this_recipe.inputFieldRecipes[7] = unitPriceInputRecipe
	
	var billQtyInputRecipe = new GUIInputFieldRecipe({initialConfigurationName:'generic_text_input_field'})
	billQtyInputRecipe.myischangeokAttribute = __('myBillQuantityHasChangedCodeString')
	billQtyInputRecipe.styleAttribute=";border:0 px solid grey;background-color:white;font-size:11;"
	this_recipe.inputFieldRecipes[8] = billQtyInputRecipe
	
	var descriptionInputRecipe = new GUIInputFieldRecipe({initialConfigurationName:'generic_text_input_field'})
	descriptionInputRecipe.disabledAttribute = true
	descriptionInputRecipe.styleAttribute=";border:0 px solid grey;background-color:white;color:black;font-size:11;"
	this_recipe.inputFieldRecipes[3] = descriptionInputRecipe
	this_recipe.inputFieldRecipes[6] = descriptionInputRecipe
	this_recipe.inputFieldRecipes[11] = descriptionInputRecipe
	this_recipe.inputFieldRecipes[12] = descriptionInputRecipe
	this_recipe.inputFieldRecipes[13] = descriptionInputRecipe
	this_recipe.inputFieldRecipes[14] = descriptionInputRecipe
	
	descriptionInputRecipe.onchangeAttribute+=';myProgram.myRefreshMaterialSummaryGridForFormView();'
	
	var priceInputRecipe = new GUIInputFieldRecipe({initialConfigurationName:'generic_text_input_field'})
	priceInputRecipe.disabledAttribute = true
	priceInputRecipe.styleAttribute=";border:0 px solid grey;background-color:white;color:black;font-size:11;"
	this_recipe.inputFieldRecipes[9] = priceInputRecipe
	
	if(this.isWorkOrderTaxable())
	{
		var taxableFormat = {format:"list",items:__("myTaxableItems")}
		//2008-04-11 (jc)-[2075]
		var taxableInputRecipe = sysFunctions.cloneObject(this_recipe.inputFieldDefaultRecipe)
		taxableInputRecipe.myischangeokAttribute = __('myGenericMaterialOtherOnChangeCodeString')
		this_recipe.inputFieldRecipes[10] = taxableInputRecipe
	}
	else
	{
		var taxableFormat = {format:"text",length:30}
		var taxableInputRecipe = new GUIInputFieldRecipe({initialConfigurationName:'generic_text_input_field'})
		taxableInputRecipe.disabledAttribute = true
		taxableInputRecipe.styleAttribute=";border:0 px solid grey;background-color:white;color:black;font-size:11;"
		this_recipe.inputFieldRecipes[10] = taxableInputRecipe
	}
	
	this_recipe.rows=this.myMaterialGridRows()
	this_recipe.dataRows='myProgram.mainDS.wo_material_list'
	this_recipe.joinColumnName='RN'
	this_recipe.formats=[{format:"number",scale:6,precision:2},
						{format:"list",items:__("myPartNumberItems")},
						{format:""},
						{format:"text"},
						{format:"list",items:__("myEquipmentItems")},
						{format:"list",items:__("myLocationIdItems")},
						{format:"text"},
						{format:"number",scale:10,precision:2},
						{format:"number",scale:6,precision:2},
						{format:"number",scale:10,precision:2},
						taxableFormat,
						{format:"text"},
						{format:"text"},
						{format:"text"},
						{format:"text"}]
						
	var listDefaultRecipe = new GUIListRecipe({initialConfigurationName:"constraint_list"})
	listDefaultRecipe.listItemStyle+=";color:black;font-family:arial;background-color:white;font-size:11;"
	listDefaultRecipe.selectedBackgroundColor="gray"
	listDefaultRecipe.mouseOverBackgroundColor="#316ac5"
	//listDefaultRecipe.breakpointOnPrepare=true
	this_recipe.listDefaultRecipe = listDefaultRecipe
	
	this_recipe.divTagDefaultRecipe=new GUIDivTagRecipe({"initialConfigurationName":"default_data_entry_div_tag"})
	this_recipe.divTagDefaultRecipe.styleAttribute=";width:16;height:16;background-color:white;text-align:center;vertical-align:middle;padding-top:2;cursor:pointer;"
	this_recipe.divTagDefaultRecipe.onclickAttribute="myProgram.myPartLookup(this)"
	
	return this_recipe
}
window.MyRecipe.prototype.myMaterialGridCOD._methodName='myMaterialGridCOD'
window.MyRecipe.prototype.myPOQuantityFieldHasChangedCodeString = function()
{
	return "function(){return myProgram.myPOQuantityFieldHasChanged(this)}"
}
window.MyRecipe.prototype.myPOQuantityFieldHasChangedCodeString._methodName='myPOQuantityFieldHasChangedCodeString'
window.MyRecipe.prototype.descriptionChangedCodeString = function()
{
	return "function(){return myProgram.myOtherDescriptionFieldHasChanged(this)}"
}
window.MyRecipe.prototype.descriptionChangedCodeString._methodName='descriptionChangedCodeString'
window.MyRecipe.prototype.myQuantityFieldHasChangedCodeString = function()
{
	return "function(){return myProgram.myQuantityFieldHasChanged(this)}"
}
window.MyRecipe.prototype.myQuantityFieldHasChangedCodeString._methodName='myQuantityFieldHasChangedCodeString'
window.MyRecipe.prototype.myPartNumberItems = function()
{
	var the_rows_recipe=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'});
	the_rows_recipe.filterValues=[].dbPush(myProgram.mainDS.current_workorder_id);
	the_rows_recipe.filterOnSourceHeadings=[].dbPush(myProgram.mainDS.wo_id_heading);
	the_rows_recipe.sourceRows=this.inventoryDS["static_part_list"]
	the_rows_recipe.sourceHeadings=myProgram.inventoryDS.static_part_headings;
	the_rows_recipe.targetHeadings=[].dbPush("Part Number");
	the_rows_recipe.sortOnSourceHeadings=[];
	return the_rows_recipe.prepare();
}
window.MyRecipe.prototype.myPartNumberItems._methodName='myPartNumberItems'
window.MyRecipe.prototype.myLocationIdDefaultValue = function()
{
	var index = this.mainDS.tech_info_headings.dbIndexOf("tech_location_id")
	return this.mainDS.tech_info_list[0][index]
}
window.MyRecipe.prototype.myLocationIdDefaultValue._methodName='myLocationIdDefaultValue'
window.MyRecipe.prototype.myLocationIdItems = function()
{
	var the_rows_recipe=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'});
	the_rows_recipe.sourceRows=this.mainDS.static_location_list;
	the_rows_recipe.sourceHeadings=myProgram.mainDS.static_location_headings;
	the_rows_recipe.targetHeadings=[].dbPush("Location Id");
	the_rows_recipe.sortOnSourceHeadings=[];

	return the_rows_recipe.prepare();
}
window.MyRecipe.prototype.myLocationIdItems._methodName='myLocationIdItems'
window.MyRecipe.prototype.myPOOtherGridRows = function()//if(this.tempDS.wo_po_material_list == null) this.tempDS.wo_po_material_list = []
{
	var the_table=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'})
	if(this.tempDS.wo_po_other_list == null) this.tempDS.wo_po_other_list = []
	the_table.sourceRows=this.tempDS.wo_po_other_list
	the_table.sourceHeadings=this.mainDS.wo_po_other_headings
	the_table.filterOnSourceHeadings=[].dbPush(this.mainDS.wo_id_heading)
	the_table.filterValues=[].dbPush(this.mainDS.current_workorder_id)
	the_table.sortOnSourceHeadings=[].dbPush(this.mainDS.wo_id_heading)
	the_table.targetHeadings=myData["grid_headings"]["myPOOtherGrid"]
	this.tempDS.wo_po_other_grid_list=the_table.prepare()
	
	return 'myProgram.tempDS.wo_po_other_grid_list'
}
window.MyRecipe.prototype.myPOOtherGridRows._methodName='myPOOtherGridRows'
window.MyRecipe.prototype.myPOMaterialGridRows = function()
{
	var the_table=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'})
	if(this.tempDS.wo_po_material_list == null) this.tempDS.wo_po_material_list = []
	the_table.sourceRows=this.tempDS.wo_po_material_list
	the_table.sourceHeadings=this.mainDS.wo_po_material_headings
	the_table.filterOnSourceHeadings=[].dbPush(this.mainDS.wo_id_heading)
	the_table.filterValues=[].dbPush(this.mainDS.current_workorder_id)
	the_table.sortOnSourceHeadings=[].dbPush(this.mainDS.wo_id_heading)
	the_table.targetHeadings=myData["grid_headings"]["myPOMaterialGrid"]
	var tempRows = the_table.prepare()
	
	for(var rowIndex = 0; rowIndex < tempRows.length; rowIndex++)
	{
		var row = tempRows[rowIndex]
		var first = row.shift()
		var second = row.shift()
		row.unshift(myProgram.myLookupImage())
		row.unshift(second)
		row.unshift(first)
		tempRows[rowIndex] = row
	}
	myProgram.tempDS.wo_po_material_grid_list = tempRows
	return 'myProgram.tempDS.wo_po_material_grid_list'
}
window.MyRecipe.prototype.myPOMaterialGridRows._methodName='myPOMaterialGridRows'
window.MyRecipe.prototype.myMaterialGridRows = function()
{
	if(this.isWorkOrderCOD())
	{
		var targetHeadings = myData["grid_headings"]["myMaterialGridCOD"]
	}
	else
	{
		var targetHeadings = myData["grid_headings"]["myMaterialGridNonCOD"]
	}
	var the_table=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'})
	the_table.sourceRows=this.mainDS.wo_material_list
	the_table.sourceHeadings=this.mainDS.wo_material_headings
	the_table.filterOnSourceHeadings=[].dbPush(this.mainDS.wo_id_heading).dbPush("Transmitted")
	the_table.filterValues=[].dbPush(this.mainDS.current_workorder_id).dbPush(function(val){return(val.value!="deleted")})
	the_table.sortOnSourceHeadings=[].dbPush(this.mainDS.wo_id_heading)
	the_table.targetHeadings=targetHeadings
	var tempRows = the_table.prepare()
	
	for(var rowIndex = 0; rowIndex < tempRows.length; rowIndex++)
	{
		var row = tempRows[rowIndex]
		var first = row.shift()
		var second = row.shift()
		row.unshift(myProgram.myLookupImage())
		row.unshift(second)
		row.unshift(first)
		tempRows[rowIndex] = row
	}
	
	myProgram.tempDS.wo_material_grid_list = tempRows
	
	return 'myProgram.tempDS.wo_material_grid_list'
}
window.MyRecipe.prototype.myMaterialGridRows._methodName='myMaterialGridRows'
window.MyRecipe.prototype.myAddTaskDescriptionToWorkPerformed = function()
{
	var taskDescription = sysFunctions.locateAdjacentColumnInputNode(event.srcElement.parentElement, "Task Description").value.trim()
	var textToAppend = myProgram.myGetWorkPerformed(this.mainDS.current_workorder_id, this.mainDS.current_equipment_id)+taskDescription+"\r\n";
	myProgram.mySetWorkPerformed(myProgram.mainDS.current_workorder_id, myProgram.mainDS.current_equipment_id, textToAppend)
	myProgram.myRefreshWorkPerformedGrid()
}
window.MyRecipe.prototype.myAddTaskDescriptionToWorkPerformed._methodName='myAddTaskDescriptionToWorkPerformed'
window.MyRecipe.prototype.myAddPMPartToMaterial = function()
{
	if(!myProgram.checkIfAllowedToAddEditMaterial()) return false
	
	var quantity = sysFunctions.locateAdjacentColumnInputNode(event.srcElement.parentElement, "Quantity").value.trim()//event.srcElement.parentNode.parentNode.parentNode.myinputobject
	var partNumber = sysFunctions.locateAdjacentColumnInputNode(event.srcElement.parentElement, "Part Number").value.trim()
	var partDescription = sysFunctions.locateAdjacentColumnInputNode(event.srcElement.parentElement, "Part Description").value.trim()
	var equipmenId = this.mainDS.current_equipment_id
	
	var materialDefaultValues = myProgram.myInitialRowValuesForMaterialGrid()
	materialDefaultValues["RN"] = myProgram.myNextRN()
	materialDefaultValues["Quantity"] = quantity
	materialDefaultValues["BillQty"] = quantity
	materialDefaultValues["Part Number"] = partNumber
	materialDefaultValues["Description"] = partDescription
	materialDefaultValues["Equipment Id"] = equipmenId
	materialDefaultValues["Unit Cost"] = myProgram.getUnitCostForPartNumber(partNumber)
	materialDefaultValues["Unit Price"]=myProgram.calculateUnitPriceForPartNumber(partNumber)
	materialDefaultValues["Price"]=(materialDefaultValues["Unit Price"]*materialDefaultValues["BillQty"]).toFixed(2)
	
	var the_row=myProgram.mainDS.wo_material_headings.dbCreateRow(materialDefaultValues, "wo_material")
	myProgram.mainDS.wo_material_list.dbPush(the_row)
	return true
}
window.MyRecipe.prototype.myAddPMPartToMaterial._methodName='myAddPMPartToMaterial'
window.MyRecipe.prototype.myPartLookup = function()
{
	var inputFieldElement = sysFunctions.locateAdjacentColumnInputNode(event.srcElement.parentElement, "Part Number")//event.srcElement.parentNode.parentNode.parentNode.myinputobject
	if(myProgram.isElementPartOfPO(inputFieldElement))
	{
		alert("[Ref Code:6] This material item is part of a purchase order and cannot be changed")
		return
	}
	myProgram.myPartNumberChooser(inputFieldElement)
}
window.MyRecipe.prototype.myPartLookup._methodName='myPartLookup'
window.MyRecipe.prototype.myIsLookupClick = function()
{
	var newValue = event.srcElement.innerText
	
	if(newValue.trim().toLowerCase() == "lookup")
	{
		var inputFieldElement = event.srcElement.parentNode.parentNode.parentNode.myinputobject
		myProgram.myPartNumberChooser(inputFieldElement)
		return true
	}
	else
	{
		return false
	}
	
}
window.MyRecipe.prototype.myIsLookupClick._methodName='myIsLookupClick'
window.MyRecipe.prototype.myMaterialGridNonCOD = function()
{
	/*
	2008-04-11 (jc)-[2075]-PO Edits
	*/
	var this_recipe=new GUIDataEntryGridRecipe('{"initialConfigurationName":"","finalIngredients":{}}')
	this_recipe.idAttribute="wo_material_"
	this_recipe.gridRecipe = new GUISimpleGridRecipe({"initialConfigurationName":"generic_simple_data_entry_grid","minRowCount":1})
	this_recipe.gridRecipe.gridWidth = 623
	this_recipe.gridRecipe.gridHeight = 300
	this_recipe.gridRecipe.headingDefaultStyle=this_recipe.gridRecipe.headingDefaultStyle+";font-family:arial;color:black;font-size:11; background-color:#7ac98e;border-style:solid;border-color:#676566;border-width:1 1 1 0;padding:1;"
	this_recipe.gridRecipe.cellDefaultStyle=this_recipe.gridRecipe.cellDefaultStyle+";font-size:11;color:black;border-color:#676566;border-width:0 1 1 0;padding:1;font-family:arial;height:20;"
	
	//this_recipe.gridRecipe.cellStyles[2]=this_recipe.gridRecipe.cellDefaultStyle+";padding:0;width:16;text-align:center;vertical-align:center;background-color:red;border:none;"
	
	this_recipe.gridRecipe.gridStyle=";border-width:0;"
	this_recipe.gridStyle=";border-width:0;"
	this_recipe.gridRecipe.styleAttribute=";border-width:0;"
	this_recipe.gridRecipe.outerDivBorderWidth="0 0 0 0"//Changed tell Bill
	this_recipe.gridRecipe.scrollingHeight = "0;overflow:scroll;"
	this_recipe.onAddRowDone=function()
		    {
				var the_javascript=function(){myProgram.myRefreshMaterialSummaryGridForFormView()}
				return the_javascript
		    }
	this_recipe.alert=false
	this_recipe.gridRecipe.breakpointOnPrepare=false

	this_recipe.columnDefaultWidth=100
	this_recipe.columnWidths=[45,110,18,155,110,110,55,0,0,0,0,0,0]
	this_recipe.columnCount=this_recipe.columnWidths.length
	
	this_recipe.addRowInitialDataValues=this.myInitialRowValuesForMaterialGrid()
	
	this_recipe.headings='myData["grid_headings"]["myMaterialGridNonCOD"]'
	this_recipe.dataHeadings=this.mainDS.wo_material_headings
	
	this_recipe.inputFieldRecipes = []
	
	this_recipe.inputFieldDefaultRecipe=new GUIInputFieldRecipe({initialConfigurationName:'generic_data_entry_field'})
	this_recipe.inputFieldDefaultRecipe.onchangeAttribute+=';myProgram.myRefreshMaterialSummaryGridForFormView();'
	this_recipe.inputFieldDefaultRecipe.sizeAttribute="11"
	this_recipe.inputFieldDefaultRecipe.styleAttribute=";border:0 px solid grey;background-color:white;font-size:11;"
	
	var quantityInputRecipe = new GUIInputFieldRecipe({initialConfigurationName:'generic_data_entry_field'})
	quantityInputRecipe.myischangeokAttribute = __('myQuantityFieldHasChangedCodeString')
	this_recipe.inputFieldRecipes[0] = quantityInputRecipe
	quantityInputRecipe.onchangeAttribute+=';myProgram.myRefreshMaterialSummaryGridForFormView();'
	quantityInputRecipe.styleAttribute=";border:0 px solid grey;background-color:white;font-size:11;"
	
	//2008-04-11 (jc)-[2075]
	var equipmentIdInputRecipe = sysFunctions.cloneObject(this_recipe.inputFieldDefaultRecipe)
	equipmentIdInputRecipe.myischangeokAttribute = __('myGenericMaterialOtherOnChangeCodeString')
	this_recipe.inputFieldRecipes[4] = equipmentIdInputRecipe
	
	//2008-04-11 (jc)-[2075]
	var locationIdInputRecipe = sysFunctions.cloneObject(this_recipe.inputFieldDefaultRecipe)
	locationIdInputRecipe.myischangeokAttribute = __('myGenericMaterialOtherOnChangeCodeString')
	this_recipe.inputFieldRecipes[5] = locationIdInputRecipe
	
	var descriptionInputRecipe = new GUIInputFieldRecipe({initialConfigurationName:'generic_text_input_field'})
	descriptionInputRecipe.disabledAttribute = true
	descriptionInputRecipe.styleAttribute=";border:0 px solid grey;background-color:white;color:black;font-size:11;"
	this_recipe.inputFieldRecipes[3] = descriptionInputRecipe
	this_recipe.inputFieldRecipes[6] = descriptionInputRecipe//PO# Column
	this_recipe.inputFieldRecipes[7] = descriptionInputRecipe//RN Column
	this_recipe.inputFieldRecipes[8] = descriptionInputRecipe
	this_recipe.inputFieldRecipes[9] = descriptionInputRecipe
	this_recipe.inputFieldRecipes[10] = descriptionInputRecipe
	this_recipe.inputFieldRecipes[11] = descriptionInputRecipe
	this_recipe.inputFieldRecipes[12] = descriptionInputRecipe
	
	descriptionInputRecipe.onchangeAttribute+=';myProgram.myRefreshMaterialSummaryGridForFormView();'
	
	var partNumberInputRecipe = new GUIInputFieldRecipe({initialConfigurationName:'generic_data_entry_field'})
	//partNumberInputRecipe.oncontextmenuAttribute = __('myPartNumberContextMenuCodeString')
	partNumberInputRecipe.myischangeokAttribute = __('myPartNumberChangedCodeString')
	partNumberInputRecipe.styleAttribute=";border:0 px solid grey;background-color:white;font-size:11;width:93"
	partNumberInputRecipe.onchangeAttribute+=';myProgram.myRefreshMaterialSummaryGridForFormView();'
	this_recipe.inputFieldRecipes[1] = partNumberInputRecipe
	
	this_recipe.rows=this.myMaterialGridRows()
	this_recipe.dataRows='myProgram.mainDS.wo_material_list'
	this_recipe.joinColumnName='RN'
	
	this_recipe.formats=[{format:"number",scale:6,precision:2},
						{format:"list",items:__("myPartNumberItems")},
						{format:""},
						{format:"text"},
						{format:"list",items:__("myEquipmentItems")},
						{format:"list",items:__("myLocationIdItems")},
						{format:"text"},
						{format:"text"},
						{format:"text"},
						{format:"text"},
						{format:"text"},
						{format:"text"},
						{format:"text"}]
	
	var listDefaultRecipe = new GUIListRecipe({initialConfigurationName:"constraint_list"})
	listDefaultRecipe.listItemStyle+=";color:black;font-family:arial;background-color:white;font-size:11;"
	listDefaultRecipe.selectedBackgroundColor="gray"
	listDefaultRecipe.mouseOverBackgroundColor="#316ac5"
	//listDefaultRecipe.breakpointOnPrepare=true
	this_recipe.listDefaultRecipe = listDefaultRecipe
	
	this_recipe.divTagDefaultRecipe=new GUIDivTagRecipe({"initialConfigurationName":"default_data_entry_div_tag"})
	this_recipe.divTagDefaultRecipe.styleAttribute=";width:16;height:16;background-color:white;text-align:center;vertical-align:middle;padding-top:2;cursor:pointer;"
	this_recipe.divTagDefaultRecipe.onclickAttribute="myProgram.myPartLookup(this)"
	this_recipe.alert=false
	return this_recipe	
}
window.MyRecipe.prototype.myMaterialGridNonCOD._methodName='myMaterialGridNonCOD'
window.MyRecipe.prototype.myMaterialGridNonCODOBSOLETE = function()
{
	var the_material_grid=new GUISimpleGridRecipe('{"initialConfigurationName":"generic_simple_grid",minRowCount:5}')
	the_material_grid.scrollingHeight=100
	the_material_grid.columnWidths=[40,100,100,100,100,100]
	the_material_grid.columnCount=7
	the_material_grid.disallowEditTransmittedAttribute = true
	the_row_numbers_string='{"rn_heading":"Line","rn_width":75,\
			"rn_cell_on_click":"myProgram.myNewPage(\'edit_material_page\',\'_row_number_\',\'_column_number_\')",\
			"rn_cell_on_click_template":"_cell_contents_\
			<a id=\\\"material_line__cell_contents_\\\" href=#abc onclick=\\\"myProgram.myDeleteItem(\'_grid_id_\',\'_row_number_\',\'_column_number_\')\\\" >\
				<img src=\'mydeleteitem.gif\' alt=\'Delete Row\' style=\'border-width:1;vertical-align:bottom\'></a>"\
			}'
	the_material_grid.addRowNumbers=the_row_numbers_string
	the_material_grid.idAttribute='wo_material_'
	the_material_grid.alert=false
	the_material_grid.cellOnClickDefault="myProgram.myEditControl('_cell_escaped_contents_','_grid_id_','_cell_id_','_heading_contents_','_row_number_','_column_number_')"
	var the_table=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'})
	the_table.sourceRows=this.mainDS.wo_material_list
	the_table.sourceHeadings=this.mainDS.wo_material_headings
	the_table.filterOnSourceHeadings=[].dbPush(this.mainDS.wo_id_heading).dbPush("Transmitted")
	the_table.filterValues=[].dbPush(this.mainDS.current_workorder_id).dbPush(function(val){return(val.value!="deleted")})
	the_table.sortOnSourceHeadings=[].dbPush(this.mainDS.wo_id_heading)
	the_table.targetHeadings=this.mainDS.wo_material_grid_headings=["Quantity","Part Number","Description","Equipment Id","Location Id","PO#","Transmitted","RN"]
	this.tempDS.wo_material_grid_list=the_table.prepare()
	the_material_grid.rows=this.tempDS.wo_material_grid_list
	the_material_grid.defaultColumnWidth=null
	the_material_grid.headings=the_table.targetHeadings
//	the_labor_grid.cellOnClick=["myProgram.myNewPage('edit_labor_page','_row_number_','_column_number_')"]
	return the_material_grid
}
window.MyRecipe.prototype.myMaterialGridNonCODOBSOLETE._methodName='myMaterialGridNonCODOBSOLETE'
window.MyRecipe.prototype.myDefaultPurchaseOrderNumber = function()
{
	if(this.tempDS.current_edit_po_row != null)
	{
		var index = this.mainDS.wo_po_headings.dbIndexOf("PO#");
		return this.tempDS.current_edit_po_row[index]
	}
	else
	{
		return this.mainDS.current_po_number
	}	
}
window.MyRecipe.prototype.myDefaultPurchaseOrderNumber._methodName='myDefaultPurchaseOrderNumber'
window.MyRecipe.prototype.myDefaultUnitCostForMaterial = function()
{
	if(myProgram.inventoryDS.static_part_list == null) return ""
	if(myProgram.inventoryDS.static_part_list.length < 1) return ""
	
	var partNumberIndex = myProgram.inventoryDS.static_part_headings.dbIndexOf("Part Number")
	
	return myProgram.getUnitCostForPartNumber(myProgram.inventoryDS.static_part_list[0][partNumberIndex])	
}
window.MyRecipe.prototype.myDefaultUnitCostForMaterial._methodName='myDefaultUnitCostForMaterial'
window.MyRecipe.prototype.myPOOtherGrid = function()
{
	var this_recipe=new GUIDataEntryGridRecipe('{"initialConfigurationName":"","finalIngredients":{}}')
	this_recipe.idAttribute="wo_po_other_"
	this_recipe.gridRecipe = new GUISimpleGridRecipe({"initialConfigurationName":"generic_simple_data_entry_grid","minRowCount":3})
	
	myProgram.myConfigureLookForSecondLayerGrid(this_recipe.gridRecipe)
	//the_code_textarea_contents=sysFunctions.functionTextArea(GUIDataEntryGridRecipe,'recipe')
	//the_code_textarea2_contents=sysFunctions.functionTextArea(GUIDataEntryGridRecipe.prototype.prepare,'prepare')
	this_recipe.alert=false
	this_recipe.gridRecipe.breakpointOnPrepare=false
	this_recipe.gridRecipe.gridHeight=150
	this_recipe.columnDefaultWidth=100
	
	this_recipe.columnWidths=[45,110,255,110,110,0,0,0,0,0,0]
	this_recipe.columnCount=this_recipe.columnWidths.length
	
	this_recipe.addRowInitialDataValues={"Quantity":1,
										"Transmitted":"n",
										"BillQty":1,
										"POQty":1,
										"PO#":myProgram.myDefaultPurchaseOrderNumber(),
										"Other Rate Id":this.getFirstOtherRateId(),
										"Other Rate Description":this.getOtherRateDescriptionForId(this.getFirstOtherRateId()),
										"Equipment Id":this.myFirstEquipmentIdForWorkOrderId(this.mainDS.current_workorder_id),
										"Work Order Id":this.mainDS.current_workorder_id,
										"Unit Cost":this.getUnitCostForOtherRateId(this.getFirstOtherRateId())}
	
	
	myProgram.configureGridWidthFromColumnWidths(this_recipe)
	
	this_recipe.headings='myData["grid_headings"]["myPOOtherGrid"]'
	this_recipe.dataHeadings=myProgram.mainDS.wo_po_other_headings
	
	this_recipe.inputFieldRecipes = []
	
	var unitCostInputRecipe = new GUIInputFieldRecipe({initialConfigurationName:'generic_data_entry_field'})
	unitCostInputRecipe.styleAttribute=";border:0 px solid grey;background-color:white;font-size:11;"
	this_recipe.inputFieldRecipes[4] = unitCostInputRecipe
	
	var descriptionInputRecipe = new GUIInputFieldRecipe({initialConfigurationName:'generic_data_entry_field'})
	descriptionInputRecipe.disabledAttribute = true
	descriptionInputRecipe.styleAttribute=";border:0 px solid grey;background-color:white;color:black;width:254;font-size:11;"
	this_recipe.inputFieldRecipes[2] = descriptionInputRecipe
	this_recipe.inputFieldRecipes[5] = descriptionInputRecipe//PO# Column
	this_recipe.inputFieldRecipes[6] = descriptionInputRecipe//RN Column
	this_recipe.inputFieldRecipes[7] = descriptionInputRecipe//Transmitted Column
	this_recipe.inputFieldRecipes[8] = descriptionInputRecipe//Transmitted Column
	this_recipe.inputFieldRecipes[9] = descriptionInputRecipe//Transmitted Column
	this_recipe.inputFieldRecipes[10] = descriptionInputRecipe//POQty
	this_recipe.inputFieldRecipes[11] = descriptionInputRecipe//BillQty
	
	var otherRateIdInputRecipe = new GUIInputFieldRecipe({initialConfigurationName:'generic_text_input_field'})
	otherRateIdInputRecipe.myischangeokAttribute = __('updatePOOtherRateDescriptionCodeString')
	otherRateIdInputRecipe.styleAttribute=";border:0 px solid grey;background-color:white;font-size:11;"
	this_recipe.inputFieldRecipes[1] = otherRateIdInputRecipe
	
	var quantityInputRecipe = new GUIInputFieldRecipe({initialConfigurationName:'generic_text_input_field'})
	quantityInputRecipe.myischangeokAttribute = __('myPOQuantityFieldHasChangedCodeString')
	quantityInputRecipe.styleAttribute=";border:0 px solid grey;background-color:white;font-size:11;"
	this_recipe.inputFieldRecipes[0] = quantityInputRecipe
	
	var equipInputRecipe = new GUIInputFieldRecipe({initialConfigurationName:'generic_text_input_field'})
	equipInputRecipe.styleAttribute=";border:0 px solid grey;background-color:white;width:75;font-size:11;"
	this_recipe.inputFieldRecipes[3] = equipInputRecipe
	
	this_recipe.rows=myProgram.myPOOtherGridRows()
	this_recipe.dataRows='myProgram.tempDS.wo_po_other_list'
	this_recipe.joinColumnName='RN'
	this_recipe.formats=[{format:"number",scale:6,precision:2},
						{format:"list",items:__("myOtherRateItems")},
						{format:"text",length:60},
						{format:"list",items:__("myEquipmentItems")},
						{format:"text",length:30},
						{format:""},
						{format:""},
						{format:"text"},
						{format:"text"},
						{format:"text"},
						{format:"text"}]
	this_recipe.listDefaultRecipe=myProgram.myGetDefaultListRecipe()
	return this_recipe	
}
window.MyRecipe.prototype.myPOOtherGrid._methodName='myPOOtherGrid'
window.MyRecipe.prototype.myGetDefaultListRecipe = function()
{
	var listDefaultRecipe = new GUIListRecipe({initialConfigurationName:"constraint_list"})
	listDefaultRecipe.listItemStyle+=";color:black;font-family:arial;background-color:white;font-size:11;"
	listDefaultRecipe.selectedBackgroundColor="gray"
	listDefaultRecipe.mouseOverBackgroundColor="#316ac5"
	return listDefaultRecipe
}
window.MyRecipe.prototype.myGetDefaultListRecipe._methodName='myGetDefaultListRecipe'
window.MyRecipe.prototype.myConfigureLookForSecondLayerGrid = function(/*GUISimpleGridRecipe*/ gridRecipe)
{
	gridRecipe.headingDefaultStyle=gridRecipe.headingDefaultStyle+";font-family:arial;color:black;font-size:11; background-color:#7ac98e;border-style:solid;border-color:#676566;border-width:1 1 1 0;padding:1;"
	gridRecipe.cellDefaultStyle=gridRecipe.cellDefaultStyle+";font-size:11;color:black;border-color:#676566;border-width:0 1 1 0;padding:1;font-family:arial;height:20;"
	gridRecipe.gridStyle=";border-width:0;"
	gridRecipe.styleAttribute=";border-width:0;"
	gridRecipe.outerDivBorderWidth="0 0 0 0"//Changed tell Bill
	gridRecipe.scrollingHeight = "0;overflow:scroll;"
}
window.MyRecipe.prototype.myConfigureLookForSecondLayerGrid._methodName='myConfigureLookForSecondLayerGrid'
window.MyRecipe.prototype.configureGridWidthFromColumnWidths = function(/*GUISimpleGridRecipe*/ this_recipe)
{
	this_recipe.gridRecipe.gridWidth = 0
	for(var i = 0; i < this_recipe.columnWidths.length; i++)
	{
		this_recipe.gridRecipe.gridWidth += this_recipe.columnWidths[i]
	}
	this_recipe.gridRecipe.gridWidth += 20;
}
window.MyRecipe.prototype.configureGridWidthFromColumnWidths._methodName='configureGridWidthFromColumnWidths'
window.MyRecipe.prototype.myPOMaterialGrid = function()
{
	var this_recipe=new GUIDataEntryGridRecipe('{"initialConfigurationName":"","finalIngredients":{}}')
	this_recipe.idAttribute="wo_po_material_"
	this_recipe.gridRecipe = new GUISimpleGridRecipe({"initialConfigurationName":"generic_simple_data_entry_grid","minRowCount":3})
	
	myProgram.myConfigureLookForSecondLayerGrid(this_recipe.gridRecipe)
	
	this_recipe.gridRecipe.gridHeight=150
	
	this_recipe.gridStyle=";border-width:0;"
	this_recipe.columnDefaultWidth=100
	

	this_recipe.columnWidths=[45,110,18,237,110,110,0,0,0,0,0,0]
	this_recipe.columnCount=this_recipe.columnWidths.length
	
	myProgram.configureGridWidthFromColumnWidths(this_recipe)
	
	this_recipe.addRowInitialDataValues=this.myInitialRowValuesForMaterialGrid()
	this_recipe.addRowInitialDataValues["PO#"]=this.myDefaultPurchaseOrderNumber()
	this_recipe.headings='myData["grid_headings"]["myPOMaterialGrid"]'
	
	this_recipe.dataHeadings=this.mainDS.wo_po_material_headings
	
	this_recipe.inputFieldRecipes = []
	
	this_recipe.inputFieldDefaultRecipe=new GUIInputFieldRecipe({initialConfigurationName:'generic_text_input_field'})
	this_recipe.inputFieldDefaultRecipe.sizeAttribute="11"
	this_recipe.inputFieldDefaultRecipe.styleAttribute=";border:0 px solid grey;background-color:white;font-size:11;"
	
	var quantityInputRecipe = new GUIInputFieldRecipe({initialConfigurationName:'generic_data_entry_field'})
	quantityInputRecipe.myischangeokAttribute = __('myPOQuantityFieldHasChangedCodeString')
	quantityInputRecipe.styleAttribute=";border:0 px solid grey;background-color:white;font-size:11;"
	this_recipe.inputFieldRecipes[0] = quantityInputRecipe
	
	var unitCostInputRecipe = new GUIInputFieldRecipe({initialConfigurationName:'generic_data_entry_field'})
	unitCostInputRecipe.styleAttribute=";border:0 px solid grey;background-color:white;font-size:11;"
	this_recipe.inputFieldRecipes[5] = unitCostInputRecipe
	
	var descriptionInputRecipe = new GUIInputFieldRecipe({initialConfigurationName:'generic_data_entry_field'})
	descriptionInputRecipe.disabledAttribute = true
	descriptionInputRecipe.styleAttribute=";border:0 px solid grey;background-color:white;color:black;width:254;font-size:11;"
	this_recipe.inputFieldRecipes[3] = descriptionInputRecipe
	
	this_recipe.inputFieldRecipes[6] = descriptionInputRecipe//PO# Column
	this_recipe.inputFieldRecipes[7] = descriptionInputRecipe//RN Column
	this_recipe.inputFieldRecipes[8] = descriptionInputRecipe//Transmitted Column
	this_recipe.inputFieldRecipes[9] = descriptionInputRecipe//Transmitted Column
	this_recipe.inputFieldRecipes[10] = descriptionInputRecipe//POQty Column
	this_recipe.inputFieldRecipes[11] = descriptionInputRecipe//BillQty Column
	
	var partNumberInputRecipe = new GUIInputFieldRecipe({initialConfigurationName:'generic_data_entry_field'})
	partNumberInputRecipe.oncontextmenuAttribute = __('myPartNumberContextMenuCodeString')
	partNumberInputRecipe.myischangeokAttribute = __('myPOPartNumberChangedCodeString')
	partNumberInputRecipe.styleAttribute=";border:0 px solid grey;background-color:white;font-size:11;"
	this_recipe.inputFieldRecipes[1] = partNumberInputRecipe
	
	this_recipe.rows=this.myPOMaterialGridRows()
	this_recipe.dataRows='myProgram.tempDS.wo_po_material_list'
	this_recipe.joinColumnName='RN'
	
	this_recipe.formats=[{format:"number",scale:6,precision:2},
						{format:"list",items:__("myPartNumberItems")},
						{format:""},
						{format:"text"},
						{format:"list",items:__("myEquipmentItems")},
						{format:"number",scale:10,precision:4},
						{format:""},
						{format:""},
						{format:"text"},
						{format:"text"},
						{format:"text"},
						{format:"text"}]
						
	this_recipe.listDefaultRecipe=myProgram.myGetDefaultListRecipe()
	
	if(myProgram.inventoryDS.static_part_list.length == 0)
	{
		this_recipe.gridRecipe.addRowButtonRecipe = null		
	}
	
	this_recipe.divTagDefaultRecipe=new GUIDivTagRecipe({"initialConfigurationName":"default_data_entry_div_tag"})
	this_recipe.divTagDefaultRecipe.styleAttribute=";width:16;height:16;background-color:white;text-align:center;vertical-align:middle;padding-top:2;cursor:pointer;"
	this_recipe.divTagDefaultRecipe.onclickAttribute="myProgram.myPartLookup(this)"
	
	return this_recipe
}
window.MyRecipe.prototype.myPOMaterialGrid._methodName='myPOMaterialGrid'
window.MyRecipe.prototype.myPOMaterialGridOBSOLETE = function()
{
	var the_po_material_grid=new GUISimpleGridRecipe('{"initialConfigurationName":"generic_simple_grid",minRowCount:5}')
	the_po_material_grid.scrollingHeight=100
	the_po_material_grid.columnWidths=[100,100,100,100,100]
	the_po_material_grid.columnCount=6
	the_row_numbers_string='{"rn_heading":"Line","rn_width":75,\
			"rn_cell_on_click":"myProgram.myNewPage(\'edit_po_material_page\',\'_row_number_\',\'_column_number_\')",\
			"rn_cell_on_click_template":"_cell_contents_\
			<a id=\\\"po_material_line__cell_contents_\\\" href=#abc onclick=\\\"myProgram.myDeleteTempItem(\'_grid_id_\',\'_row_number_\',\'_column_number_\')\\\" >\
				<img src=\'mydeleteitem.gif\' alt=\'Delete Row\' style=\'border-width:1;vertical-align:bottom\'></a>"\
			}'
	the_po_material_grid.addRowNumbers=the_row_numbers_string
	the_po_material_grid.idAttribute='wo_po_material_'
	the_po_material_grid.alert=false
	the_po_material_grid.cellOnClickDefault="myProgram.myEditControl('_cell_escaped_contents_','_grid_id_','_cell_id_','_heading_contents_','_row_number_','_column_number_')"
	var the_table=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'})
	if(this.tempDS.wo_po_material_list == null)this.tempDS.wo_po_material_list = [];
	the_table.sourceRows=this.tempDS.wo_po_material_list
	the_table.sourceHeadings=this.mainDS.wo_po_material_headings
	the_table.filterOnSourceHeadings=[].dbPush(this.mainDS.wo_id_heading)
	the_table.filterValues=[].dbPush(this.mainDS.current_workorder_id)
	the_table.sortOnSourceHeadings=[].dbPush(this.mainDS.wo_id_heading)
	the_table.targetHeadings=this.mainDS.wo_po_material_grid_headings
	this.tempDS.wo_po_material_grid_list=the_table.prepare()
	the_po_material_grid.rows=this.tempDS.wo_po_material_grid_list
	the_po_material_grid.defaultColumnWidth=null
	the_po_material_grid.headings=the_table.targetHeadings
//	the_labor_grid.cellOnClick=["myProgram.myNewPage('edit_labor_page','_row_number_','_column_number_')"]
	return the_po_material_grid
}
window.MyRecipe.prototype.myPOMaterialGridOBSOLETE._methodName='myPOMaterialGridOBSOLETE'
window.MyRecipe.prototype.myPOOtherGridOBSOLETE = function()
{
	var the_po_other_grid=new GUISimpleGridRecipe('{"initialConfigurationName":"generic_simple_grid",minRowCount:5}')
	the_po_other_grid.scrollingHeight=100
	the_po_other_grid.columnWidths=[100,100,100,100,100]
	the_po_other_grid.columnCount=6
	the_row_numbers_string='{"rn_heading":"Line","rn_width":75,\
			"rn_cell_on_click":"myProgram.myNewPage(\'edit_po_material_page\',\'_row_number_\',\'_column_number_\')",\
			"rn_cell_on_click_template":"_cell_contents_\
			<a id=\\\"po_other_line__cell_contents_\\\" href=#abc onclick=\\\"myProgram.myDeleteTempItem(\'_grid_id_\',\'_row_number_\',\'_column_number_\')\\\" >\
				<img src=\'mydeleteitem.gif\' alt=\'Delete Row\' style=\'border-width:1;vertical-align:bottom\'></a>"\
			}'
	the_po_other_grid.addRowNumbers=the_row_numbers_string
	the_po_other_grid.idAttribute='wo_po_other_'
	the_po_other_grid.alert=false
	the_po_other_grid.cellOnClickDefault="myProgram.myEditControl('_cell_escaped_contents_','_grid_id_','_cell_id_','_heading_contents_','_row_number_','_column_number_')"
	var the_table=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'})
	if(this.tempDS.wo_po_other_list == null)this.tempDS.wo_po_other_list = [];
	the_table.sourceRows=this.tempDS.wo_po_other_list
	the_table.sourceHeadings=this.mainDS.wo_po_other_headings
	the_table.filterOnSourceHeadings=[].dbPush(this.mainDS.wo_id_heading)
	the_table.filterValues=[].dbPush(this.mainDS.current_workorder_id)
	the_table.sortOnSourceHeadings=[].dbPush(this.mainDS.wo_id_heading)
	the_table.targetHeadings=this.mainDS.wo_po_other_grid_headings
	this.tempDS.wo_po_other_grid_list=the_table.prepare()
	the_po_other_grid.rows=this.tempDS.wo_po_other_grid_list
	the_po_other_grid.defaultColumnWidth=null
	the_po_other_grid.headings=the_table.targetHeadings
//	the_labor_grid.cellOnClick=["myProgram.myNewPage('edit_labor_page','_row_number_','_column_number_')"]
	return the_po_other_grid
}
window.MyRecipe.prototype.myPOOtherGridOBSOLETE._methodName='myPOOtherGridOBSOLETE'
window.MyRecipe.prototype.myMouseWheel = function()
{
	this.tempDS.mouse_wheel_fired = true;
}
window.MyRecipe.prototype.myMouseWheel._methodName='myMouseWheel'
window.MyRecipe.prototype.myCurrentWorkOrderHasEmptyClosingScripts = function()
{
	//Retrieve all Closing Script rows associated with this work order.
	var the_rows_recipe=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'});
	the_rows_recipe.sourceRows=myProgram.mainDS.wo_closing_script_list;
	the_rows_recipe.sourceHeadings=myProgram.mainDS.wo_closing_script_headings;
	the_rows_recipe.targetHeadings=myProgram.mainDS.wo_closing_script_headings;
	the_rows_recipe.filterValues=[].dbPush(myProgram.mainDS.current_workorder_id)
	the_rows_recipe.filterOnSourceHeadings=[].dbPush(myProgram.mainDS.wo_id_heading);
	the_rows_recipe.sortOnSourceHeadings=[];
	var rows = the_rows_recipe.prepare();
	
	var responseIndex = this.mainDS.wo_closing_script_headings.dbIndexOf("Response")
	
	for(var index = 0; index < rows.length; index++)
	{
		var row = rows[index]
		var response = row[responseIndex]
		
		if(response == "")
		{
			return true
		}
	}
	
	return false
}
window.MyRecipe.prototype.myCurrentWorkOrderHasEmptyClosingScripts._methodName='myCurrentWorkOrderHasEmptyClosingScripts'
window.MyRecipe.prototype.myCurrentWorkOrderHasIncompleteRequiredDocuments = function()
{
	var the_rows_recipe=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'});
	the_rows_recipe.sourceRows=myProgram.mainDS.static_document_management_list;
	the_rows_recipe.sourceHeadings=myProgram.mainDS.static_document_management_headings;
	the_rows_recipe.targetHeadings=myProgram.mainDS.static_document_management_headings;
	the_rows_recipe.filterValues=[].dbPush(myProgram.mainDS.current_workorder_id).dbPush("N")
	the_rows_recipe.filterOnSourceHeadings=[].dbPush("Work Order Id").dbPush("Done");
	the_rows_recipe.sortOnSourceHeadings=[];
	var rows = the_rows_recipe.prepare();
		
	return (rows.length > 0)
}
window.MyRecipe.prototype.myCurrentWorkOrderHasIncompleteRequiredDocuments._methodName='myCurrentWorkOrderHasIncompleteRequiredDocuments'
window.MyRecipe.prototype.isAllowedToCompleteWorkOrder = function()
{
	//2006-07-05 (jc)-[960]-The user cannot change a workorder's status to completed if there are unanswered closing script questions.
	var the_value=window['change_wo_status_combobox'].options[window['change_wo_status_combobox'].selectedIndex].text
	var messages = []
	
	if(myProgram.myCurrentWorkOrderHasEmptyClosingScripts())
	{
		messages.push("All Closing Script Questions must be answered before this workorder can be marked as completed.")
	}
		
	//2007-05-10 (jc)-Dont allow a work order to complete if there are incomplete required documents.
	if(myProgram.myCurrentWorkOrderHasIncompleteRequiredDocuments())
	{
		messages.push("[Ref Code:41] All required documents must be marked DONE to complete this work order.")
	}
	
	if(messages.length > 0)
	{
		var messageString = "You cannot mark this workorder complete until you address the following:\r\r"+messages.join("\r")
		alert(messageString)
		return false
	}
	else
	{
		return true
	}
}
window.MyRecipe.prototype.isAllowedToCompleteWorkOrder._methodName='isAllowedToCompleteWorkOrder'
window.MyRecipe.prototype.myChangeWorkOrderStatus = function(the_old_status, the_new_status)
{
    var the_combobox = document.getElementById('change_wo_status_combobox')
	if(the_old_status == null)
	{
		var the_cell_locator=new SUITableCellValueLocatorRecipe({initialConfigurationName:"generic_table_cell_value_locator"})
		the_cell_locator.tableRows=this.mainDS.wo_list
		the_cell_locator.tableHeadings=this.mainDS.wo_headings
		the_cell_locator.tableLocatorHeading=[].dbPush(this.mainDS.wo_id_heading).dbPush("Date Scheduled")
		the_cell_locator.tableLocatorFilter=[].dbPush(this.mainDS.current_workorder_id).dbPush(this.mainDS.current_workorder_date_scheduled)
		the_cell_locator.tableTargetCellHeading="Status"
		the_old_status=the_cell_locator.prepare()
	}
	if(the_new_status == null)
	{
		the_new_status=the_combobox.options[the_combobox.selectedIndex].text
	}
	
	
	if(this.tempDS.mouse_wheel_fired == true)
	{	
		event.srcElement.value = the_old_status;
		this.tempDS.mouse_wheel_fired = null;
		return false
	}
	
	if(this.mainDS.configConfirmStatusChanges == null) this.mainDS.configConfirmStatusChanges = false
	if(this.mainDS.configConfirmStatusChanges)
	{
		var result = confirm("Confirm status change from: "+the_old_status+" to: "+the_new_status+".")
		
		if(!result && the_combobox != null)
		{
			the_combobox.options.value = the_old_status
			return false
		}
	}	
	
	if(the_new_status == "check out") the_new_status = "pending"
	
	//2008-01-24 (jc)-[2090]-Submit WOSubRn with all WOStatusChange messages.
	var the_locator_recipe=new SUITableCellValueLocatorRecipe({"initialConfigurationName":"generic_table_cell_value_locator"})
	the_locator_recipe.tableRows=this.mainDS.wo_list
	the_locator_recipe.tableHeadings=this.mainDS.wo_headings
	the_locator_recipe.tableLocatorHeading=[].dbPush(this.mainDS.wo_id_heading).dbPush("Date Scheduled")
	the_locator_recipe.tableLocatorFilter=[].dbPush(this.mainDS.current_workorder_id).dbPush(this.mainDS.current_workorder_date_scheduled)
	the_locator_recipe.tableTargetCellHeading="Time Scheduled"
	var time_scheduled=the_locator_recipe.prepare()
	
	//Get the tech_id from the data store.
	var tech_id = this.mainDS.tech_id;
	//2005-12-14 JKC CASE:527 Changed the row creation below to use the dbCreate method.
	var the_values= {};
	the_values["Work Order Id"] = this.mainDS.current_workorder_id;
	the_values["Technician Id"] = tech_id;
	the_values["Date Scheduled"] = this.mainDS.current_workorder_date_scheduled;
	the_values["Time Scheduled"] = time_scheduled;
	the_values["ETADate"] = this.mainDS.current_workorder_date_scheduled;
	the_values["ETATime"] = time_scheduled;
	the_values["Old Status"] = the_old_status;
	the_values["Status"] = the_new_status;
	the_values["Transmitted"] = 'n';
	the_values["DateTimeChanged"] = this.myEditRecipeFor({recipeName:"System Date"})+" "+this.myTimeStamp()+" "+(new Date()).getTimezoneOffset();
	
	//2008-01-24 (jc)-[2090]-Submit WOSubRn with all WOStatusChange messages.
	var the_locator_recipe=new SUITableCellValueLocatorRecipe({"initialConfigurationName":"generic_table_cell_value_locator"})
	the_locator_recipe.tableRows=this.mainDS.wo_list
	the_locator_recipe.tableHeadings=this.mainDS.wo_headings
	the_locator_recipe.tableLocatorHeading=[].dbPush(this.mainDS.wo_id_heading).dbPush("Date Scheduled")
	the_locator_recipe.tableLocatorFilter=[].dbPush(this.mainDS.current_workorder_id).dbPush(this.mainDS.current_workorder_date_scheduled)
	the_locator_recipe.tableTargetCellHeading="WOTechRn"
	var woTechRn=the_locator_recipe.prepare()
	
	the_values["WOTechRn"] = woTechRn
	
	var the_headings=this.mainDS.wo_status_change_headings
	var the_row=the_headings.dbCreateRow(the_values, "wo_status_change")
	
	this.mainDS.wo_status_change_list.dbPush(the_row)
	
	if(myProgram.mySendStatusMessage())
	{
		if(!this.mainDS.configConfirmStatusChanges)
		{
			alert('the work order status has been changed from: '+the_old_status+' to: '+((the_new_status == "pending") ? "check out" : the_new_status))
		}
		
		var the_locator_recipe=new SUITableCellValueLocatorRecipe({"initialConfigurationName":"generic_table_cell_value_locator"})
		the_locator_recipe.tableRows=this.mainDS.wo_list
		the_locator_recipe.tableHeadings=this.mainDS.wo_headings
		the_locator_recipe.tableCellNewValue=the_new_status
		the_locator_recipe.tableLocatorHeading=[].dbPush(this.mainDS.wo_id_heading).dbPush("Date Scheduled")
		the_locator_recipe.tableLocatorFilter=[].dbPush(this.mainDS.current_workorder_id).dbPush(this.mainDS.current_workorder_date_scheduled)
		the_locator_recipe.tableTargetCellHeading='Status'
		var the_old_value=the_locator_recipe.prepare()
                
                if(the_new_status == "completed")
                {
                    this.setWorkOrderDateCompleted()
                }
                
		myProgram.mainDS.current_workorder_status = the_new_status
		
		if(the_new_status.trim().toLowerCase() == "pending")
		{
			myAvatar.myRefreshOpenWorkOrdersGrid()
			myUnbilledPage.refreshGrid()
			myProgram.resetCurrentWorkOrderDiv()
                        myProgram.myDirectToPendingPage()			
		}
	}
	else
	{
		alert("A problem occurred trying to post your changes.  Your changes have NOT been submitted.  Please try again.")
		myProgram.mainDS.wo_status_change_list.pop() //Remove status line added to myProgram.mainDS.wo_status_change_list
		if(the_combobox != null)
		{
			the_combobox.options.value = the_old_status
		}
		myProgram.disableInformationMessage()
		return false
		
	}
	
	myProgram.disableInformationMessage()
}
window.MyRecipe.prototype.myChangeWorkOrderStatus._methodName='myChangeWorkOrderStatus'
window.MyRecipe.prototype.setWorkOrderDateCompleted = function()
{
    var the_locator_recipe=new SUITableCellValueLocatorRecipe({"initialConfigurationName":"generic_table_cell_value_locator"})
    the_locator_recipe.tableRows=this.mainDS.wo_list
    the_locator_recipe.tableHeadings=this.mainDS.wo_headings
    the_locator_recipe.tableCellNewValue=this.myEditRecipeFor({recipeName:"System Date"})
    the_locator_recipe.tableLocatorHeading=[].dbPush(this.mainDS.wo_id_heading).dbPush("Date Scheduled").dbPush("Time Scheduled")
    the_locator_recipe.tableLocatorFilter=[].dbPush(this.mainDS.current_workorder_id).dbPush(this.mainDS.current_workorder_date_scheduled).dbPush(this.mainDS.current_workorder_time_scheduled)
    the_locator_recipe.tableTargetCellHeading='DateCompleted'
    var the_old_transmitted_value = the_locator_recipe.prepare()

    var the_locator_recipe=new SUITableCellValueLocatorRecipe({"initialConfigurationName":"generic_table_cell_value_locator"})
    the_locator_recipe.tableRows=this.mainDS.wo_list
    the_locator_recipe.tableHeadings=this.mainDS.wo_headings
    the_locator_recipe.tableCellNewValue=this.myTimeStamp()
    the_locator_recipe.tableLocatorHeading=[].dbPush(this.mainDS.wo_id_heading).dbPush("Date Scheduled").dbPush("Time Scheduled")
    the_locator_recipe.tableLocatorFilter=[].dbPush(this.mainDS.current_workorder_id).dbPush(this.mainDS.current_workorder_date_scheduled).dbPush(this.mainDS.current_workorder_time_scheduled)
    the_locator_recipe.tableTargetCellHeading='TimeCompleted'
    var the_old_transmitted_value = the_locator_recipe.prepare()
}
window.MyRecipe.prototype.setWorkOrderDateCompleted._methodName='setWorkOrderDateCompleted'
window.MyRecipe.prototype.myDirectToQuotesPage = function()
{
	document.getElementById("quotesTab").parentNode.onclick()
}
window.MyRecipe.prototype.myDirectToQuotesPage._methodName='myDirectToQuotesPage'
window.MyRecipe.prototype.myDirectToCurrentWorkOrderPage = function()
{
	var tab = document.getElementById("currentTab")
	var parentNode = tab.parentNode
	parentNode.onclick()
}
window.MyRecipe.prototype.myDirectToCurrentWorkOrderPage._methodName='myDirectToCurrentWorkOrderPage'
window.MyRecipe.prototype.myPoweredByDataBasicsLink = function()
{
    return "<a href='http://www.databasics.com' style='font-weight:900;font-family:verdana;color:blue;' target='_blank'>Powered by Data-Basics</a>"
}
window.MyRecipe.prototype.myPoweredByDataBasicsLink._methodName='myPoweredByDataBasicsLink'
window.MyRecipe.prototype.myDirectToPendingPage = function()
{
	document.getElementById("inProcessTab").parentNode.onclick()
}
window.MyRecipe.prototype.myDirectToPendingPage._methodName='myDirectToPendingPage'
window.MyRecipe.prototype.myForceAutoSync = function()
{
	myProgram.tempDS.forcedAutoSync = true
	myProgram.myTimedSynchronizationRecipe()
	myProgram.tempDS.forcedAutoSync = false
}
window.MyRecipe.prototype.myForceAutoSync._methodName='myForceAutoSync'
window.MyRecipe.prototype.myTimeStamp = function()
{
	var date = new Date()
	
	var hours = date.getHours()
	var minutes = date.getMinutes()
	var seconds = date.getSeconds()
	var millis = date.getMilliseconds()
	
	if(hours.toString().length == 1)hours = "0"+hours
	if(minutes.toString().length == 1)minutes = "0"+minutes
	if(seconds.toString().length == 1)seconds = "0"+seconds
	if(millis.toString().length == 1)millis = "0"+millis
	
	var timeStamp = hours+":"+minutes+":"+seconds+":"+millis
	
	return timeStamp;
}
window.MyRecipe.prototype.myTimeStamp._methodName='myTimeStamp'
window.MyRecipe.prototype.myDeleteTempItem = function(the_grid_id,the_row_number,the_column_number)
{
	if(confirm('delete row '+((the_row_number*1)+1).toString()))
	{
		var list_name=the_grid_id+'list'
		var headings_name=the_grid_id+'headings'
		var the_headings=this.mainDS[headings_name]
		var the_list=this.tempDS[list_name]
		this.tempDS[list_name].splice(the_row_number,1)
		
		var the_div=window[the_grid_id+'division']
		switch(the_grid_id)
		{
			case 'wo_po_other_':
				the_div.innerHTML=this.myPOOtherGrid().prepare()
				this.mainDS.grid_focus_ids=[].dbPush('other_line_'+the_row_number)
				break
			case 'wo_po_material_':
				the_div.innerHTML=this.myPOMaterialGrid().prepare()
				this.mainDS.grid_focus_ids=[].dbPush('material_line_'+the_row_number)
				break
		}
		this.mySetFocusGrids()
	}
}
window.MyRecipe.prototype.myDeleteTempItem._methodName='myDeleteTempItem'
window.MyRecipe.prototype.myDeleteCharges = function(chargesToDelete)
{	
	myProgram.setInformationMessage('Please wait while changes are submitted...')
		
	if(myProgram.mySendDeleteChargesMessage(chargesToDelete))
	{
        //myProgram.myReloadData([((myProgram.isWorkOrderQuote()) ? "wo_quote_list" : "wo_other_list")])
		//myProgram.myRefreshOtherSummaryGridForFormView()
		//myProgram.myRefreshPaymentArea()
		document.body.style.cursor='auto'
		myProgram.disableInformationMessage()
		myProgram.myHideSecondLayerWindow()
		return true
	}
	else
	{
		alert("A problem occurred trying to post your changes.  Your changes have NOT been submitted.  Please try again.")
		document.body.style.cursor='auto'
		myProgram.disableInformationMessage()
		myProgram.myHideSecondLayerWindow()
		return false
	}
}
window.MyRecipe.prototype.myDeleteCharges._methodName='myDeleteCharges'
window.MyRecipe.prototype.myDeleteChargeItem = function(rowNumber)
{
	if(confirm('delete row '+((rowNumber*1)+1).toString()))
	{
		var rnIndex = myProgram.mainDS.wo_other_grid_headings.dbIndexOf("RN")
		var the_rn=myProgram.tempDS.wo_other_grid_list[rowNumber][rnIndex]
		
		var sourceRows = ((myProgram.isWorkOrderQuote()) ? this.mainDS.wo_quote_list : this.mainDS.wo_other_list)
		
		var serverRN = sysFunctions.getColumnValueForTable(sourceRows, myProgram.mainDS.wo_other_headings, "ServerRN", ["RN"], [the_rn])	
		var status = sysFunctions.getColumnValueForTable(sourceRows, myProgram.mainDS.wo_other_headings, "Status", ["RN"], [the_rn])
		
		if(status.trim().toLowerCase() != "not submitted")
		{
		    alert("This line has already been submitted so cannot be deleted.")
		    return
		}
		
		var the_table=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'})
	    the_table.sourceRows=sourceRows
	    the_table.sourceHeadings=myProgram.mainDS.wo_other_headings
	    the_table.filterOnSourceHeadings=[].dbPush("RN")
	    the_table.filterValues=[].dbPush(the_rn)
	    the_table.targetHeadings=myProgram.mainDS.wo_other_headings
            
	    if(myProgram.myDeleteCharges(the_table.prepare()))
            {
                var the_table=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'})
                the_table.sourceRows=sourceRows
                the_table.sourceHeadings=myProgram.mainDS.wo_other_headings
                the_table.filterOnSourceHeadings=[].dbPush("RN")
                the_table.filterValues=[].dbPush(function(val){return val.value != the_rn})
                the_table.targetHeadings=myProgram.mainDS.wo_other_headings
                
                if(myProgram.isWorkOrderQuote())
                {
                    this.mainDS.wo_quote_list = the_table.prepare()
                }
                else
                {
                    this.mainDS.wo_other_list = the_table.prepare()
                }
                
                myProgram.myRefreshOtherSummaryGridForFormView()
		myProgram.myRefreshPaymentArea()
            }
	}
}
window.MyRecipe.prototype.myDeleteChargeItem._methodName='myDeleteChargeItem'
window.MyRecipe.prototype.removeNonTransmittedEntries = function()
{
    var newChargeList = []
    var sourceRows = ((myProgram.isWorkOrderQuote()) ? this.mainDS.wo_quote_list : this.mainDS.wo_other_list)
    var serverRnIndex = myProgram.mainDS.wo_other_headings.dbIndexOf("ServerRN")
    
    for(var rowIndex = 0; rowIndex < sourceRows.length; rowIndex++)
    {
        if(sourceRows[rowIndex][serverRnIndex]*1 != 0)   
        {
            newChargeList.push(sourceRows[rowIndex])
        }
    }
    
    myProgram.mainDS[((myProgram.isWorkOrderQuote()) ? "wo_quote_list" : "wo_other_list")] = newChargeList
}
window.MyRecipe.prototype.removeNonTransmittedEntries._methodName='removeNonTransmittedEntries'
window.MyRecipe.prototype.myDeleteItemOriginal = function(the_grid_id,the_row_number,the_column_number)
{
	var the_grid_element;
	
	if(window[the_grid_id].length != null)
	{
		for(var i = 0; i < window[the_grid_id].length; i++)
		{
			if(window[the_grid_id][i].tagName == "TABLE")
			{
				the_grid_element = window[the_grid_id][i]
				break
			}
		}
		if(the_grid_element == null) the_grid_element = window[the_grid_id][i]
	}
	else
	{
		the_grid_element = window[the_grid_id]		
	}
	
	if(the_grid_element.disallowEditTransmitted == "true")
	{
		var rn_index = this.mainDS[the_grid_id+"grid_headings"].dbIndexOf("RN")
		var rn_value = this.tempDS[the_grid_id+"grid_list"][the_row_number][rn_index]
		
		var the_cell_locator=new SUITableCellValueLocatorRecipe({initialConfigurationName:"generic_table_cell_value_locator"})
		the_cell_locator.tableRows=this.mainDS[the_grid_id+"list"]
		the_cell_locator.tableHeadings=this.mainDS[the_grid_id+"headings"]
		the_cell_locator.tableLocatorHeading="RN"
		the_cell_locator.tableLocatorFilter=rn_value
		the_cell_locator.tableTargetCellHeading="Status"
		var status_value=the_cell_locator.prepare()
		
		if(status_value.trim().toLowerCase() == 'submitted')
		{
			alert("[Ref Code:3] This entry has already been submitted. Deletion of this entry is not permitted")
			return;
		}
	}
	
	if(confirm('delete row '+((the_row_number*1)+1).toString()))
	{
		var the_column_number=myProgram.mainDS[the_grid_id+"grid_headings"].dbIndexOf("RN")
		var grid_list=myProgram.tempDS[the_grid_id+"grid_list"]
		var the_rn=grid_list[the_row_number][the_column_number]
		var list_name=the_grid_id+'list'
		var headings_name=the_grid_id+'headings'
		var the_headings=myProgram.mainDS[headings_name]
		var the_list=myProgram.mainDS[list_name]
		
		if(the_grid_element.onDeleteFunction != null)
		{
			var params = {}
			params.RN = the_rn
			
			eval("("+the_grid_element.onDeleteFunction+"(params)"+")")
		}
		myProgram.tempDS.rn_for_deleted_line = the_rn
		var the_table=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'})
		the_table.sourceRows=myProgram.tempDS[the_grid_id+"grid_list"]
		the_table.sourceHeadings=myProgram.mainDS[the_grid_id+"grid_headings"]
		the_table.filterOnSourceHeadings=[].dbPush("RN")
		the_table.filterValues=[].dbPush(function(val){return val.value != myProgram.tempDS.rn_for_deleted_line})
		the_table.targetHeadings=myProgram.mainDS[the_grid_id+"grid_headings"]
		myProgram.tempDS[the_grid_id+"grid_list"]=the_table.prepare()	
		delete(myProgram.tempDS.rn_for_deleted_line)
		
		myProgram.tempDS.rn_for_deleted_line = the_rn
		var the_table=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'})
		the_table.sourceRows=the_list
		the_table.sourceHeadings=the_headings
		the_table.filterOnSourceHeadings=[].dbPush("RN")
		the_table.filterValues=[].dbPush(function(val){return val.value != myProgram.tempDS.rn_for_deleted_line})
		the_table.targetHeadings=the_headings
		myProgram.mainDS[list_name]=the_table.prepare()	
		delete(myProgram.tempDS.rn_for_deleted_line)
	
		myProgram.mySaveData()
		var the_div=window[the_grid_id+'division']
		switch(the_grid_id)
		{
			case 'wo_labor_':
				myProgram.myRefreshLaborSummaryGridForFormView()
				break
			case 'wo_metrics_':
				the_div.innerHTML=myProgram.myEditMetricsGrid().prepare()
				myProgram.mainDS.grid_focus_ids=[].dbPush('metrics_line_'+the_row_number)
				break
			case 'wo_material_':
				myProgram.myRefreshMaterialSummaryGridForFormView()
				break
			case 'wo_other_':
				myProgram.myRefreshOtherSummaryGridForFormView()
				break
			case 'wo_flat_rate_':
				the_div.innerHTML=myProgram.myFlatRateGrid().prepare()
				myProgram.mainDS.grid_focus_ids=[].dbPush('flat_rate_line_'+the_row_number)
				break
		}
		if(myProgram.isWorkOrderCOD()) myProgram.myRefreshPaymentArea()
		myProgram.mySetFocusGrids()
	}
}
window.MyRecipe.prototype.myDeleteItemOriginal._methodName='myDeleteItemOriginal'
window.MyRecipe.prototype.myManufacturerGroupCombobox = function()
{
	var the_combobox=new GUIComboBoxRecipe({initialConfigurationName:'generic_combobox'});
	var the_rows_recipe=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'});
	
	the_rows_recipe.sourceRows=myProgram.flatRateDS.static_flat_rate_mfg_list;
	the_rows_recipe.sourceHeadings=myProgram.flatRateDS.static_flat_rate_mfg_headings;
	the_rows_recipe.targetHeadings=[].dbPush("Manufacturer");
	the_rows_recipe.sortOnSourceHeadings=[];
	the_combobox.selectedOptionText=myProgram.tempDS.selected_flat_rate_manufacturer;
	the_combobox.breakpointOnPrepare=false;
	the_combobox.idAttribute='manufacturer_combobox';
	the_combobox.options=[["All"]].concat(the_rows_recipe.prepare());
	
	return the_combobox
}
window.MyRecipe.prototype.myManufacturerGroupCombobox._methodName='myManufacturerGroupCombobox'
window.MyRecipe.prototype.myFlatRateGroupCombobox = function()
{
	var the_combobox=new GUIComboBoxRecipe({initialConfigurationName:'generic_combobox'});
	var the_rows_recipe=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'});
	
	the_rows_recipe.sourceRows=myProgram.flatRateDS.static_flat_rate_group_list;
	the_rows_recipe.sourceHeadings=myProgram.flatRateDS.static_flat_rate_group_headings;
	the_rows_recipe.targetHeadings=[].dbPush("Flat Rate Group");
	the_rows_recipe.sortOnSourceHeadings=[];
	the_combobox.selectedOptionText=myProgram.tempDS.selected_flat_rate_group;
	the_combobox.breakpointOnPrepare=false;
	the_combobox.idAttribute='group_combobox';
	the_combobox.options=[["All"]].concat(the_rows_recipe.prepare());
	
	return the_combobox
}
window.MyRecipe.prototype.myFlatRateGroupCombobox._methodName='myFlatRateGroupCombobox'
window.MyRecipe.prototype.myInventoryGroupCombobox = function()
{	
	//Locate the selected group-ids group name.
	if(myProgram.mainDS.wo_selected_group != null)
	{
		var the_locator_recipe=new SUITableCellValueLocatorRecipe({"initialConfigurationName":"generic_table_cell_value_locator"})
		the_locator_recipe.tableRows=myProgram.mainDS.static_part_group_list;
		the_locator_recipe.tableHeadings=myProgram.mainDS.static_part_group_headings;
		the_locator_recipe.tableLocatorHeading="Group Id"
		the_locator_recipe.tableLocatorFilter=myProgram.mainDS.wo_selected_group
		the_locator_recipe.tableTargetCellHeading="Group Name"
		var group_name=the_locator_recipe.prepare()
	}
	
	var the_combobox=new GUIComboBoxRecipe({initialConfigurationName:'generic_combobox'});
	var the_rows_recipe=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'});
	
	the_rows_recipe.sourceRows=myProgram.mainDS.static_part_group_list;
	the_rows_recipe.sourceHeadings=myProgram.mainDS.static_part_group_headings;
	the_rows_recipe.targetHeadings=[].dbPush("Group Name").dbPush("Group Id");
	the_rows_recipe.sortOnSourceHeadings=[];
	the_combobox.selectedOptionText=group_name;
	the_combobox.breakpointOnPrepare=false;
	the_combobox.idAttribute='group_combobox';
	the_combobox.options=[["All","All"]].concat(the_rows_recipe.prepare());
	
	return the_combobox
}
window.MyRecipe.prototype.myInventoryGroupCombobox._methodName='myInventoryGroupCombobox'
window.MyRecipe.prototype.myEquipmentComboBox = function()
{
	var the_combobox=new GUIComboBoxRecipe({initialConfigurationName:'generic_combobox'});
	var the_rows_recipe=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'});
	the_rows_recipe.filterValues=[].dbPush(myProgram.mainDS.current_workorder_id).dbPush("y");
	the_rows_recipe.filterOnSourceHeadings=[].dbPush(myProgram.mainDS.wo_id_heading).dbPush("Specified");
	the_rows_recipe.sourceRows=this.mainDS.wo_equipment_list;
	the_rows_recipe.sourceHeadings=myProgram.mainDS.wo_equipment_headings;
	the_rows_recipe.targetHeadings=[].dbPush("Equipment Id");
	the_rows_recipe.sortOnSourceHeadings=[];
	the_combobox.selectedOptionText=myProgram.mainDS.wo_selected_equipment;
	the_combobox.breakpointOnPrepare=false;
	the_combobox.idAttribute='add_equipment_combobox';
	the_combobox.options=the_rows_recipe.prepare();
	return the_combobox
}
window.MyRecipe.prototype.myEquipmentComboBox._methodName='myEquipmentComboBox'
window.MyRecipe.prototype.myLocationComboBox = function()
{
	var the_combobox=new GUIComboBoxRecipe({initialConfigurationName:'generic_combobox'});
	var the_rows_recipe=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'});
	the_rows_recipe.sourceRows=this.mainDS.static_location_list;
	the_rows_recipe.sourceHeadings=myProgram.mainDS.static_location_headings;
	the_rows_recipe.targetHeadings=[].dbPush("Location Description").dbPush("Location Id");
	the_rows_recipe.sortOnSourceHeadings=[];
	
	var index = this.mainDS.tech_info_headings.dbIndexOf("tech_location_id")
	var tech_location_id = this.mainDS.tech_info_list[0][index]
	
	the_combobox.selectedOptionValue=tech_location_id
	the_combobox.breakpointOnPrepare=false;
	the_combobox.idAttribute='add_location_combobox';
	the_combobox.options=the_rows_recipe.prepare();
	return the_combobox
}
window.MyRecipe.prototype.myLocationComboBox._methodName='myLocationComboBox'
window.MyRecipe.prototype.myProblemsRecipe = function()
{
	var the_recipe = new GUITemplateRecipe()
	var the_template = []
	the_template.dbPush(this.myProblemsComboBox())
	the_template.dbPush(this.myAddProblemButton())
	the_recipe.joinString=""
	the_recipe.template = the_template
	return the_recipe
}
window.MyRecipe.prototype.myProblemsRecipe._methodName='myProblemsRecipe'
window.MyRecipe.prototype.myAddProblemDescription = function(the_window)
{
	var the_combobox=the_window.document.all["add_problem_combobox"]
	
	if(the_combobox.options.length == 0)
	{
		//Silently ignore
		return;
	}
	var text = the_combobox.options[the_combobox.selectedIndex].text
	
	var the_text_area = the_window.document.all['problem_description_textarea']
	if(the_text_area != null)
	{
		the_text_area.focus()
		the_text_area.value = the_text_area.value+text+"\r\n";
		the_text_area.selectionStart = the_text_area.value.length;
		
		return
	}
}
window.MyRecipe.prototype.myAddProblemDescription._methodName='myAddProblemDescription'
window.MyRecipe.prototype.myProblemsComboBox = function()
{
	var the_combobox=new GUIComboBoxRecipe({initialConfigurationName:'generic_combobox'});
	the_combobox.idAttribute='add_problem_combobox';
	the_combobox.options=["Freeze / Non Responsive",
						  "Script Error (Please enter Line number)",
						  "A script on this page has taken longer than expected",
						  "Error Code ___ was displayed"]
	return the_combobox
}
window.MyRecipe.prototype.myProblemsComboBox._methodName='myProblemsComboBox'
window.MyRecipe.prototype.myCommonPhraseComboBox = function(normal)
{
	var the_combobox=new GUIComboBoxRecipe({initialConfigurationName:'generic_combobox'});
	var the_rows_recipe=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'});
	the_rows_recipe.sourceRows=myProgram.mainDS.static_common_phrase_list;
	the_rows_recipe.sourceHeadings=myProgram.mainDS.static_common_phrase_headings;
	the_rows_recipe.targetHeadings=[].dbPush("Description");
	the_rows_recipe.sortOnSourceHeadings=[];
	the_combobox.selectedOptionText=myProgram.mainDS.static_selected_common_phrase;
	the_combobox.breakpointOnPrepare=false;
	the_combobox.idAttribute='add_common_phrase_combobox';
	if(normal == null)the_combobox.styleAttribute+=";background-color:#7ac98e;"
	the_combobox.options=the_rows_recipe.prepare();
	return the_combobox
}
window.MyRecipe.prototype.myCommonPhraseComboBox._methodName='myCommonPhraseComboBox'
window.MyRecipe.prototype.myAddCommonPhrase = function()
{
	var the_common_phrase_combobox = document.getElementById("add_common_phrase_combobox")
	
	if(the_common_phrase_combobox.options.length == 0)
	{
		//Silently ignore
		return;
	}
	var the_description_value=this.mainDS.static_selected_common_phrase = the_common_phrase_combobox.options[the_common_phrase_combobox.selectedIndex].text
	
	//Locate the row with the selected description and get the text value to insert.
	var the_locator_recipe=new SUITableCellValueLocatorRecipe({"initialConfigurationName":"generic_table_cell_value_locator"})
	the_locator_recipe.tableRows=myProgram.mainDS.static_common_phrase_list
	the_locator_recipe.tableHeadings=myProgram.mainDS.static_common_phrase_headings
	the_locator_recipe.tableLocatorHeading="Description"
	the_locator_recipe.tableLocatorFilter=the_description_value
	the_locator_recipe.tableTargetCellHeading="Text"
	var text=the_locator_recipe.prepare()
	
	var the_work_performed_text_area = document.getElementById("work_performed_text_area")
	if(the_work_performed_text_area != null)
	{
		the_work_performed_text_area.focus()
		the_work_performed_text_area.value = the_work_performed_text_area.value+text+"\r\n";
		the_work_performed_text_area.selectionStart = the_work_performed_text_area.value.length;
		
		return
	}
	var the_work_requested_text_area = document.getElementById("work_requested_text_area")
	if(the_work_requested_text_area != null)
	{
		the_work_requested_text_area.focus()
		the_work_requested_text_area.value = the_work_requested_text_area.value+text+"\r\n";
		the_work_requested_text_area.selectionStart = the_work_requested_text_area.value.length;
	    return
	}
	
}
window.MyRecipe.prototype.myAddCommonPhrase._methodName='myAddCommonPhrase'
window.MyRecipe.prototype.myPONumberComboBox = function()
{
	var the_combobox=new GUIComboBoxRecipe({initialConfigurationName:'generic_combobox'});
	var the_rows_recipe=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'});
	the_rows_recipe.sourceRows=this.mainDS.wo_po_list;
	the_rows_recipe.sourceHeadings=myProgram.mainDS.wo_po_headings;
	the_rows_recipe.targetHeadings=[].dbPush("PO#");
	the_rows_recipe.sortOnSourceHeadings=[];
	the_combobox.breakpointOnPrepare=false;
	the_combobox.idAttribute='add_po_combobox';
	the_combobox.options=the_rows_recipe.prepare();
	return the_combobox
}
window.MyRecipe.prototype.myPONumberComboBox._methodName='myPONumberComboBox'
window.MyRecipe.prototype.myCreateWorkOrderCalendarButtonRecipe = function(id)
{
	var link = '<A HREF=\"#\" onClick=\"myProgram.myCreateWorkOrderCalendarRecipe(\''+id+'\'); return false;\" NAME=\"anchor1\" ID=\"anchor1\" alt=\"Click here to use a calendar\"><img border=none src=\"show_calendar2.gif\"></A>'
	return link
}
window.MyRecipe.prototype.myCreateWorkOrderCalendarButtonRecipe._methodName='myCreateWorkOrderCalendarButtonRecipe'
window.MyRecipe.prototype.myCalendarButtonRecipe = function(id, date_list_location, date_filter_location)
{
	var link = '<A HREF=\"#\" onClick=\"myProgram.myCalendarRecipe(\''+id+'\',\''+date_list_location+'\',\''+date_filter_location+'\'); return false;\" NAME=\"anchor1\" ID=\"anchor1\" alt=\"Click here to use a calendar\"><img border=none src=\"show_calendar2.gif\"></A>'
	return link
}
window.MyRecipe.prototype.myCalendarButtonRecipe._methodName='myCalendarButtonRecipe'
window.MyRecipe.prototype.myVendorComboBox = function()
{
	var the_combobox=new GUIComboBoxRecipe({initialConfigurationName:'generic_combobox'});
	var the_rows_recipe=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'});
	the_rows_recipe.sourceRows=this.mainDS.static_vendor_list;
	the_rows_recipe.sourceHeadings=myProgram.mainDS.static_vendor_headings;
	the_rows_recipe.targetHeadings=[].dbPush("Vendor Lookup");
	the_rows_recipe.sortOnSourceHeadings=[];
	the_combobox.breakpointOnPrepare=false;
	the_combobox.selectedOptionText=myProgram.mainDS.wo_selected_vendor
	the_combobox.idAttribute='add_vendor_combobox';
	the_combobox.options=the_rows_recipe.prepare();
	return the_combobox
}
window.MyRecipe.prototype.myVendorComboBox._methodName='myVendorComboBox'
window.MyRecipe.prototype.mySelectOnce = function()
{
	event.srcElement.select();
	event.srcElement.onfocus=null;
}
window.MyRecipe.prototype.mySelectOnce._methodName='mySelectOnce'
window.MyRecipe.prototype.myEditRecipeFor = function(the_parameters)
{
	switch(the_parameters.recipeName)
	{
		case "Done":
		var the_combobox=new GUIComboBoxRecipe({initialConfigurationName:'generic_combobox'});
			//the_combobox.selectedOptionText=myProgram.mainDS.wo_selected_other_rate;
			the_combobox.breakpointOnPrepare=false;
			the_combobox.idAttribute='done_combobox'
			the_combobox.options=["Y","N"]
			var the_recipe = the_combobox;
			break
		case "Price Level":
			var the_recipe=this.myPriceLevelRecipe()
			break;
		case "BillQty":
			
			/*if(the_parameters.idAttribute == "wo_material__edit_control" || the_parameters.idAttribute == "wo_other__edit_control")
			{
				var the_po_value_index = myProgram.mainDS[the_parameters.gridId+"grid_headings"].dbIndexOf("PO#")
				
				if(myProgram.tempDS[the_parameters.gridId+"grid_list"][the_parameters.rowNumber][the_po_value_index] != "")
				{
					alert("This item is part of a purchase order and cannot be changed")
					return;
				}
			}*/
			var the_recipe = this.myBillQuantityRecipe();
			break
		case "BillHours":
			var the_recipe=new GUIComboBoxRecipe({initialConfigurationName:'generic_combobox',idAttribute:'add_billHours_combobox'})
			the_recipe.options=this.mainDS.static_labor_hour_list
			the_recipe.onchangeAttribute="myProgram.updatePriceField()"
			if(this.isWorkOrderCOD())the_recipe.oneditcontrolAttribute="myProgram.myBillHoursHasChanged"
			break;
		case "Category":
			var the_recipe=new GUIComboBoxRecipe({initialConfigurationName:'generic_combobox'
												 ,idAttribute:'category_combobox'})
			if(this.mainDS.static_collateral_category_list == null) this.mainDS.static_collateral_category_list = ["Receipt","Picture","Other"]
			if(this.mainDS.static_collateral_category_list.length == 0) this.mainDS.static_collateral_category_list = ["Receipt","Picture","Other"]
			the_recipe.options=this.mainDS.static_collateral_category_list
			
			break;
		case "Collateral Description":
			var the_recipe=new GUIInputFieldRecipe("{initialConfigurationName:'generic_text_input_field',\
				idAttribute:'add_collateral_description_field',finalIngredients:{sizeAttribute:'15'}}")
			break;
		case "File":
			var the_recipe=new GUIInputFieldRecipe("{initialConfigurationName:'generic_file_input_field',\
				idAttribute:'add_file_field',finalIngredients:{sizeAttribute:'15'}}")
			break;
		case "Location Id":
			if(the_parameters.idAttribute == "wo_material__edit_control")
			{
				 var the_po_value_index = myProgram.mainDS.wo_material_headings.dbIndexOf("PO#")    
				 if(myProgram.tempDS.wo_material_grid_list[the_parameters.rowNumber][the_po_value_index] != "")
				 {
				 	alert("[Ref Code:5] This material item is part of a purchase order and cannot be changed")
				 	return;
				 }   
			}
			var the_recipe=this.myLocationComboBox()
			break;
		case "Other Rate Description":
			//2006-02-09 (JT)-[542]-deny changes when line has associated PO<br/>   
			if(the_parameters.idAttribute == "wo_other__edit_control")
			{    
				//Check to see if there is a purchase order asociated with this other item.
  				//If there is, nothing can be edited.   
  				//Locate the po value of the row.
  		    
  				var the_po_value_index = myProgram.mainDS.wo_other_grid_headings.dbIndexOf("PO#")    
				if(myProgram.tempDS.wo_other_grid_list[the_parameters.rowNumber][the_po_value_index] != "")
				{
					alert("[Ref Code:6] This other item is part of a purchase order and cannot be changed")
					return;
				}   
			}
			
			var selected_other_rate_id = this.mainDS.wo_selected_other_rate
			if(selected_other_rate_id == null || selected_other_rate_id == "")
			{
				if(this.mainDS.static_other_rate_list.length > 0)
				{	
					var other_rate_id_index = this.mainDS.static_other_rate_headings.dbIndexOf("Other Rate Id")
					selected_other_rate_id = this.mainDS.static_other_rate_list[0][other_rate_id_index];
				}
			}
			var the_locator_recipe=new SUITableCellValueLocatorRecipe({"initialConfigurationName":"generic_table_cell_value_locator"})
			the_locator_recipe.tableRows=this.mainDS.static_other_rate_list;
			the_locator_recipe.tableHeadings=this.mainDS.static_other_rate_headings
			the_locator_recipe.tableLocatorHeading="Other Rate Id"
			the_locator_recipe.tableLocatorFilter=selected_other_rate_id
			the_locator_recipe.tableTargetCellHeading="Other Rate Description"
			var description=the_locator_recipe.prepare()
			
			if(description==null)description=""
			
			var the_recipe = new GUIInputFieldRecipe({initialConfigurationName:'generic_text_input_field'
												     ,idAttribute:'other_rate_description_field'
												     ,valueAttribute:description
												     ,finalIngredients:{sizeAttribute:'30',maxlengthAttribute:'40'}})
										
			break;
		case "Response":
			var the_recipe = new GUIInputFieldRecipe({initialConfigurationName:'generic_text_input_field'
												     ,idAttribute:'closing_call_script_response_field'
												     ,finalIngredients:{sizeAttribute:'30',maxlengthAttribute:'40'}})
			break;
		case "Period Id":
			if(the_parameters.idAttribute == "wo_labor__edit_control")
			{
				alert("The Period cannot be changed");
				return;
			}
			var the_recipe = this.myPayPeriodComboboxRecipe()
			break
		case "Measurement":
			var the_recipe=new GUIInputFieldRecipe("{initialConfigurationName:'generic_text_input_field',\
				idAttribute:'metrics_measurement_field',finalIngredients:{sizeAttribute:'30',maxlengthAttribute:'40'}}")
			break
		case "Metrics Measurement":
			var the_recipe=new GUIInputFieldRecipe("{initialConfigurationName:'generic_text_input_field',\
				idAttribute:'metrics_measurement_field',finalIngredients:{sizeAttribute:'30',maxlengthAttribute:'40'}}")
			the_recipe.styleAttribute+=";background-color:#7ac98e;"
			break;
		case "Metrics Date":
			if(the_parameters.idAttribute == "wo_metrics__edit_control")
			{
				alert("The Date cannot be changed");
				return;
			}
			var current_date=new Date
			var year = current_date.getFullYear();
			var month = current_date.getMonth()+1;
			if(month.toString().length == 1)month = "0"+month;
			var date = current_date.getDate();
			if(date.toString().length == 1)date = "0"+date;
		
			var date_string = year+"-"+month+"-"+date;
			var the_recipe=date_string;
			this.mainDS.system_date = date_string;
			break
		case "System Date":
			if(the_parameters.idAttribute == "wo_po__edit_control")
			{
				alert("The Date cannot be changed");
				return;
			}
			var current_date=new Date
			var year = current_date.getFullYear();
			var month = current_date.getMonth()+1;
			if(month.toString().length == 1)month = "0"+month;
			var date = current_date.getDate();
			if(date.toString().length == 1)date = "0"+date;
		
			var date_string = year+"-"+month+"-"+date;
			var the_recipe=date_string;
			this.mainDS.system_date = date_string;
			break
		case "Metrics Equipment Id":
			if(the_parameters.idAttribute == "wo_metrics__edit_control")
			{
				alert("The Equipment cannot be changed");
				return;
			}
			var the_recipe = this.mainDS.current_equipment_id
			break;
		case "Technician Id":
			this.mainDS.wo_selected_technician = this.mainDS.tech_id
			if(this.mainDS.static_technician_list != null)
			{
				if(this.mainDS.static_technician_list.length > 0)
				{
					var the_recipe=new GUIComboBoxRecipe({initialConfigurationName:'generic_combobox'
												 ,idAttribute:'add_technician_combobox'
												})
					the_recipe.options=this.mainDS.static_technician_list
					the_recipe.selectedOptionText=this.mainDS.tech_id
					break
				}
				else
				{
					var the_recipe=this.myGenericComboBoxFor('technician')
				}
			}
			else
			{
				var the_recipe=this.myGenericComboBoxFor('technician')
			}
			break
		case "tech_id":
			var the_recipe=new GUIInputFieldRecipe("{initialConfigurationName:'generic_text_input_field',\
				idAttribute:'tech_id_field',finalIngredients:{sizeAttribute:'15'}}")
			//the_recipe.validateFormat="generic_positive_number"
                         
			the_recipe.valueAttribute = this.mainDS.tech_id;
			break
		case "password":
			var the_recipe=new GUIInputFieldRecipe("{initialConfigurationName:'generic_text_input_field',\
				idAttribute:'password_field',finalIngredients:{sizeAttribute:'15'}}")
			the_recipe.typeAttribute = "password";
			the_recipe.valueAttribute = this.tempDS.password;
			break
		case "cc":
			var the_recipe=new GUIInputFieldRecipe("{initialConfigurationName:'generic_text_input_field',\
				idAttribute:'cc_field',finalIngredients:{sizeAttribute:'15'}}")
			the_recipe.typeAttribute = "password";
			break
		case "Work Code":
			var the_recipe=new GUIComboBoxRecipe({initialConfigurationName:'generic_combobox'
												 ,idAttribute:'work_code_combobox'})
			
			if(the_parameters.serviceCategoryId != null)
			{
				var filterValues = [].dbPush(the_parameters.serviceCategoryId );
				var filterOnSourceHeadings = [].dbPush("ServiceCategoryId");
			}
			else
			{
				var filterValues = []
				var filterOnSourceHeadings = []
			}
			
			
			var the_rows_recipe=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'});
			the_rows_recipe.filterValues=filterValues
			the_rows_recipe.filterOnSourceHeadings=filterOnSourceHeadings
			the_rows_recipe.sourceRows=this.mainDS.static_work_code_list;
			the_rows_recipe.sourceHeadings=this.mainDS.static_work_code_headings;
			the_rows_recipe.targetHeadings=[].dbPush("WorkCodeId");
			the_rows_recipe.sortOnSourceHeadings=[];
			the_recipe.options=the_rows_recipe.prepare();
			the_recipe.onblurAttribute = "myProgram.mySetWorkRequestedFromWorkCode(window)"	
			break;
		case "Service Category":
			var the_recipe=new GUIComboBoxRecipe({initialConfigurationName:'generic_combobox'
												 ,idAttribute:'service_category_combobox'
												})
			the_recipe.options=this.mainDS.static_service_category_list	
			the_recipe.onchangeAttribute = 	"myProgram.myFilterWorkCodeByServiceCategory(window)"						 
			break
		case "Equipment Id":
			if(the_parameters.idAttribute == "wo_material__edit_control" || the_parameters.idAttribute == "wo_other__edit_control")
			{
				var the_po_value_index = myProgram.mainDS[the_parameters.gridId+"grid_headings"].dbIndexOf("PO#")
				
				if(myProgram.tempDS[the_parameters.gridId+"grid_list"][the_parameters.rowNumber][the_po_value_index] != "")
				{
					alert("This item is part of a purchase order and cannot be changed")
					return;
				}
			}
			if(the_parameters.idAttribute == "wo_metrics__edit_control" || the_parameters.idAttribute == "wo_equipment_unspecified__edit_control")
			{
				alert("The Equipment Id cannot be changed");
				return;
			}
		
			var the_recipe=this.myEquipmentComboBox()
			break
		case "Vendor Name":
			var the_recipe=this.myVendorComboBox()
			the_recipe.styleAttribute+=";background-color:#7ac98e;"
			break
		case "Flat Rate Group":
			the_recipe=this.myFlatRateGroupCombobox()
			the_recipe.onchangeAttribute="myProgram.myFlatRateSearchByGroupId(window)"
			break
		case "Group Id":
			var the_recipe=this.myInventoryGroupCombobox()
			the_recipe.onchangeAttribute="myProgram.myPartsSearchByGroupId(window)"
			break
		case "Results Limit":
			limit = this.mainDS.maxRowCount;
			if(limit == null)this.mainDS.maxRowCount = limit = 200;
			limit = limit.toString();
			var the_recipe=new GUIComboBoxRecipe({initialConfigurationName:'generic_combobox'
												 ,idAttribute:'limit_combobox'
												 ,selectedOptionValue:limit})
			the_recipe.options.dbPush("50").dbPush("100").dbPush("200").dbPush("400").dbPush("500")
			
			the_recipe.onchangeAttribute=the_parameters.onchangeAttribute;
			break
		case "Hours":
			var the_recipe=new GUIComboBoxRecipe({initialConfigurationName:'generic_combobox',idAttribute:'add_hour_combobox'})
			the_recipe.onchangeAttribute = "myProgram.myHourOnChange()"
			the_recipe.options=this.mainDS.static_labor_hour_list
			break
		case "Quantity":
			
			if(the_parameters.idAttribute == "wo_other__edit_control")
			{
				var the_po_value_index = myProgram.mainDS[the_parameters.gridId+"grid_headings"].dbIndexOf("PO#")
				
				if(myProgram.tempDS[the_parameters.gridId+"grid_list"][the_parameters.rowNumber][the_po_value_index] != "")
				{
					alert("This item is part of a purchase order and cannot be changed")
					return;
				}
			}
			
			var the_recipe=new GUIInputFieldRecipe("{initialConfigurationName:'generic_text_input_field',\
				idAttribute:'add_quantity_field',valueAttribute:1,onfocusAttribute:'myProgram.mySelectOnce()',onblurAttribute:'myProgram.myQuantityValidator()',finalIngredients:{sizeAttribute:'15'}}")
			the_recipe.validateFormat=myProgram.myQuantityValidator
			the_recipe.onchangeAttribute = "myProgram.myQuantityFieldHasChanged()"
			break
		case "Taxable":
			var the_combobox=new GUIComboBoxRecipe({initialConfigurationName:'generic_combobox'});
			//the_combobox.selectedOptionText=myProgram.mainDS.wo_selected_other_rate;
			the_combobox.breakpointOnPrepare=false;
			the_combobox.idAttribute='taxable_combobox'
			the_combobox.options=["Y","N"]
			var the_recipe = the_combobox;
			break
		case "Keyword":
			var the_recipe=new GUIInputFieldRecipe("{initialConfigurationName:'generic_text_input_field',\
				idAttribute:'add_keyword_field',finalIngredients:{sizeAttribute:'15'}}")
			//the_recipe.validateFormat="generic_positive_number"
			break
		///////////////////////
		case "Site Id":
			var the_recipe=new GUIInputFieldRecipe("{initialConfigurationName:'generic_text_input_field',\
				idAttribute:'add_site_id_field',finalIngredients:{sizeAttribute:'15'}}")
			//the_recipe.validateFormat="generic_positive_number"
			break
		case "Site Street Address":
			var the_recipe=new GUIInputFieldRecipe("{initialConfigurationName:'generic_text_input_field',\
				idAttribute:'add_site_street_address_field',finalIngredients:{sizeAttribute:'15'}}")
			//the_recipe.validateFormat="generic_positive_number"
			break
		case "Site Voice Phone":
			var the_recipe=new GUIInputFieldRecipe("{initialConfigurationName:'generic_text_input_field',\
				idAttribute:'add_site_voice_phone_field',finalIngredients:{sizeAttribute:'15'}}")
			//the_recipe.validateFormat="generic_positive_number"
			break
		case "Site City":
			var the_recipe=new GUIInputFieldRecipe("{initialConfigurationName:'generic_text_input_field',\
				idAttribute:'add_site_city_field',finalIngredients:{sizeAttribute:'15'}}")
			//the_recipe.validateFormat="generic_positive_number"
			break
		case "Site Fax Phone":
			var the_recipe=new GUIInputFieldRecipe("{initialConfigurationName:'generic_text_input_field',\
				idAttribute:'add_site_fax_phone_field',finalIngredients:{sizeAttribute:'15'}}")
			//the_recipe.validateFormat="generic_positive_number"
			break
		case "Site State":
			var the_recipe=new GUIInputFieldRecipe("{initialConfigurationName:'generic_text_input_field',\
				idAttribute:'add_site_state_field',finalIngredients:{sizeAttribute:'15'}}")
			//the_recipe.validateFormat="generic_positive_number"
			break
		case "Site Zip Code":
			var the_recipe=new GUIInputFieldRecipe("{initialConfigurationName:'generic_text_input_field',\
				idAttribute:'add_site_zip_code_field',finalIngredients:{sizeAttribute:'15'}}")
			//the_recipe.validateFormat="generic_positive_number"
			break
		case "Site Dispatch Note":
			var the_recipe=new GUIInputFieldRecipe("{initialConfigurationName:'generic_text_input_field',\
				idAttribute:'add_site_dispatch_note_field',finalIngredients:{sizeAttribute:'15'}}")
			//the_recipe.validateFormat="generic_positive_number"
			break
		case "Site Directions":
			var the_recipe=new GUIInputFieldRecipe("{initialConfigurationName:'generic_text_input_field',\
				idAttribute:'add_site_directions_field',finalIngredients:{sizeAttribute:'15'}}")
			//the_recipe.validateFormat="generic_positive_number"
			break
			
		case "site_contact_one_first_name":
			var the_recipe=new GUIInputFieldRecipe("{initialConfigurationName:'generic_text_input_field',\
				idAttribute:'add_site_contact_one_first_name_field',finalIngredients:{sizeAttribute:'15'}}")
			//the_recipe.validateFormat="generic_positive_number"
			break
		case "site_contact_one_last_name":
			var the_recipe=new GUIInputFieldRecipe("{initialConfigurationName:'generic_text_input_field',\
				idAttribute:'add_site_contact_one_last_name_field',finalIngredients:{sizeAttribute:'15'}}")
			//the_recipe.validateFormat="generic_positive_number"
			break
		case "site_contact_one_title":
			var the_recipe=new GUIInputFieldRecipe("{initialConfigurationName:'generic_text_input_field',\
				idAttribute:'add_site_contact_one_title_field',finalIngredients:{sizeAttribute:'15'}}")
			//the_recipe.validateFormat="generic_positive_number"
			break
		case "site_contact_one_salutation":
			var the_recipe=new GUIInputFieldRecipe("{initialConfigurationName:'generic_text_input_field',\
				idAttribute:'add_site_contact_one_salutation_field',finalIngredients:{sizeAttribute:'15'}}")
			//the_recipe.validateFormat="generic_positive_number"
			break
		case "site_contact_one_phone":
			var the_recipe=new GUIInputFieldRecipe("{initialConfigurationName:'generic_text_input_field',\
				idAttribute:'add_site_contact_one_phone_field',finalIngredients:{sizeAttribute:'15'}}")
			//the_recipe.validateFormat="generic_positive_number"
			break
		case "site_contact_one_ext":
			var the_recipe=new GUIInputFieldRecipe("{initialConfigurationName:'generic_text_input_field',\
				idAttribute:'add_site_contact_one_ext_field',finalIngredients:{sizeAttribute:'15'}}")
			//the_recipe.validateFormat="generic_positive_number"
			break
		case "site_contact_one_fax_phone":
			var the_recipe=new GUIInputFieldRecipe("{initialConfigurationName:'generic_text_input_field',\
				idAttribute:'add_site_contact_one_fax_phone_field',finalIngredients:{sizeAttribute:'15'}}")
			//the_recipe.validateFormat="generic_positive_number"
			break
		case "site_contact_one_email_address":
			var the_recipe=new GUIInputFieldRecipe("{initialConfigurationName:'generic_text_input_field',\
				idAttribute:'add_site_contact_one_email_address_field',finalIngredients:{sizeAttribute:'15'}}")
			//the_recipe.validateFormat="generic_positive_number"
			break
		//////////////////////
		case "PO#":
			alert("The Purchase Order Number cannot be changed")
			return;
			break
		case "PO#Field":
			var the_recipe=new GUIInputFieldRecipe("{initialConfigurationName:'generic_text_input_field',\
				idAttribute:'add_po_field',finalIngredients:{sizeAttribute:'15'}}")
			break;
		case "Original Caller":
			var the_recipe=new GUIInputFieldRecipe("{initialConfigurationName:'generic_text_input_field',\
				idAttribute:'original_caller_field',finalIngredients:{sizeAttribute:'15'}}")
			//the_recipe.validateFormat="generic_positive_number"
			break
		case "Date Scheduled":
			var the_recipe=new GUIInputFieldRecipe("{initialConfigurationName:'generic_text_input_field',\
				idAttribute:'date_scheduled_field',valueAttribute:'"+this.myEditRecipeFor({"recipeName":"System Date"})+"',readonlyAttribute:true,finalIngredients:{sizeAttribute:'15'}}")
			the_recipe.validateFormat="generic_date"
			break
		case "Time Scheduled":
			var the_combobox=new GUIComboBoxRecipe({initialConfigurationName:'generic_combobox'});
			//the_combobox.selectedOptionText=myProgram.mainDS.wo_selected_other_rate;
			the_combobox.breakpointOnPrepare=false;
		//	the_combobox.onChangeAttribute = "myProgram.updateOtherRateDescription()"
			the_combobox.idAttribute='time_scheduled_combobox';
			if(this.mainDS.static_scheduled_time_list == null) this.mainDS.static_scheduled_time_list = []
			the_combobox.options=this.mainDS.static_scheduled_time_list
			var the_recipe = the_combobox;
			//var the_recipe=new GUIInputFieldRecipe("{initialConfigurationName:'generic_text_input_field',\
			//	idAttribute:'time_scheduled_field',finalIngredients:{sizeAttribute:'15'}}")
			//the_recipe.validateFormat="generic_positive_number"
			break
		case "Unit Cost":
			var the_recipe = this.myUnitCostRecipe()
			
			break
		case "Other Rate Id":
		
			if(the_parameters.idAttribute == "wo_other__edit_control")
			{
				//Check to see if there is a purchase order asociated with this other item.
				//If there is, nothing can be edited.
				
				//Locate the po value of the row.
				var the_po_value_index = myProgram.mainDS.wo_other_grid_headings.dbIndexOf("PO#")
				
				if(myProgram.tempDS.wo_other_grid_list[the_parameters.rowNumber][the_po_value_index] != "")
				{
					alert("This other item is part of a purchase order and cannot be changed")
					return;
				}
			}
			var oneditcontrolArray = []
			oneditcontrolArray.push("myProgram.updateOtherRateDescriptionCell");
			if(this.isWorkOrderCOD())
			{
				oneditcontrolArray.push("myProgram.updateOtherUnitPriceCell")
				if(this.isWorkOrderTaxable())
				{
					oneditcontrolArray.push("myProgram.updateOtherTaxableCell")
				}
				if(this.isPOPage())
				{
					oneditcontrolArray.push("myProgram.updateOtherUnitCostCell")
				}
			}
			
			//2005-12-16 (jc)-[542]-Adding the oneditcontrol attribute. 
			var the_combobox=new GUIComboBoxRecipe({initialConfigurationName:'generic_combobox',oneditcontrolAttribute:oneditcontrolArray,onchangeAttribute:"myProgram.updateOtherRateDescription()"});
			var the_rows_recipe=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'});
			the_rows_recipe.filterValues=[].dbPush(myProgram.mainDS.current_workorder_id);
			the_rows_recipe.filterOnSourceHeadings=[].dbPush(myProgram.mainDS.wo_id_heading);
			the_rows_recipe.sourceRows=this.mainDS.static_other_rate_list;
			the_rows_recipe.sourceHeadings=myProgram.mainDS.static_other_rate_headings;
			the_rows_recipe.targetHeadings=[].dbPush(myProgram.mainDS.wo_other_rate_id_heading);
			the_rows_recipe.sortOnSourceHeadings=[];
			the_combobox.selectedOptionText=myProgram.mainDS.wo_selected_other_rate;
			the_combobox.breakpointOnPrepare=false;
		//	the_combobox.onchangeAttribute = "myProgram.updateOtherRateDescription()"
			the_combobox.idAttribute='add_other_rate_combobox';
			the_combobox.options=the_rows_recipe.prepare();
			var the_recipe = the_combobox;
			//alert(the_combobox.prepare())
			break;
		/*case "Part Number":
			if(the_parameters.idAttribute == "wo_material__edit_control" || the_parameters.idAttribute == "wo_other__edit_control")
			{
				var the_po_value_index = myProgram.mainDS[the_parameters.gridId+"grid_headings"].dbIndexOf("PO#")
				
				if(myProgram.tempDS[the_parameters.gridId+"grid_list"][the_parameters.rowNumber][the_po_value_index] != "")
				{
					alert("This item is part of a purchase order and cannot be changed")
					return;
				}
			}
			var the_combobox=new GUIComboBoxRecipe({initialConfigurationName:'generic_combobox'});
			var the_rows_recipe=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'});
			the_rows_recipe.filterValues=[].dbPush(myProgram.mainDS.current_workorder_id);
			the_rows_recipe.filterOnSourceHeadings=[].dbPush(myProgram.mainDS.wo_id_heading);
			the_rows_recipe.sourceRows=this.inventoryDS["static_part_list"]
			the_rows_recipe.sourceHeadings=myProgram.inventoryDS.static_part_headings;
			the_rows_recipe.targetHeadings=[].dbPush("Part Number");
			the_rows_recipe.sortOnSourceHeadings=[];
			the_combobox.selectedOptionText=myProgram.mainDS.wo_selected_part;
			the_combobox.breakpointOnPrepare=false;
			the_combobox.idAttribute='add_part_combobox';
			the_combobox.lookupAttribute = "myProgram.myPartsSearchWindow"
			the_combobox.options=the_rows_recipe.prepare();
			the_combobox.post_load_option = "static_part_select_list";
			var the_recipe = the_combobox;
			break;*/
		case "Flat Rate Id":
			var the_recipe=new GUIInputFieldRecipe("{initialConfigurationName:'generic_text_input_field',\
													'oneditcontrolAttribute':'myProgram.updateFlatRateDescriptionCell',\
				idAttribute:'flat_rate_id_field',readonlyAttribute:true,finalIngredients:{sizeAttribute:'15'}}")
			the_recipe.lookupAttribute = "myProgram.myPartsSearchWindow"
			//the_recipe.valueAttribute = this.myFirstFlatRateId()
			
			break;
		case "Price":
			var the_recipe = "<div style='width=100;border:1px solid black;text-align:center' id='priceDiv'>"+this.myDefaultPrice();+"</div>"
			break;
		case "Unit Price":
			var the_recipe = this.myUnitPriceRecipe()
			break;
		case "Part Number":
			if(the_parameters.idAttribute == "wo_material__edit_control" || the_parameters.idAttribute == "wo_other__edit_control")
			{
				var the_po_value_index = myProgram.mainDS[the_parameters.gridId+"grid_headings"].dbIndexOf("PO#")
				
				if(myProgram.tempDS[the_parameters.gridId+"grid_list"][the_parameters.rowNumber][the_po_value_index] != "")
				{
					alert("This item is part of a purchase order and cannot be changed")
					return;
				}
			}
			
		
			var editArray;
			if(this.isPOPage())
			{
				editArray = ["myProgram.updateInventoryDescriptionCell","myProgram.updateMaterialUnitCostCell"]
			}
			else if(this.isWorkOrderCOD())
			{
				editArray = ["myProgram.updateInventoryDescriptionCell","myProgram.updateMaterialUnitPriceCell"]
			}
			else
			{
				editArray = ["myProgram.updateInventoryDescriptionCell"]
			}
			var the_recipe=new GUIInputFieldRecipe({initialConfigurationName:'generic_text_input_field',
													'oneditcontrolAttribute':editArray,
				idAttribute:'part_number_field',readonlyAttribute:true,finalIngredients:{sizeAttribute:'15'}})
			the_recipe.lookupAttribute = "myProgram.myPartsSearchWindow"
			break;
		case "PO#":
			var the_recipe=new GUIInputFieldRecipe("{initialConfigurationName:'generic_text_input_field',\
				idAttribute:'po_number_field',finalIngredients:{sizeAttribute:'15'}}")
			break
		case "Labor Type Id":
			var the_combobox=new GUIComboBoxRecipe({initialConfigurationName:'generic_combobox'
												   ,oneditcontrolAttribute:['myProgram.updateLaborDescriptionCell','myProgram.updateLaborUnitPriceCell']});
			var the_rows_recipe=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'});
			the_rows_recipe.filterValues=[].dbPush(myProgram.mainDS.current_workorder_id);
			the_rows_recipe.filterOnSourceHeadings=[].dbPush(myProgram.mainDS.wo_id_heading);
			the_rows_recipe.sourceRows=this.mainDS.static_labor_type_list;
			the_rows_recipe.sourceHeadings=myProgram.mainDS.po_number_field;
			the_rows_recipe.targetHeadings=[].dbPush(myProgram.mainDS.static_labor_type_id_heading);
			the_rows_recipe.sortOnSourceHeadings=[];
			var tech_labor_type_index = this.mainDS.tech_info_headings.dbIndexOf("tech_labor_type_id")
			var tech_labor_type_id = this.mainDS.tech_info_list[0][tech_labor_type_index];
			
			the_combobox.selectedOptionText=tech_labor_type_id
			the_combobox.breakpointOnPrepare=false;
			the_combobox.idAttribute='add_labor_type_combobox';
			the_combobox.onchangeAttribute = "myProgram.myLaborTypeIdChanged()"
			the_combobox.options=the_rows_recipe.prepare();
			
			var the_recipe=the_combobox;
			break
		case "Pay Type Id":
			var the_combobox=new GUIComboBoxRecipe({initialConfigurationName:'generic_combobox'});
			var the_rows_recipe=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'});
			the_rows_recipe.sourceRows=this.mainDS.static_pay_type_list;
			the_rows_recipe.sourceHeadings=myProgram.mainDS.static_pay_type_headings;
			the_rows_recipe.targetHeadings=[].dbPush("Pay Type Id");
			the_rows_recipe.sortOnSourceHeadings=[];
			var tech_pay_type_index = this.mainDS.tech_info_headings.dbIndexOf("tech_pay_type_id")
			the_combobox.selectedOptionText=this.mainDS.tech_info_list[0][tech_pay_type_index];
			the_combobox.breakpointOnPrepare=false;
			the_combobox.idAttribute='add_pay_type_combobox';
			the_combobox.options=the_rows_recipe.prepare();
			
			var the_recipe=the_combobox;
			break
		case "Description":
			alert('the Description cannot be changed')
			return null
		case "Unit Price":
			var the_recipe=new GUIInputFieldRecipe("{initialConfigurationName:'generic_text_input_field',\
				idAttribute:'add_unit_cost_field',finalIngredients:{sizeAttribute:'15'}}")
			the_recipe.validateFormat="generic_positive_number"
			break
		case "Manufacturer":
			var the_recipe=new GUIInputFieldRecipe("{initialConfigurationName:'generic_text_input_field',\
				idAttribute:'add_manufacturer_field',finalIngredients:{sizeAttribute:'25'}}")
				the_recipe.styleAttribute+=";background-color:#7ac98e;"
				
			break
		case "Measurement Value":
			var the_recipe=new GUIInputFieldRecipe("{initialConfigurationName:'generic_text_input_field',\
				idAttribute:'add_metrics_field',finalIngredients:{sizeAttribute:'15'}}")
			break
		case "Model":
			var the_recipe=new GUIInputFieldRecipe("{initialConfigurationName:'generic_text_input_field',\
				idAttribute:'add_model_field',finalIngredients:{sizeAttribute:'15'}}")
				the_recipe.styleAttribute+=";background-color:#7ac98e;"
				
			break
		case "Serial Number":
			var the_recipe=new GUIInputFieldRecipe("{initialConfigurationName:'generic_text_input_field',\
				idAttribute:'add_serial_number_field',finalIngredients:{sizeAttribute:'13'}}")
				the_recipe.styleAttribute+=";background-color:#7ac98e;"
				
			break
		case "Equipment Name":
			var the_recipe=new GUIInputFieldRecipe("{initialConfigurationName:'generic_text_input_field',\
				idAttribute:'add_equipment_name_field',finalIngredients:{sizeAttribute:'25',maxlengthAttribute:'40'}}")
				the_recipe.maxLengthAttribute = '40'
				the_recipe.styleAttribute+=";background-color:#7ac98e;"
				the_recipe.validateFormat=myProgram.myEquipmentNameValidator
			break
		case "PM Agreement Type":
			alert("PM Agreement Type cannot to be changed")
			return;
			var the_recipe=new GUIInputFieldRecipe("{initialConfigurationName:'generic_text_input_field',\
				idAttribute:'add_pm_agreement_type_field',finalIngredients:{sizeAttribute:'15'}}")
			break
		case "Warranty Expires":
			alert("Warranty Expires date cannot to be changed")
			return;
			var the_recipe=new GUIInputFieldRecipe("{initialConfigurationName:'generic_text_input_field',\
				idAttribute:'add_warranty_expires_field',finalIngredients:{sizeAttribute:'15'}}")
			the_recipe.validateFormat="generic_date"
			break
		case "New Equipment Id":
			var the_recipe=new GUIInputFieldRecipe("{initialConfigurationName:'generic_text_input_field',\
				idAttribute:'add_new_equipment_id_field',finalIngredients:{sizeAttribute:'7'}}")
			the_recipe.onblurAttribute = 'myProgram.myGeneralIdValidator()' //2007-06-20 (jc)-[1707]-New ID validation
			the_recipe.styleAttribute+=";background-color:#7ac98e;"
			the_recipe.maxlengthAttribute="15"
			break
	}
	if(the_recipe==null)
	{
		the_recipe=new GUIComboBoxRecipe
	}
	if(the_parameters.idAttribute!=null)
	{
		the_recipe.idAttribute=the_parameters.idAttribute
	}
	if(the_parameters.recipeValueLocation!=null)
	{
		var the_location=the_parameters.recipeValueLocation
		var the_constructor=the_recipe.constructor
		if(the_constructor==GUIComboBoxRecipe)
		{
			the_recipe.selectedOptionText=this.mainDS[the_location]
		}
		else
		{
			the_recipe.valueAttribute=this.mainDS[the_location]
		}
	}
	if(the_parameters.recipeValue!=null)
	{
		var the_constructor=the_recipe.constructor
		if(the_constructor==GUIComboBoxRecipe)
		{
			the_recipe.selectedOptionText=the_parameters.recipeValue
		}
		else
		{
			the_recipe.valueAttribute=the_parameters.recipeValue
		}
	}
	if(the_parameters.sizeAttribute!=null)
	{
		the_recipe.sizeAttribute=the_parameters.sizeAttribute
	}
//	the_recipe.styleAttribute='font-size:10;background-color:red'
	the_recipe.alert=false
	return the_recipe	
}
window.MyRecipe.prototype.myEditRecipeFor._methodName='myEditRecipeFor'
window.MyRecipe.prototype.mySetWorkRequestedFromWorkCode = function(passedWindow)
{
	var work_code_combobox = passedWindow['work_code_combobox']
	var selectedIndex = work_code_combobox.selectedIndex;
	var work_code = work_code_combobox.options[selectedIndex].value;
	
	var the_cell_locator=new SUITableCellValueLocatorRecipe({initialConfigurationName:"generic_table_cell_value_locator"})
	the_cell_locator.tableRows=this.mainDS.static_work_code_list
	the_cell_locator.tableHeadings=this.mainDS.static_work_code_headings
	the_cell_locator.tableLocatorHeading="WorkCodeId"
	the_cell_locator.tableLocatorFilter=work_code
	the_cell_locator.tableTargetCellHeading="WorkCodeDescription"
	var workCodeDescription=the_cell_locator.prepare()
	
	if(workCodeDescription == null) workCodeDescription = ""
	
	var the_work_requested_text_area = window['work_requested_text_area']
	if(the_work_requested_text_area != null)
	{
		if(the_work_requested_text_area.value.dbTrim() == "")
		{
			the_work_requested_text_area.focus()
			the_work_requested_text_area.value = workCodeDescription+"\r\n";
			the_work_requested_text_area.selectionStart = the_work_requested_text_area.value.length;
			return
		}
	}
}
window.MyRecipe.prototype.mySetWorkRequestedFromWorkCode._methodName='mySetWorkRequestedFromWorkCode'
window.MyRecipe.prototype.myFilterWorkCodeByServiceCategory = function(passedWindow)
{
	var service_category_combobox = passedWindow['service_category_combobox']
	var selectedIndex = service_category_combobox.selectedIndex;
	var service_category = service_category_combobox.options[selectedIndex].value;
	
	var workCodeComboboxDiv = passedWindow['workCodeComboboxDiv']
	workCodeComboboxDiv.innerHTML = this.myEditRecipeFor({"recipeName":"Work Code","serviceCategoryId":service_category}).prepare();
}
window.MyRecipe.prototype.myFilterWorkCodeByServiceCategory._methodName='myFilterWorkCodeByServiceCategory'
window.MyRecipe.prototype.myEditControl = function(the_cell_contents,the_grid_id,the_cell_id,the_heading,the_row_number,the_column_number)
{
	if(this.tempDS.current_edit_control!=null)
	{
		this.myEditControlCancel();
	}
	else
	{
		the_element=window[the_cell_id]
		var the_grid_element
		
		if(window[the_grid_id].length != null)
		{
			the_grid_element = window[the_grid_id][0]
		}
		else
		{
			the_grid_element = window[the_grid_id]		
		}
		
		if(the_grid_element.disallowEditTransmitted == "true")
		{
			var rn_index = this.mainDS[the_grid_id+"grid_headings"].dbIndexOf("RN")
			var rn_value = this.tempDS[the_grid_id+"grid_list"][the_row_number][rn_index]
			
			var the_cell_locator=new SUITableCellValueLocatorRecipe({initialConfigurationName:"generic_table_cell_value_locator"})
			the_cell_locator.tableRows=this.mainDS[the_grid_id+"list"]
			the_cell_locator.tableHeadings=this.mainDS[the_grid_id+"headings"]
			the_cell_locator.tableLocatorHeading="RN"
			the_cell_locator.tableLocatorFilter=rn_value
			the_cell_locator.tableTargetCellHeading="Transmitted"
			var transmitted_value=the_cell_locator.prepare()
			
			if(transmitted_value == "y")
			{
				alert("[Ref Code:7] This entry has already been submitted. Additional changes are not permitted")
				return;
			}
		}
		var edit_control={}
		edit_control.rowNumber=the_row_number
		edit_control.columnNumber=the_column_number
		edit_control.cellId=the_cell_id
		edit_control.gridId=the_grid_id
		edit_control.idAttribute=the_grid_id+'_edit_control'
		edit_control.recipeName=the_heading
		
		while(the_cell_contents.indexOf("\"") != -1)
		{
			the_cell_contents = the_cell_contents.replace("\"", "&quot;")
		}
		//the_cell_contents=the_cell_contents.replace(/\\/g,"\\\\")
		edit_control.recipeValue=the_cell_contents
		edit_control.innerHTML=the_element.innerHTML
		edit_control.firstChild=the_element.firstChild
		var the_recipe=this.myEditRecipeFor(edit_control)
		if(the_recipe!=null)
		{
			//2005-12-19 JKC Added the lookup functionality to grid cells.
			var lookUpFunction = the_recipe.lookupAttribute
			
			//2005-12-21 JKC Added the calendar functionality for grid cells
			var calendarOption = the_recipe.calendarAttribute
			var calendarDateFilterLocation = the_recipe.calendarDateFilterLocationAttribute
			var calendarDateFilterDestinationLocation = the_recipe.calendarDateFilterDestinationLocationAttribute
			var calendarDateLocation = the_recipe.calendarDateLocationAttribute
			
			edit_control.controlRecipe=the_recipe
			edit_control.recipe=new GUITemplateRecipe('{"initialConfigurationName":"generic_template"}')
			edit_control.recipe.template.dbPush(the_recipe)
			edit_control.recipe.template.dbPush('<br/><a href="#abc" onclick="myProgram.myEditControlApply()" >apply</a>')
			edit_control.recipe.template.dbPush('&nbsp|&nbsp<a href="#abc" onclick="myProgram.myEditControlCancel()" >cancel</a>')
			if(lookUpFunction != null)
			{
				edit_control.recipe.template.dbPush('&nbsp|&nbsp<a href="#abc" onclick='+lookUpFunction+'(\''+the_recipe.idAttribute+'\') >lookup</a>')
			}
			/*var tempDiv = document.createElement("DIV")
			tempDiv.innerHTML = "<div>"+edit_control.recipe.prepare()+"</div>"
			the_element.removeChild(the_element.firstChild)
			the_element.appendChild(tempDiv.firstChild)*/
			sysFunctions.setInnerHTMLForElement(the_element, "<div style='display:inline'>"+edit_control.recipe.prepare()+"</div>")
			
			if(calendarOption != null)
			{
				var filter_index = this.mainDS[edit_control.gridId+"headings"].dbIndexOf(calendarDateFilterLocation);
				var filter_value = this.mainDS[edit_control.gridId+"list"][edit_control.rowNumber][filter_index]
				//this.tempDS["last_"+calendarDateFilterDestinationLocation] = this.tempDS[calendarDateFilterDestinationLocation]
				this.tempDS[calendarDateFilterDestinationLocation] = filter_value
				the_element.innerHTML = the_element.innerHTML+this.myCalendarButtonRecipe(edit_control.controlRecipe.idAttribute, calendarDateLocation, calendarDateFilterDestinationLocation)
			}	
			
			edit_control.editElement=window[edit_control.idAttribute]
			
			this.tempDS.current_edit_control=edit_control
			if(edit_control.editElement != null)edit_control.editElement.focus()
		}
	}
}
window.MyRecipe.prototype.myEditControl._methodName='myEditControl'
window.MyRecipe.prototype.updateLaborDescriptionCell = function(the_new_labor_type_id, rowNumber, columnNumber, the_rn)
{
	var the_headings=this.mainDS.wo_labor_headings
	var the_description_index = the_headings.dbIndexOf("Description");		
	
	//Locate the description based on the new labor_type_id
	var the_cell_locator=new SUITableCellValueLocatorRecipe({initialConfigurationName:"generic_table_cell_value_locator"})
	the_cell_locator.tableRows=this.mainDS.static_labor_type_list
	the_cell_locator.tableHeadings=this.mainDS.static_labor_type_headings
	the_cell_locator.tableLocatorHeading="Labor Type Id"
	the_cell_locator.tableLocatorFilter=the_new_labor_type_id
	the_cell_locator.tableTargetCellHeading="Description"
	var the_new_description=the_cell_locator.prepare()
	
	var the_cell_locator=new SUITableCellValueLocatorRecipe({initialConfigurationName:"generic_table_cell_value_locator"})
	the_cell_locator.tableRows=this.mainDS.wo_labor_list
	the_cell_locator.tableHeadings=this.mainDS.wo_labor_headings
	the_cell_locator.tableLocatorHeading="RN"
	the_cell_locator.tableLocatorFilter=the_rn
	the_cell_locator.tableTargetCellHeading="Description"
	the_cell_locator.tableCellNewValue=the_new_description
	var the_old_description = the_cell_locator.prepare()
	return null
}
window.MyRecipe.prototype.updateLaborDescriptionCell._methodName='updateLaborDescriptionCell'
window.MyRecipe.prototype.isPOPage = function()
{
	return (myProgram.mainDS.current_page == "edit_purchase_orders_page" || myProgram.mainDS.current_page == "view_purchase_orders_page")
}
window.MyRecipe.prototype.isPOPage._methodName='isPOPage'
window.MyRecipe.prototype.isPOMaterialRow = function(the_rn)
{
	if(this.isPOPage()) return true;
	
	var the_cell_locator=new SUITableCellValueLocatorRecipe({initialConfigurationName:"generic_table_cell_value_locator"})
	the_cell_locator.tableRows=myProgram.mainDS.wo_material_list
	the_cell_locator.tableHeadings=myProgram.mainDS.wo_material_headings
	the_cell_locator.tableLocatorHeading="RN"
	the_cell_locator.tableLocatorFilter=the_rn
	the_cell_locator.tableTargetCellHeading="PO#"
	var po = the_cell_locator.prepare()
	
	if(po != "") return true
}
window.MyRecipe.prototype.isPOMaterialRow._methodName='isPOMaterialRow'
window.MyRecipe.prototype.getUnitCostForPOMaterial = function(the_rn)
{
	if(this.isPOPage())
	{
		var the_cell_locator=new SUITableCellValueLocatorRecipe({initialConfigurationName:"generic_table_cell_value_locator"})
		the_cell_locator.tableRows=myProgram.tempDS.wo_po_material_list
		the_cell_locator.tableHeadings=myProgram.mainDS.wo_po_material_headings
		the_cell_locator.tableLocatorHeading="RN"
		the_cell_locator.tableLocatorFilter=the_rn
		the_cell_locator.tableTargetCellHeading="Unit Cost"
		var unitCost = the_cell_locator.prepare()
	}
	else
	{
		var the_cell_locator=new SUITableCellValueLocatorRecipe({initialConfigurationName:"generic_table_cell_value_locator"})
		the_cell_locator.tableRows=myProgram.mainDS.wo_material_list
		the_cell_locator.tableHeadings=myProgram.mainDS.wo_material_headings
		the_cell_locator.tableLocatorHeading="RN"
		the_cell_locator.tableLocatorFilter=the_rn
		the_cell_locator.tableTargetCellHeading="Unit Cost"
		var unitCost = the_cell_locator.prepare()
	}
	return unitCost
}
window.MyRecipe.prototype.getUnitCostForPOMaterial._methodName='getUnitCostForPOMaterial'
window.MyRecipe.prototype.updateMaterialUnitPriceCell = function(partNumber, rowNumber, columnNumber, the_rn)
{
	if(myProgram.isPOPage())
	{
		var the_cell_locator=new SUITableCellValueLocatorRecipe({initialConfigurationName:"generic_table_cell_value_locator"})
		the_cell_locator.tableRows=myProgram.tempDS.wo_po_material_list
		the_cell_locator.tableHeadings=myProgram.mainDS.wo_po_material_headings
		the_cell_locator.tableLocatorHeading="RN"
		the_cell_locator.tableLocatorFilter=the_rn
		the_cell_locator.tableTargetCellHeading="Unit Cost"
		var unitCost = the_cell_locator.prepare()
		
		var newUnitPrice = myProgram.getPOMaterialUnitPrice(partNumber, unitCost)
	}
	else
	{
		var newUnitPrice = myProgram.calculateUnitPriceForPartNumber(partNumber);
	}
	
	if(myProgram.isPOPage())
	{
		var the_cell_locator=new SUITableCellValueLocatorRecipe({initialConfigurationName:"generic_table_cell_value_locator"})
		the_cell_locator.tableRows=myProgram.tempDS.wo_po_material_list
		the_cell_locator.tableHeadings=myProgram.mainDS.wo_po_material_headings
		the_cell_locator.tableLocatorHeading="RN"
		the_cell_locator.tableLocatorFilter=the_rn
		the_cell_locator.tableTargetCellHeading="Unit Price"
		the_cell_locator.tableCellNewValue=newUnitPrice
		var the_old_unit_price = the_cell_locator.prepare()
		
		var the_unit_price_grid_index = myProgram.mainDS.wo_po_material_grid_headings.dbIndexOf("Unit Price");
	}
	else
	{	
		var the_cell_locator=new SUITableCellValueLocatorRecipe({initialConfigurationName:"generic_table_cell_value_locator"})
		the_cell_locator.tableRows=myProgram.mainDS.wo_material_list
		the_cell_locator.tableHeadings=myProgram.mainDS.wo_material_headings
		the_cell_locator.tableLocatorHeading="RN"
		the_cell_locator.tableLocatorFilter=the_rn
		the_cell_locator.tableTargetCellHeading="Unit Price"
		the_cell_locator.tableCellNewValue=newUnitPrice
		var the_old_unit_price = the_cell_locator.prepare()
		
		var the_unit_price_grid_index = myProgram.mainDS.wo_material_grid_headings.dbIndexOf("Unit Price");
	}
	
	var return_array = {}
	return_array["old_value"] = the_old_unit_price
	return_array["new_value"] = newUnitPrice
	return_array["column"] = the_unit_price_grid_index+1;
	return_array["recipeAffected"] = "Unit Price"
	
	return return_array
}
window.MyRecipe.prototype.updateMaterialUnitPriceCell._methodName='updateMaterialUnitPriceCell'
window.MyRecipe.prototype.updateLaborUnitPriceCell = function(laborTypeId, rowNumber, columnNumber, the_rn)
{
	var newUnitPrice = myProgram.getUnitPriceForLaborTypeId(laborTypeId)
	
	var the_cell_locator=new SUITableCellValueLocatorRecipe({initialConfigurationName:"generic_table_cell_value_locator"})
	the_cell_locator.tableRows=myProgram.mainDS.wo_labor_list
	the_cell_locator.tableHeadings=myProgram.mainDS.wo_labor_headings
	the_cell_locator.tableLocatorHeading="RN"
	the_cell_locator.tableLocatorFilter=the_rn
	the_cell_locator.tableTargetCellHeading="Unit Price"
	the_cell_locator.tableCellNewValue=newUnitPrice
	var the_old_unit_price = the_cell_locator.prepare()
		
	var the_unit_price_grid_index = myProgram.mainDS.wo_labor_grid_headings.dbIndexOf("Unit Price");
	
	var return_array = {}
	return_array["old_value"] = the_old_unit_price
	return_array["new_value"] = newUnitPrice
	return_array["column"] = the_unit_price_grid_index+1;
	return_array["recipeAffected"] = "Unit Price"
	
	return return_array
}
window.MyRecipe.prototype.updateLaborUnitPriceCell._methodName='updateLaborUnitPriceCell'
window.MyRecipe.prototype.myOtherUnitPriceCellHasChanged = function(unitPrice, rowNumber, columnNumber, the_rn)
{
	var return_array = {}
	if(this.isPOPage())
	{
		var the_cell_locator=new SUITableCellValueLocatorRecipe({initialConfigurationName:"generic_table_cell_value_locator"})
		the_cell_locator.tableRows=this.tempDS.wo_po_other_list
		the_cell_locator.tableHeadings=this.mainDS.wo_po_other_headings
		the_cell_locator.tableLocatorHeading="RN"
		the_cell_locator.tableLocatorFilter=the_rn
		the_cell_locator.tableTargetCellHeading="BillQty"
		//the_cell_locator.tableCellNewValue=the_new_description
		var billQty = the_cell_locator.prepare()
		
		var price = (billQty*unitPrice).toFixed(2)
	
		var the_cell_locator=new SUITableCellValueLocatorRecipe({initialConfigurationName:"generic_table_cell_value_locator"})
		the_cell_locator.tableRows=this.tempDS.wo_po_other_list
		the_cell_locator.tableHeadings=this.mainDS.wo_po_other_headings
		the_cell_locator.tableLocatorHeading="RN"
		the_cell_locator.tableLocatorFilter=the_rn
		the_cell_locator.tableTargetCellHeading="Price"
		the_cell_locator.tableCellNewValue=price
		var oldPrice = the_cell_locator.prepare()
		
		var return_array = {}
		return_array["noView"] = true
	}
	else
	{
		var the_cell_locator=new SUITableCellValueLocatorRecipe({initialConfigurationName:"generic_table_cell_value_locator"})
		the_cell_locator.tableRows=this.mainDS.wo_other_list
		the_cell_locator.tableHeadings=this.mainDS.wo_other_headings
		the_cell_locator.tableLocatorHeading="RN"
		the_cell_locator.tableLocatorFilter=the_rn
		the_cell_locator.tableTargetCellHeading="BillQty"
		//the_cell_locator.tableCellNewValue=the_new_description
		var billQty = the_cell_locator.prepare()
		
		var price = (billQty*unitPrice).toFixed(2)
	
		var the_cell_locator=new SUITableCellValueLocatorRecipe({initialConfigurationName:"generic_table_cell_value_locator"})
		the_cell_locator.tableRows=this.mainDS.wo_other_list
		the_cell_locator.tableHeadings=this.mainDS.wo_other_headings
		the_cell_locator.tableLocatorHeading="RN"
		the_cell_locator.tableLocatorFilter=the_rn
		the_cell_locator.tableTargetCellHeading="Price"
		the_cell_locator.tableCellNewValue=price
		var oldPrice = the_cell_locator.prepare()
	
		var gridIndex = this.mainDS.wo_other_grid_headings.dbIndexOf("Price");
	}
	
	return_array["old_value"] = oldPrice
	return_array["new_value"] = price
	return_array["column"] = gridIndex+1;
	return_array["displayOnly"] = true
	return_array["recipeAffected"] = "Price"
	
	return return_array
}
window.MyRecipe.prototype.myOtherUnitPriceCellHasChanged._methodName='myOtherUnitPriceCellHasChanged'
window.MyRecipe.prototype.myMaterialUnitPriceCellHasChanged = function(unitPrice, rowNumber, columnNumber, the_rn)
{
	if(this.isPOPage())
	{
		var the_cell_locator=new SUITableCellValueLocatorRecipe({initialConfigurationName:"generic_table_cell_value_locator"})
		the_cell_locator.tableRows=this.tempDS.wo_po_material_list
		the_cell_locator.tableHeadings=this.mainDS.wo_po_material_headings
		the_cell_locator.tableLocatorHeading="RN"
		the_cell_locator.tableLocatorFilter=the_rn
		the_cell_locator.tableTargetCellHeading="BillQty"
		//the_cell_locator.tableCellNewValue=the_new_description
		var billQty = the_cell_locator.prepare()
	}
	else
	{
		var the_cell_locator=new SUITableCellValueLocatorRecipe({initialConfigurationName:"generic_table_cell_value_locator"})
		the_cell_locator.tableRows=this.mainDS.wo_material_list
		the_cell_locator.tableHeadings=this.mainDS.wo_material_headings
		the_cell_locator.tableLocatorHeading="RN"
		the_cell_locator.tableLocatorFilter=the_rn
		the_cell_locator.tableTargetCellHeading="BillQty"
		//the_cell_locator.tableCellNewValue=the_new_description
		var billQty = the_cell_locator.prepare()
	}
	
	var price = (billQty*unitPrice).toFixed(2)
	
	if(this.isPOPage())
	{		
		var the_cell_locator=new SUITableCellValueLocatorRecipe({initialConfigurationName:"generic_table_cell_value_locator"})
		the_cell_locator.tableRows=this.tempDS.wo_po_material_list
		the_cell_locator.tableHeadings=this.mainDS.wo_po_material_headings
		the_cell_locator.tableLocatorHeading="RN"
		the_cell_locator.tableLocatorFilter=the_rn
		the_cell_locator.tableTargetCellHeading="Price"
		the_cell_locator.tableCellNewValue=price
		var oldPrice = the_cell_locator.prepare()
	}
	else
	{
		var the_cell_locator=new SUITableCellValueLocatorRecipe({initialConfigurationName:"generic_table_cell_value_locator"})
		the_cell_locator.tableRows=this.mainDS.wo_material_list
		the_cell_locator.tableHeadings=this.mainDS.wo_material_headings
		the_cell_locator.tableLocatorHeading="RN"
		the_cell_locator.tableLocatorFilter=the_rn
		the_cell_locator.tableTargetCellHeading="Price"
		the_cell_locator.tableCellNewValue=price
		var oldPrice = the_cell_locator.prepare()
	
		var gridIndex = this.mainDS.wo_material_grid_headings.dbIndexOf("Price");
	}
	
	var return_array = {}
	if(this.isPOPage())return_array["noView"] = true
	return_array["old_value"] = oldPrice
	return_array["new_value"] = price
	return_array["column"] = gridIndex+1;
	return_array["displayOnly"] = true
	return_array["recipeAffected"] = "Price"
	
	return return_array
}
window.MyRecipe.prototype.myMaterialUnitPriceCellHasChanged._methodName='myMaterialUnitPriceCellHasChanged'
window.MyRecipe.prototype.myLaborUnitPriceCellHasChanged = function(unitPrice, rowNumber, columnNumber, the_rn)
{
	var the_cell_locator=new SUITableCellValueLocatorRecipe({initialConfigurationName:"generic_table_cell_value_locator"})
	the_cell_locator.tableRows=this.mainDS.wo_labor_list
	the_cell_locator.tableHeadings=this.mainDS.wo_labor_headings
	the_cell_locator.tableLocatorHeading="RN"
	the_cell_locator.tableLocatorFilter=the_rn
	the_cell_locator.tableTargetCellHeading="BillHours"
	//the_cell_locator.tableCellNewValue=the_new_description
	var billHours = the_cell_locator.prepare()
	
	var price = (billHours*unitPrice).toFixed(2)
	
	var the_cell_locator=new SUITableCellValueLocatorRecipe({initialConfigurationName:"generic_table_cell_value_locator"})
	the_cell_locator.tableRows=this.mainDS.wo_labor_list
	the_cell_locator.tableHeadings=this.mainDS.wo_labor_headings
	the_cell_locator.tableLocatorHeading="RN"
	the_cell_locator.tableLocatorFilter=the_rn
	the_cell_locator.tableTargetCellHeading="Price"
	the_cell_locator.tableCellNewValue=price
	var oldPrice = the_cell_locator.prepare()
	
	var gridIndex = this.mainDS.wo_labor_grid_headings.dbIndexOf("Price");
	
	var return_array = {}
	return_array["old_value"] = oldPrice
	return_array["new_value"] = price
	return_array["column"] = gridIndex+1;
	return_array["displayOnly"] = true
	return_array["recipeAffected"] = "Price"
	
	return return_array
}
window.MyRecipe.prototype.myLaborUnitPriceCellHasChanged._methodName='myLaborUnitPriceCellHasChanged'
window.MyRecipe.prototype.myOtherBillQuantityCellHasChanged = function(billQty, rowNumber, columnNumber, the_rn)
{
	if(this.isPOPage())
	{
		var the_cell_locator=new SUITableCellValueLocatorRecipe({initialConfigurationName:"generic_table_cell_value_locator"})
		the_cell_locator.tableRows=this.tempDS.wo_po_other_list
		the_cell_locator.tableHeadings=this.mainDS.wo_po_other_headings
		the_cell_locator.tableLocatorHeading="RN"
		the_cell_locator.tableLocatorFilter=the_rn
		the_cell_locator.tableTargetCellHeading="Unit Price"
		var unitPrice = the_cell_locator.prepare()
		
		var price = (billQty*unitPrice).toFixed(2)
	
		var the_cell_locator=new SUITableCellValueLocatorRecipe({initialConfigurationName:"generic_table_cell_value_locator"})
		the_cell_locator.tableRows=this.tempDS.wo_po_other_list
		the_cell_locator.tableHeadings=this.mainDS.wo_po_other_headings
		the_cell_locator.tableLocatorHeading="RN"
		the_cell_locator.tableLocatorFilter=the_rn
		the_cell_locator.tableTargetCellHeading="Price"
		the_cell_locator.tableCellNewValue=price
		var oldPrice = the_cell_locator.prepare()
	}
	else
	{
		var the_cell_locator=new SUITableCellValueLocatorRecipe({initialConfigurationName:"generic_table_cell_value_locator"})
		the_cell_locator.tableRows=this.mainDS.wo_other_list
		the_cell_locator.tableHeadings=this.mainDS.wo_other_headings
		the_cell_locator.tableLocatorHeading="RN"
		the_cell_locator.tableLocatorFilter=the_rn
		the_cell_locator.tableTargetCellHeading="Unit Price"
		var unitPrice = the_cell_locator.prepare()
		
		var price = (billQty*unitPrice).toFixed(2)
	
		var the_cell_locator=new SUITableCellValueLocatorRecipe({initialConfigurationName:"generic_table_cell_value_locator"})
		the_cell_locator.tableRows=this.mainDS.wo_other_list
		the_cell_locator.tableHeadings=this.mainDS.wo_other_headings
		the_cell_locator.tableLocatorHeading="RN"
		the_cell_locator.tableLocatorFilter=the_rn
		the_cell_locator.tableTargetCellHeading="Price"
		the_cell_locator.tableCellNewValue=price
		var oldPrice = the_cell_locator.prepare()
	
		var gridIndex = this.mainDS.wo_other_grid_headings.dbIndexOf("Price");
	}
	
	var return_array = {}
	if(this.isPOPage()) return_array["noView"] = true
	return_array["old_value"] = oldPrice
	return_array["new_value"] = price
	return_array["column"] = gridIndex+1;
	return_array["displayOnly"] = true
	return_array["recipeAffected"] = "Price"
	
	return return_array
}
window.MyRecipe.prototype.myOtherBillQuantityCellHasChanged._methodName='myOtherBillQuantityCellHasChanged'
window.MyRecipe.prototype.myMaterialBillQuantityCellHasChanged = function(billQty, rowNumber, columnNumber, the_rn)
{
	if(this.isPOPage())
	{
		var the_cell_locator=new SUITableCellValueLocatorRecipe({initialConfigurationName:"generic_table_cell_value_locator"})
		the_cell_locator.tableRows=this.tempDS.wo_po_material_list
		the_cell_locator.tableHeadings=this.mainDS.wo_po_material_headings
		the_cell_locator.tableLocatorHeading="RN"
		the_cell_locator.tableLocatorFilter=the_rn
		the_cell_locator.tableTargetCellHeading="Unit Price"
		var unitPrice = the_cell_locator.prepare()
		
		var price = (billQty*unitPrice).toFixed(2)
	
		var the_cell_locator=new SUITableCellValueLocatorRecipe({initialConfigurationName:"generic_table_cell_value_locator"})
		the_cell_locator.tableRows=this.tempDS.wo_po_material_list
		the_cell_locator.tableHeadings=this.mainDS.wo_po_material_headings
		the_cell_locator.tableLocatorHeading="RN"
		the_cell_locator.tableLocatorFilter=the_rn
		the_cell_locator.tableTargetCellHeading="Price"
		the_cell_locator.tableCellNewValue=price
		var oldPrice = the_cell_locator.prepare()
		
	}
	else
	{
		var the_cell_locator=new SUITableCellValueLocatorRecipe({initialConfigurationName:"generic_table_cell_value_locator"})
		the_cell_locator.tableRows=this.mainDS.wo_material_list
		the_cell_locator.tableHeadings=this.mainDS.wo_material_headings
		the_cell_locator.tableLocatorHeading="RN"
		the_cell_locator.tableLocatorFilter=the_rn
		the_cell_locator.tableTargetCellHeading="Unit Price"
		var unitPrice = the_cell_locator.prepare()
		
		var price = (billQty*unitPrice).toFixed(2)
	
		var the_cell_locator=new SUITableCellValueLocatorRecipe({initialConfigurationName:"generic_table_cell_value_locator"})
		the_cell_locator.tableRows=this.mainDS.wo_material_list
		the_cell_locator.tableHeadings=this.mainDS.wo_material_headings
		the_cell_locator.tableLocatorHeading="RN"
		the_cell_locator.tableLocatorFilter=the_rn
		the_cell_locator.tableTargetCellHeading="Price"
		the_cell_locator.tableCellNewValue=price
		var oldPrice = the_cell_locator.prepare()
		
		var gridIndex = this.mainDS.wo_material_grid_headings.dbIndexOf("Price");
	}
	
	var return_array = {}
	if(this.isPOPage()) return_array["noView"] = true
	return_array["old_value"] = oldPrice
	return_array["new_value"] = price
	return_array["column"] = gridIndex+1;
	return_array["displayOnly"] = true
	return_array["recipeAffected"] = "Price"
	
	return return_array
}
window.MyRecipe.prototype.myMaterialBillQuantityCellHasChanged._methodName='myMaterialBillQuantityCellHasChanged'
window.MyRecipe.prototype.myBillHoursHasChangedOBSOLETE = function(billHours, rowNumber, columnNumber, the_rn)
{
	var the_cell_locator=new SUITableCellValueLocatorRecipe({initialConfigurationName:"generic_table_cell_value_locator"})
	the_cell_locator.tableRows=this.mainDS.wo_labor_list
	the_cell_locator.tableHeadings=this.mainDS.wo_labor_headings
	the_cell_locator.tableLocatorHeading="RN"
	the_cell_locator.tableLocatorFilter=the_rn
	the_cell_locator.tableTargetCellHeading="Unit Price"
	//the_cell_locator.tableCellNewValue=the_new_description
	var unitPrice = the_cell_locator.prepare()
	
	var price = (billHours*unitPrice).toFixed(2)
	
	var the_cell_locator=new SUITableCellValueLocatorRecipe({initialConfigurationName:"generic_table_cell_value_locator"})
	the_cell_locator.tableRows=this.mainDS.wo_labor_list
	the_cell_locator.tableHeadings=this.mainDS.wo_labor_headings
	the_cell_locator.tableLocatorHeading="RN"
	the_cell_locator.tableLocatorFilter=the_rn
	the_cell_locator.tableTargetCellHeading="Price"
	the_cell_locator.tableCellNewValue=price
	var oldPrice = the_cell_locator.prepare()
	
	var gridIndex = this.mainDS.wo_labor_grid_headings.dbIndexOf("Price");
	
	var return_array = {}
	return_array["old_value"] = oldPrice
	return_array["new_value"] = price
	return_array["column"] = gridIndex+1;
	return_array["displayOnly"] = true
	return_array["recipeAffected"] = "Price"
	
	return return_array
}
window.MyRecipe.prototype.myBillHoursHasChangedOBSOLETE._methodName='myBillHoursHasChangedOBSOLETE'
window.MyRecipe.prototype.unitCostChangedUpdateOtherUnitPriceCell = function(unitCost, rowNumber, columnNumber, the_rn)
{
	var return_array = {}
	the_new_other_rate_id = myProgram.mainDS.wo_selected_other_rate
	
	var newUnitPrice = myProgram.getPOOtherUnitPrice(the_new_other_rate_id, unitCost)
	
	var the_cell_locator=new SUITableCellValueLocatorRecipe({initialConfigurationName:"generic_table_cell_value_locator"})
	the_cell_locator.tableRows=myProgram.tempDS.wo_po_other_list
	the_cell_locator.tableHeadings=myProgram.mainDS.wo_po_other_headings
	the_cell_locator.tableLocatorHeading="RN"
	the_cell_locator.tableLocatorFilter=the_rn
	the_cell_locator.tableTargetCellHeading="Unit Price"
	the_cell_locator.tableCellNewValue=newUnitPrice
	var the_old_unit_price = the_cell_locator.prepare()
		
	return_array["noView"] = true	
	
	return_array["old_value"] = the_old_unit_price
	return_array["new_value"] = newUnitPrice
	return_array["recipeAffected"] = "Unit Price"
	
	return return_array
}
window.MyRecipe.prototype.unitCostChangedUpdateOtherUnitPriceCell._methodName='unitCostChangedUpdateOtherUnitPriceCell'
window.MyRecipe.prototype.unitCostChangedUpdateMaterialUnitPriceCell = function(unitCost, rowNumber, columnNumber, the_rn)
{
	var return_array = {}
	
	var the_cell_locator=new SUITableCellValueLocatorRecipe({initialConfigurationName:"generic_table_cell_value_locator"})
	the_cell_locator.tableRows=myProgram.tempDS.wo_po_material_list
	the_cell_locator.tableHeadings=myProgram.mainDS.wo_po_material_headings
	the_cell_locator.tableLocatorHeading="RN"
	the_cell_locator.tableLocatorFilter=the_rn
	the_cell_locator.tableTargetCellHeading="Part Number"
	var partNumber = the_cell_locator.prepare()
	
	var newUnitPrice = myProgram.getPOMaterialUnitPrice(partNumber, unitCost)
	
	var the_cell_locator=new SUITableCellValueLocatorRecipe({initialConfigurationName:"generic_table_cell_value_locator"})
	the_cell_locator.tableRows=myProgram.tempDS.wo_po_material_list
	the_cell_locator.tableHeadings=myProgram.mainDS.wo_po_material_headings
	the_cell_locator.tableLocatorHeading="RN"
	the_cell_locator.tableLocatorFilter=the_rn
	the_cell_locator.tableTargetCellHeading="Unit Price"
	the_cell_locator.tableCellNewValue=newUnitPrice
	var the_old_unit_price = the_cell_locator.prepare()
		
	return_array["noView"] = true	
	
	return_array["old_value"] = the_old_unit_price
	return_array["new_value"] = newUnitPrice
	return_array["recipeAffected"] = "Unit Price"
	
	return return_array
}
window.MyRecipe.prototype.unitCostChangedUpdateMaterialUnitPriceCell._methodName='unitCostChangedUpdateMaterialUnitPriceCell'
window.MyRecipe.prototype.updateOtherUnitPriceCell = function(the_new_other_rate_id, rowNumber, columnNumber, the_rn)
{
	var return_array = {}
	myProgram.mainDS.wo_selected_other_rate = the_new_other_rate_id;
	
	if(myProgram.isPOPage())
	{
		var the_cell_locator=new SUITableCellValueLocatorRecipe({initialConfigurationName:"generic_table_cell_value_locator"})
		the_cell_locator.tableRows=myProgram.tempDS.wo_po_other_list
		the_cell_locator.tableHeadings=myProgram.mainDS.wo_po_other_headings
		the_cell_locator.tableLocatorHeading="RN"
		the_cell_locator.tableLocatorFilter=the_rn
		the_cell_locator.tableTargetCellHeading="Unit Cost"
		var unitCost = the_cell_locator.prepare()
		
		var newUnitPrice = myProgram.getPOOtherUnitPrice(the_new_other_rate_id, unitCost)
	}
	else
	{
		var newUnitPrice = myProgram.calculateUnitPriceForOtherRateId(the_new_other_rate_id)
	}
	
	if(myProgram.mainDS.current_page == "add_po_other_page" || myProgram.mainDS.current_page == "view_po_other_page" || myProgram.mainDS.current_page == "edit_purchase_orders_page" || myProgram.mainDS.current_page == "view_purchase_orders_page")
	{
		var the_cell_locator=new SUITableCellValueLocatorRecipe({initialConfigurationName:"generic_table_cell_value_locator"})
		the_cell_locator.tableRows=myProgram.tempDS.wo_po_other_list
		the_cell_locator.tableHeadings=myProgram.mainDS.wo_po_other_headings
		the_cell_locator.tableLocatorHeading="RN"
		the_cell_locator.tableLocatorFilter=the_rn
		the_cell_locator.tableTargetCellHeading="Unit Price"
		the_cell_locator.tableCellNewValue=newUnitPrice
		var the_old_unit_price = the_cell_locator.prepare()
		
		return_array["noView"] = true	
	}
	else
	{
		var the_cell_locator=new SUITableCellValueLocatorRecipe({initialConfigurationName:"generic_table_cell_value_locator"})
		the_cell_locator.tableRows=myProgram.mainDS.wo_other_list
		the_cell_locator.tableHeadings=myProgram.mainDS.wo_other_headings
		the_cell_locator.tableLocatorHeading="RN"
		the_cell_locator.tableLocatorFilter=the_rn
		the_cell_locator.tableTargetCellHeading="Unit Price"
		the_cell_locator.tableCellNewValue=newUnitPrice
		var the_old_unit_price = the_cell_locator.prepare()
		
		var the_unit_price_grid_index = myProgram.mainDS.wo_other_grid_headings.dbIndexOf("Unit Price");
	}
	
	return_array["old_value"] = the_old_unit_price
	return_array["new_value"] = newUnitPrice
	return_array["column"] = the_unit_price_grid_index+1;
	return_array["recipeAffected"] = "Unit Price"
	
	return return_array
}
window.MyRecipe.prototype.updateOtherUnitPriceCell._methodName='updateOtherUnitPriceCell'
window.MyRecipe.prototype.updateOtherUnitCostCell = function(the_new_other_rate_id, rowNumber, columnNumber, the_rn)
{
	myProgram.mainDS.wo_selected_other_rate = the_new_other_rate_id;
	
	var newUnitCost = myProgram.getUnitCostForOtherRateId(the_new_other_rate_id)
	
	var the_cell_locator=new SUITableCellValueLocatorRecipe({initialConfigurationName:"generic_table_cell_value_locator"})
	the_cell_locator.tableRows=myProgram.tempDS.wo_po_other_list
	the_cell_locator.tableHeadings=myProgram.mainDS.wo_po_other_headings
	the_cell_locator.tableLocatorHeading="RN"
	the_cell_locator.tableLocatorFilter=the_rn
	the_cell_locator.tableTargetCellHeading="Unit Cost"
	the_cell_locator.tableCellNewValue=newUnitCost
	var the_old_unit_cost = the_cell_locator.prepare()
		
	var the_unit_cost_grid_index = myProgram.mainDS.wo_po_other_grid_headings.dbIndexOf("Unit Cost");
	
	var return_array = {}
	return_array["old_value"] = the_old_unit_cost
	return_array["new_value"] = newUnitCost
	return_array["column"] = the_unit_cost_grid_index+1;
	return_array["recipeAffected"] = "Unit Cost"
	
	return return_array
}
window.MyRecipe.prototype.updateOtherUnitCostCell._methodName='updateOtherUnitCostCell'
window.MyRecipe.prototype.updateMaterialUnitCostCell = function(partNumber, rowNumber, columnNumber, the_rn)
{
	var newUnitCost = myProgram.getUnitCostForPartNumber(partNumber)
	
	var the_cell_locator=new SUITableCellValueLocatorRecipe({initialConfigurationName:"generic_table_cell_value_locator"})
	the_cell_locator.tableRows=myProgram.tempDS.wo_po_material_list
	the_cell_locator.tableHeadings=myProgram.mainDS.wo_po_material_headings
	the_cell_locator.tableLocatorHeading="RN"
	the_cell_locator.tableLocatorFilter=the_rn
	the_cell_locator.tableTargetCellHeading="Unit Cost"
	the_cell_locator.tableCellNewValue=newUnitCost
	var the_old_unit_cost = the_cell_locator.prepare()
		
	var the_unit_cost_grid_index = myProgram.mainDS.wo_po_material_grid_headings.dbIndexOf("Unit Cost");
	
	var return_array = {}
	return_array["old_value"] = the_old_unit_cost
	return_array["new_value"] = newUnitCost
	return_array["column"] = the_unit_cost_grid_index+1;
	return_array["recipeAffected"] = "Unit Cost"
	
	return return_array
}
window.MyRecipe.prototype.updateMaterialUnitCostCell._methodName='updateMaterialUnitCostCell'
window.MyRecipe.prototype.updateOtherTaxableCell = function(the_new_other_rate_id, rowNumber, columnNumber, the_rn)
{
	myProgram.mainDS.wo_selected_other_rate = the_new_other_rate_id;
	
	var the_headings=myProgram.mainDS.wo_other_headings
	var the_other_taxable_index = the_headings.dbIndexOf("Taxable");		
	
	var costType = myProgram.getOtherRateCostTypeForId(the_new_other_rate_id)
	var newTaxable = myProgram.myTaxableValue("Tax"+costType);
	
	if(myProgram.mainDS.current_page == "add_po_other_page" || myProgram.mainDS.current_page == "view_po_other_page" || myProgram.mainDS.current_page == "edit_purchase_orders_page" || myProgram.mainDS.current_page == "view_purchase_orders_page")
	{
		var the_cell_locator=new SUITableCellValueLocatorRecipe({initialConfigurationName:"generic_table_cell_value_locator"})
		the_cell_locator.tableRows=myProgram.tempDS.wo_po_other_list
		the_cell_locator.tableHeadings=myProgram.mainDS.wo_po_other_headings
		the_cell_locator.tableLocatorHeading="RN"
		the_cell_locator.tableLocatorFilter=the_rn
		the_cell_locator.tableTargetCellHeading="Taxable"
		the_cell_locator.tableCellNewValue=newTaxable
		var the_old_taxable = the_cell_locator.prepare()
		
		var the_taxable_grid_index = myProgram.mainDS.wo_po_other_grid_headings.dbIndexOf("Taxable");
	}
	else
	{
		var the_cell_locator=new SUITableCellValueLocatorRecipe({initialConfigurationName:"generic_table_cell_value_locator"})
		the_cell_locator.tableRows=myProgram.mainDS.wo_other_list
		the_cell_locator.tableHeadings=myProgram.mainDS.wo_other_headings
		the_cell_locator.tableLocatorHeading="RN"
		the_cell_locator.tableLocatorFilter=the_rn
		the_cell_locator.tableTargetCellHeading="Taxable"
		the_cell_locator.tableCellNewValue=newTaxable
		var the_old_taxable = the_cell_locator.prepare()
		
		var the_taxable_grid_index = myProgram.mainDS.wo_other_grid_headings.dbIndexOf("Taxable");
	}
	
	var return_array = {}
	return_array["old_value"] = the_old_taxable
	return_array["new_value"] = newTaxable
	return_array["column"] = the_taxable_grid_index+1;
	return_array["recipeAffected"] = "Taxable"
	
	return return_array
}
window.MyRecipe.prototype.updateOtherTaxableCell._methodName='updateOtherTaxableCell'
window.MyRecipe.prototype.updateOtherRateDescriptionCell = function(the_new_other_rate_id, rowNumber, columnNumber, the_rn)
{
	this.mainDS.wo_selected_other_rate = the_new_other_rate_id;
	
	var the_headings=this.mainDS.wo_other_headings
	var the_other_description_index = the_headings.dbIndexOf("Other Rate Description");		
	
	//Locate the description based on the new other_rate_id
	var the_headings=this.mainDS.wo_other_headings
	var the_cell_locator=new SUITableCellValueLocatorRecipe({initialConfigurationName:"generic_table_cell_value_locator"})
	the_cell_locator.tableRows=this.mainDS.static_other_rate_list
	the_cell_locator.tableHeadings=this.mainDS.static_other_rate_headings
	the_cell_locator.tableLocatorHeading="Other Rate Id"
	the_cell_locator.tableLocatorFilter=the_new_other_rate_id
	the_cell_locator.tableTargetCellHeading="Other Rate Description"
	var the_new_description=the_cell_locator.prepare()
	
	
	
	if(this.mainDS.current_page == "add_po_other_page" || this.mainDS.current_page == "view_po_other_page" || this.mainDS.current_page == "edit_purchase_orders_page" || this.mainDS.current_page == "view_purchase_orders_page")
	{
		var the_cell_locator=new SUITableCellValueLocatorRecipe({initialConfigurationName:"generic_table_cell_value_locator"})
		the_cell_locator.tableRows=this.tempDS.wo_po_other_list
		the_cell_locator.tableHeadings=this.mainDS.wo_po_other_headings
		the_cell_locator.tableLocatorHeading="RN"
		the_cell_locator.tableLocatorFilter=the_rn
		the_cell_locator.tableTargetCellHeading="Other Rate Description"
		the_cell_locator.tableCellNewValue=the_new_description
		var the_old_description = the_cell_locator.prepare()
		
		var the_description_grid_index = this.mainDS.wo_po_other_grid_headings.dbIndexOf("Other Rate Description");
	}
	else
	{
		var the_cell_locator=new SUITableCellValueLocatorRecipe({initialConfigurationName:"generic_table_cell_value_locator"})
		the_cell_locator.tableRows=this.mainDS.wo_other_list
		the_cell_locator.tableHeadings=this.mainDS.wo_other_headings
		the_cell_locator.tableLocatorHeading="RN"
		the_cell_locator.tableLocatorFilter=the_rn
		the_cell_locator.tableTargetCellHeading="Other Rate Description"
		the_cell_locator.tableCellNewValue=the_new_description
		var the_old_description = the_cell_locator.prepare()
		
		var the_description_grid_index = this.mainDS.wo_other_grid_headings.dbIndexOf("Other Rate Description");
	}
	
	var return_array = {}
	return_array["old_value"] = the_old_description
	return_array["new_value"] = the_new_description
	return_array["column"] = the_description_grid_index+1;
	return_array["recipeAffected"] = "Other Rate Description"
	
	return return_array
}
window.MyRecipe.prototype.updateOtherRateDescriptionCell._methodName='updateOtherRateDescriptionCell'
window.MyRecipe.prototype.updateInventoryDescriptionCell = function(the_part_number, rowNumber, columnNumber, the_rn)
{
	var the_headings=this.inventoryDS.static_part_headings
	var the_description_index = the_headings.dbIndexOf("Description");		
	
	//Locate the description based on the part_id
	var the_headings=this.inventoryDS.static_part_headings
	var the_cell_locator=new SUITableCellValueLocatorRecipe({initialConfigurationName:"generic_table_cell_value_locator"})
	the_cell_locator.tableRows=this.inventoryDS.static_part_list
	the_cell_locator.tableHeadings=this.inventoryDS.static_part_headings
	the_cell_locator.tableLocatorHeading="Part Number"
	the_cell_locator.tableLocatorFilter=the_part_number
	the_cell_locator.tableTargetCellHeading="Description"
	var the_new_description=the_cell_locator.prepare()
	
	if(this.mainDS.current_page == "add_po_other_page" || this.mainDS.current_page == "view_po_other_page" || this.mainDS.current_page == "edit_purchase_orders_page" || this.mainDS.current_page == "view_purchase_orders_page")
	{
		var the_cell_locator=new SUITableCellValueLocatorRecipe({initialConfigurationName:"generic_table_cell_value_locator"})
		the_cell_locator.tableRows=this.tempDS.wo_po_material_list
		the_cell_locator.tableHeadings=this.mainDS.wo_po_material_headings
		the_cell_locator.tableLocatorHeading="RN"
		the_cell_locator.tableLocatorFilter=the_rn
		the_cell_locator.tableTargetCellHeading="Description"
		the_cell_locator.tableCellNewValue=the_new_description
		var the_old_description = the_cell_locator.prepare()
		
		var the_description_grid_index = this.mainDS.wo_po_material_grid_headings.dbIndexOf("Description");
	}
	else
	{
		var the_cell_locator=new SUITableCellValueLocatorRecipe({initialConfigurationName:"generic_table_cell_value_locator"})
		the_cell_locator.tableRows=this.mainDS.wo_material_list
		the_cell_locator.tableHeadings=this.mainDS.wo_material_headings
		the_cell_locator.tableLocatorHeading="RN"
		the_cell_locator.tableLocatorFilter=the_rn
		the_cell_locator.tableTargetCellHeading="Description"
		the_cell_locator.tableCellNewValue=the_new_description
		var the_old_description = the_cell_locator.prepare()
		
		var the_description_grid_index = this.mainDS.wo_material_grid_headings.dbIndexOf("Description");
	}
	
	var return_array = {}
	return_array["old_value"] = the_old_description
	return_array["new_value"] = the_new_description
	return_array["column"] = the_description_grid_index+1;
	
	return return_array
}
window.MyRecipe.prototype.updateInventoryDescriptionCell._methodName='updateInventoryDescriptionCell'
window.MyRecipe.prototype.updateMaterialRateDescriptionCell = function(the_new_part_id, rowNumber, columnNumber)
{
	this.mainDS.wo_selected_part = the_new_part_id;
	
	var the_headings=this.inventoryDS.static_part_headings
	var the_part_description_index = the_headings.dbIndexOf("Description");		
	
	//Locate the description based on the new other_rate_id
	var the_headings=this.mainDS.wo_other_headings
	var the_cell_locator=new SUITableCellValueLocatorRecipe({initialConfigurationName:"generic_table_cell_value_locator"})
	the_cell_locator.tableRows=this.mainDS.static_other_rate_list
	the_cell_locator.tableHeadings=this.mainDS.static_other_rate_headings
	the_cell_locator.tableLocatorHeading="Other Rate Id"
	the_cell_locator.tableLocatorFilter=the_new_other_rate_id
	the_cell_locator.tableTargetCellHeading="Description"
	var the_new_description=the_cell_locator.prepare()
	
	if(this.mainDS.current_page == "add_po_other_page" || this.mainDS.current_page == "view_po_other_page" || this.mainDS.current_page == "edit_purchase_orders_page" || this.mainDS.current_page == "view_purchase_orders_page")
	{
		the_old_description = this.tempDS.wo_po_other_list[rowNumber][the_other_description_index];
		this.tempDS.wo_po_other_list[rowNumber][the_other_description_index] = the_new_description;
	}
	else
	{
		the_old_description = this.mainDS.wo_other_list[rowNumber][the_other_description_index];
		this.mainDS.wo_other_list[rowNumber][the_other_description_index] = the_new_description;
	}
	
	var the_description_grid_index = this.mainDS.wo_other_grid_headings.dbIndexOf("Description");
	
	var return_array = {}
	return_array["old_value"] = the_old_description
	return_array["new_value"] = the_new_description
	return_array["column"] = the_description_grid_index+1;
	
	return return_array
}
window.MyRecipe.prototype.updateMaterialRateDescriptionCell._methodName='updateMaterialRateDescriptionCell'
window.MyRecipe.prototype.myPartNumberContextMenuCodeString = function()
{
	return "myProgram.myPartNumberContextMenu(this)"
}
window.MyRecipe.prototype.myPartNumberContextMenuCodeString._methodName='myPartNumberContextMenuCodeString'
window.MyRecipe.prototype.myPartNumberChooser = function(partNumberInputElement)
{
	myProgram.tempDS.partNumberInputElement = partNumberInputElement
	
	var x = event.clientX
	var y = event.clientY
	
	var height = 550
	
	var object=window['context_menu'];
	object.style.left = 10
	object.style.height = height
	object.style.top = myProgram.myCenteredTopValueForPopupHeight(height)
	object.style.width = 740;
	object.style.zIndex=500
	object.style.display = "block";
	object.innerHTML = myProgram.myPartNumberChooserPage().prepare()
}
window.MyRecipe.prototype.myPartNumberChooser._methodName='myPartNumberChooser'
window.MyRecipe.prototype.myPartNumberChooserPage = function()
{
	var template_recipe=new GUITemplateRecipe({initialConfigurationName:"generic_template"})
	template_recipe.template.dbPush('<div style="font-family:arial;font-size:15;text-align:center;color:black;">Parts Locate</div>')
	template_recipe.template.dbPush('<div style="width:405;height:258;border-style:solid;border-color:#676566;border-width:0 0 0 1;overflow:hidden" id=myPartsSearchGrid>')
	template_recipe.template.dbPush(this.myPartsSearchGrid())
	template_recipe.template.dbPush('</div>')
	template_recipe.template.dbPush("<br/>")
	template_recipe.template.dbPush(this.myPartsSearchForm())
	template_recipe.template.dbPush("<br/>")
	template_recipe.template.dbPush(this.myPartsSearchKeywordTextAreaRecipe())
	template_recipe.template.dbPush("<br/><br/>")
	template_recipe.template.dbPush(this.myClosePartSearchButton())
	template_recipe.template.dbPush("<br/>").dbPush("<br/>")
	template_recipe.template.dbPush('<div style="font-family:arial;font-size:10;color:black;background-color:white;">Results Returned </div>').dbPush(this.myEditRecipeFor({"recipeName":"Results Limit","onchangeAttribute":"myProgram.myPartsSearchResultLimitChange(window)"}))
	
	return template_recipe
}
window.MyRecipe.prototype.myPartNumberChooserPage._methodName='myPartNumberChooserPage'
window.MyRecipe.prototype.myMaximizeContextWindow = function()
{
	var object=document.getElementById('context_menu');
	object.style.top = "0px";
	object.style.left = "0px"
	object.style.height = screen.availHeight;
	object.style.width = screen.availWidth;
}
window.MyRecipe.prototype.myMaximizeContextWindow._methodName='myMaximizeContextWindow'
window.MyRecipe.prototype.myOpenContextMenuWithInnerHTML = function(innerHTML, x, y)
{
	var object=document.getElementById('context_menu');
	object.style.position='absolute';
	object.style.top=y + 'px';
	object.style.left=x + 'px';
	object.style.display = "block"
	object.innerHTML = innerHTML
}
window.MyRecipe.prototype.myOpenContextMenuWithInnerHTML._methodName='myOpenContextMenuWithInnerHTML'
window.MyRecipe.prototype.myCheckIfPOCodeString = function()
{
	return "function(){return myProgram.myCheckIfPO(this)}"
}
window.MyRecipe.prototype.myCheckIfPOCodeString._methodName='myCheckIfPOCodeString'
window.MyRecipe.prototype.otherDescriptionChangedCodeString = function()
{
	return "function(){return myProgram.otherDescriptionChanged(this)}"
}
window.MyRecipe.prototype.otherDescriptionChangedCodeString._methodName='otherDescriptionChangedCodeString'
window.MyRecipe.prototype.updateOtherRateDescriptionCodeString = function()
{
	return "function(){return myProgram.updateOtherRateDescription(this)}"
}
window.MyRecipe.prototype.updateOtherRateDescriptionCodeString._methodName='updateOtherRateDescriptionCodeString'
window.MyRecipe.prototype.updatePOOtherRateDescriptionCodeString = function()
{
	return "function(){myProgram.updatePOOtherRateDescription(this)}"
}
window.MyRecipe.prototype.updatePOOtherRateDescriptionCodeString._methodName='updatePOOtherRateDescriptionCodeString'
window.MyRecipe.prototype.updatePOOtherRateDescription = function(otherRateIdInputField)
{
	var other_rate_id = otherRateIdInputField.getAttribute("mynewvalue");
	var description = this.getOtherRateDescriptionForId(other_rate_id)
	
	var unitCost = this.getUnitCostForOtherRateId(other_rate_id)
	var unitCostInputField = sysFunctions.locateAdjacentColumnInputNode(otherRateIdInputField, "Unit Cost")
	unitCostInputField.value = unitCost
	sysFunctions.updateDataValue(unitCostInputField, unitCost)
	
	if(description!=null)
	{	
		var description_element = sysFunctions.locateAdjacentColumnInputNode(otherRateIdInputField, "Other Rate Description")
		description_element.value = description
		sysFunctions.updateDataValue(description_element, description)
	}
}
window.MyRecipe.prototype.updatePOOtherRateDescription._methodName='updatePOOtherRateDescription'
window.MyRecipe.prototype.myEquipmentOnChange = function(equipmentIdInputField)
{
	if(myProgram.isElementTransmitted(equipmentIdInputField))
	{
		return "[Ref Code:7] This entry has already been submitted. Additional changes are not permitted"			
	}
	var otherRateIdInputField = sysFunctions.locateAdjacentColumnInputNode(equipmentIdInputField, "Other Rate Id")
	var otherRateId = otherRateIdInputField.value;
	var equipmentId = equipmentIdInputField.getAttribute("mynewvalue")
	
	var unitPrice = myProgram.getUnitPrice(otherRateId, equipmentId)
	var unitPriceInputField = sysFunctions.locateAdjacentColumnInputNode(equipmentIdInputField, "Unit Price")
	myProgram.updateUnitPriceField(unitPrice, unitPriceInputField)
}
window.MyRecipe.prototype.myEquipmentOnChange._methodName='myEquipmentOnChange'
window.MyRecipe.prototype.updateOtherRateDescription = function(otherRateIdInputField)
{   
	if(myProgram.isElementTransmitted(otherRateIdInputField))
	{
		return "[Ref Code:7] This entry has already been submitted. Additional changes are not permitted"			
	}
	var other_rate_id = otherRateIdInputField.getAttribute("mynewvalue");
	var description = this.getOtherRateDescriptionForId(other_rate_id)
	
	if(this.isWorkOrderCOD())
	{
		var equipmentIdInputField = sysFunctions.locateAdjacentColumnInputNode(otherRateIdInputField, "Equipment Id")
		var unitPrice = myProgram.getUnitPrice(other_rate_id, equipmentIdInputField.value)
		var unitPriceInputField = sysFunctions.locateAdjacentColumnInputNode(otherRateIdInputField, "Unit Price")
		this.updateUnitPriceField(unitPrice, unitPriceInputField)
		var taxableInputField = sysFunctions.locateAdjacentColumnInputNode(otherRateIdInputField, "Taxable")
		var costType = this.getOtherRateCostTypeForId(other_rate_id)
		taxableInputField.value = this.myTaxableValue("Tax"+costType)
		sysFunctions.updateDataValue(taxableInputField, taxableInputField.value)
	}
	if(description!=null)
	{	
		var description_element = sysFunctions.locateAdjacentColumnInputNode(otherRateIdInputField, "Other Rate Description")
		description_element.value = description
		sysFunctions.updateDataValue(description_element, description)
	}
	sysFunctions.updateDataValue(otherRateIdInputField, otherRateIdInputField.getAttribute("mynewvalue"))
	myProgram.myRefreshOtherSummaryGridForFormView()
}
window.MyRecipe.prototype.updateOtherRateDescription._methodName='updateOtherRateDescription'
window.MyRecipe.prototype.updateTaxableField = function(value)
{
	if(window["taxable_combobox"] != null)
	{
		window["taxable_combobox"].value = value
	}
}
window.MyRecipe.prototype.updateTaxableField._methodName='updateTaxableField'
window.MyRecipe.prototype.getOtherRateDescriptionForId = function(other_rate_id)
{
	var the_locator_recipe=new SUITableCellValueLocatorRecipe({"initialConfigurationName":"generic_table_cell_value_locator"})
	the_locator_recipe.tableRows=this.mainDS.static_other_rate_list;
	the_locator_recipe.tableHeadings=this.mainDS.static_other_rate_headings
	the_locator_recipe.tableLocatorHeading="Other Rate Id"
	the_locator_recipe.tableLocatorFilter=other_rate_id
	the_locator_recipe.tableTargetCellHeading="Other Rate Description"
	var description=the_locator_recipe.prepare()
	
	return description
}
window.MyRecipe.prototype.getOtherRateDescriptionForId._methodName='getOtherRateDescriptionForId'
window.MyRecipe.prototype.myLookupControl = function()
{
	the_recipe=new GUIWindowRecipe({initialConfigurationName:'generic_window'})
	the_recipe.windowName='example window'
	the_recipe.parameters='{width:300,height:400,top:100,left:100,resizable:"no",scrollbars:"no",menubar:"no",toolbar:"no",status:"no",location:"no"}'
	var the_template=new GUITemplateRecipe({initialConfigurationName:"generic_template"})
	this.mainDS.inventory_lookup_page_size=100
	this.mainDS.inventory_lookup_filter=""
	this.mainDS.inventory_start_index=0
	the_recipe=this.myLookupRecipe()
	the_template.template.dbPush("<html><head><title>the window title</title></head><body>")
	the_template.template.dbPush(the_recipe)
	the_template.template.dbPush("</body></html>")
	the_recipe.initialHTML=the_template.prepare()
	the_recipe.prepare()
	
}
window.MyRecipe.prototype.myLookupControl._methodName='myLookupControl'
window.MyRecipe.prototype.myLookupRecipe = function()
{
	var the_recipe=new GUITemplateRecipe({initialConfigurationName:"generic_template"})
	var the_template=the_recipe.template
		the_template.dbPush(this.myLookupFilterFieldRecipe())
		the_template.dbPush(this.myLookupFilterButtonRecipe())
		the_template.dbPush(this.myLookupGridRecipe())
		the_template.dbPush(this.myLookupComboBox())
	return the_recipe
}
window.MyRecipe.prototype.myLookupRecipe._methodName='myLookupRecipe'
window.MyRecipe.prototype.myCCProcessorWindowRecipe = function()
{
	var window_recipe=new GUIWindowRecipe({"initialConfigurationName":"generic_window"})
	window_recipe.parameters='{width:300,height:150,top:100,left:100,resizable:"no",scrollbars:"no",menubar:"no",toolbar:"no",status:"no",location:"no"}'
	window_recipe.windowName = "cc_processor_window"
	
	var template_recipe=new GUITemplateRecipe({windowURL:"myRecipeLoading.htm",initialConfigurationName:"generic_template"})
	template_recipe.template.dbPush("<html><head><title>SubAnywhere "+this.mySubAnywhereMainVersion()+"</title></head><body onload='window.document.all[\"cc_field\"].value = \"\"'><center>")
	template_recipe.template.dbPush('<div style="font-family:arial;font-size:20;color:black">Credit Card Processor</div>')
	template_recipe.template.dbPush(this.myCCForm())
	template_recipe.template.dbPush("</center></body></html>")
	window_recipe.initialHTML=template_recipe
	if(this.tempDS.current_cc_processor_window != null)
	{
		try
		{
			this.tempDS.current_cc_processor_window.close()
		}
		catch(e){}
		this.tempDS.current_cc_processor_window = null;
	}
	this.tempDS.current_cc_processor_window=window_recipe.prepare()	
	
	var the_focus_id=this.mainDS.start_focus_id
	if(the_focus_id!=null)
	{
		var the_element=this.tempDS.current_cc_processor_window[the_focus_id]
		if(the_element!=null)
		{
			if(the_element.length == null)
			{
				try
				{
					the_element.focus()
				}
				catch(e){}
			}
		}
	}
}
window.MyRecipe.prototype.myCCProcessorWindowRecipe._methodName='myCCProcessorWindowRecipe'
window.MyRecipe.prototype.mySubmitSubAnywhereFolderWindowRecipe = function()
{
	var window_recipe=new GUIWindowRecipe({"initialConfigurationName":"generic_window"})
	window_recipe.parameters='{width:700,height:500,top:100,left:100,resizable:"no",scrollbars:"no",menubar:"no",toolbar:"no",status:"no",location:"no"}'
	window_recipe.windowName = "techmit_folder_window"
	
	var template_recipe=new GUITemplateRecipe({windowURL:"myRecipeLoading.htm",initialConfigurationName:"generic_template"})
	template_recipe.template.dbPush("<html><head><title>Submit SubAnywhere Folder</title></head><body><center>")
	template_recipe.template.dbPush('<div style="font-family:arial;font-size:20;color:black">Please enter a description of the problem:</div>')
	template_recipe.template.dbPush(this.mySubmitFolderForm())
	template_recipe.template.dbPush("</center></body></html>")
	window_recipe.initialHTML=template_recipe
	if(this.tempDS.techmit_folder_window != null)
	{
		try
		{
			this.tempDS.techmit_folder_window.close()
		}
		catch(e){}
		this.tempDS.techmit_folder_window = null;
	}
	this.tempDS.techmit_folder_window=window_recipe.prepare()	
	
	var the_element=this.tempDS.techmit_folder_window["problem_description_textarea"]
	if(the_element!=null)
	{
		if(the_element.length == null)
		{
			try
			{
				the_element.focus()
			}
			catch(e){}
		}
	}
}
window.MyRecipe.prototype.mySubmitSubAnywhereFolderWindowRecipe._methodName='mySubmitSubAnywhereFolderWindowRecipe'
window.MyRecipe.prototype.myDestroyAllApplets = function()
{
	var appletIds = ["MyDocumentManagerApplet"
					,"databaseAccessorObject"
					,"MyWaitApplet"
					,"sign"]
	for(var appletIndex = 0; appletIndex < appletIds.length; appletIndex++)
	{
		var appletElement = window[appletIds[appletIndex]]
		if(appletElement != null)
		{
			appletElement.parentElement.removeChild(appletElement)
		}
	}
	
	//var i = 0
	//while(i++<100000){}
}
window.MyRecipe.prototype.myDestroyAllApplets._methodName='myDestroyAllApplets'
window.MyRecipe.prototype.mySubAnywhereClosing = function()
{
	myProgram.destroyProgressAppletDivs()
	myProgram.myDestroyAllApplets()
	myProgram.myCloseLoginWindowIfOpen()
	
	oShell = new ActiveXObject("WScript.Shell");
	oShell.Run("taskkill /f /im mshta.exe");
	document.write("")
	document.close()
	
	
}
window.MyRecipe.prototype.mySubAnywhereClosing._methodName='mySubAnywhereClosing'
window.MyRecipe.prototype.myCloseLoginWindowIfOpen = function()
{
	try
	{
		if(myProgram.tempDS.current_tech_logon_window != null)
		{
			myProgram.tempDS.current_tech_logon_window.document.body.onbeforeunload=null
			myProgram.tempDS.current_tech_logon_window.close()
			myProgram.tempDS.current_tech_logon_window = null;
		}
	}
	catch(e)
	{
		this.mydbLogMessage("SubAnywhere Closing","","Error occurred trying to close Sub Login window: "+sysFunctions.getExceptionMessage(e))			
	}
}
window.MyRecipe.prototype.myCloseLoginWindowIfOpen._methodName='myCloseLoginWindowIfOpen'
window.MyRecipe.prototype.mySubLogonWindowRecipe = function()
{
    
    var window_recipe=new GUIWindowRecipe({"initialConfigurationName":"generic_window"})
	window_recipe.parameters='{width:300,height:150,top:100,left:100,resizable:"no",scrollbars:"no",menubar:"no",toolbar:"no",status:"no",location:"no"}'
	window_recipe.windowName = "tech_logon_window"
	window_recipe.maximized = false
	
	var template_recipe=new GUITemplateRecipe({initialConfigurationName:"generic_template"})
	//template_recipe.template.dbPush("<html><head><title>Sub Logon</title></head><body onbeforeunload='return;window.opener.myProgram.killingLogonWindow(event)'><center>")
	template_recipe.template.dbPush('<div style="font-family:arial;font-size:18px;color:black">Sub Logon</div><br/>')
	template_recipe.template.dbPush(this.myAuthenticationForm())
	//template_recipe.template.dbPush("</center></body></html>")
	window_recipe.initialHTML=template_recipe
	if(this.tempDS.current_tech_logon_window != null)
	{
		try
		{
			this.tempDS.applicationForcedClose = true
			this.tempDS.current_tech_logon_window.close()
		}
		catch(e){}
		this.tempDS.current_tech_logon_window = null;
	}
	this.tempDS.current_tech_logon_window=window_recipe.prepare()	
	this.tempDS.current_tech_logon_window.document.write(template_recipe.prepare())
	var the_focus_id=this.mainDS.start_focus_id
	if(the_focus_id!=null)
	{
		var the_element=this.tempDS.current_tech_logon_window[the_focus_id]
		if(the_element!=null)
		{
			if(the_element.length == null)
			{
				try
				{
					the_element.focus()
				}
				catch(e){}
			}
		}
	}
}
window.MyRecipe.prototype.mySubLogonWindowRecipe._methodName='mySubLogonWindowRecipe'
window.MyRecipe.prototype.myLookupGridRecipe = function()
{
	var the_grid=new GUISimpleGridRecipe('{"initialConfigurationName":"generic_simple_grid",minRowCount:20}')
	the_grid.scrollingHeight=300
	the_grid.columnWidths=[100,100]
	the_grid.columnCount=7
	the_row_numbers_string='{"rn_heading":"Line","rn_width":75,\
			"rn_cell_on_click":"myProgram.myNewPage(\'edit_material_page\',\'_row_number_\',\'_column_number_\')",\
			"rn_cell_on_click_template":"_cell_contents_\
			<a id=\\\"other_line__cell_contents_\\\" href=#abc onclick=\\\"myProgram.myDeleteItem(\'_grid_id_\',\'_row_number_\',\'_column_number_\')\\\" >\
				select</a>"\
			}'
	the_grid.addRowNumbers=the_row_numbers_string
	the_grid.idAttribute='wo_other_'
	the_grid.cellOnClickDefault="myProgram.myEditControl('_cell_escaped_contents_','_grid_id_','_cell_id_','_heading_contents_','_row_number_','_column_number_')"
	return the_grid
}
window.MyRecipe.prototype.myLookupGridRecipe._methodName='myLookupGridRecipe'
window.MyRecipe.prototype.updateGridRowValueDisplay = function(the_new_value, the_old_value, column_number, the_element, displayOnly)
{
	if(displayOnly != null)
	{
		the_element.innerHTML = the_new_value
	}	
	else
	{
		var the_prefix="myProgram.myEditControl\\('"
		var the_prefix2="myProgram.myEditControl('"
		/*********************************/
					
		if(the_new_value == '')
		{
			the_display_value = this.mainDS.emptyGridCellDisplayValue
		}
		else
		{
			the_display_value = the_new_value 
		}
				
		if(the_old_value == '')
		{
			the_display_old_value = this.mainDS.emptyGridCellDisplayValue
		}
		else
		{
			the_display_old_value = the_old_value 
		}
		
		the_new_value = the_new_value.replace(/\\/g, "\\\\")
		the_old_value = the_old_value.replace(/\\/g, "\\\\\\\\")
		
		while(the_new_value.indexOf("\"") != -1 || the_new_value.indexOf("\'") != -1)
		{
			the_new_value=the_new_value.replace(/\"/,'\\x22') 
			the_new_value=the_new_value.replace(/\'/,'\\x27')
		}
				
		while(the_old_value.indexOf("\"") != -1 || the_old_value.indexOf("\'") != -1)
		{
			the_old_value=the_old_value.replace(/\"/,'\\\\x22') 
			the_old_value=the_old_value.replace(/\'/,'\\\\x27')
		}
			
		//Escape Regular Expression MetaCharacters |, (, ), [, ], {, }, ^, $, *, +, ?, .
		the_display_old_value = the_display_old_value.replace(/\\/g, "\\\\")
		the_display_old_value = this.myRegExpMetaCharacterEscapeString(the_display_old_value)
		the_old_value = this.myRegExpMetaCharacterEscapeString(the_old_value)
				
		the_display_old_value=the_display_old_value.replace(/&/g,'&amp;')
		the_display_old_value=the_display_old_value.replace(/</g,'&lt;')
		the_display_old_value=the_display_old_value.replace(/>/g,'&gt;')
			
		the_old_value=the_old_value.replace(/&/g,'&amp;')
				
		/*********************************/
				
		var the_reg_exp=RegExp('>'+the_display_old_value+'<','g')
		var the_innerHTML=the_element.innerHTML
		var the_new_innerHTML=the_innerHTML.replace(the_reg_exp,'>'+the_display_value+'<')
		var the_reg_exp=RegExp(the_prefix+the_old_value,'g')
		var the_new2_innerHTML=the_new_innerHTML.replace(the_reg_exp,the_prefix2+the_new_value)
		the_element.innerHTML=(the_new2_innerHTML)
	}
}
window.MyRecipe.prototype.updateGridRowValueDisplay._methodName='updateGridRowValueDisplay'
window.MyRecipe.prototype.executeEditControlFunction = function(edit_control_function, the_edit_control, the_rn)
{
	var the_value
	if(the_edit_control.editElement != null)
	{
		the_value = the_edit_control.editElement.value;
	}
	else
	{
		the_value = the_edit_control.value
	}
	
	var result
	if(typeof(edit_control_function) == "function")
	{
		result = edit_control_function(the_value, the_edit_control.rowNumber, the_edit_control.columnNumber, the_rn);
	}
	else
	{
		result = eval(edit_control_function+"('"+the_value+"',"+the_edit_control.rowNumber+","+the_edit_control.columnNumber+","+the_rn+")");
	}
	
	if(result != null)
	{
		if(!result["noView"])
		{
			var the_old_value = result["old_value"].toString();
			var the_new_value = result["new_value"].toString();
			var column_number = result["column"];
		
			var the_element=window[the_edit_control.cellId.techstring(0,the_edit_control.cellId.length-1)+column_number]
			this.updateGridRowValueDisplay(the_new_value, the_old_value, column_number, the_element, result["displayOnly"])
		}
	}
	return result
}
window.MyRecipe.prototype.executeEditControlFunction._methodName='executeEditControlFunction'
window.MyRecipe.prototype.getEditControlFunctionsForRecipe = function(recipeName)
{
	var recipe = this.myEditRecipeFor({"recipeName":recipeName});
	
	var oneditcontrol = recipe.oneditcontrolAttribute;
	
	if(oneditcontrol == null)
	{
		return [];
	}
	if((typeof oneditcontrol).toLowerCase().trim() == "string" || (typeof oneditcontrol).toLowerCase().trim() == "function")
	{
		return [oneditcontrol];
	}
	
	return oneditcontrol;
}
window.MyRecipe.prototype.getEditControlFunctionsForRecipe._methodName='getEditControlFunctionsForRecipe'
window.MyRecipe.prototype.myExecuteEditControlFunctions = function(recipeName, the_edit_control, the_rn)
{
	var editControlFunctions = this.getEditControlFunctionsForRecipe(recipeName);
	
	for(var i = 0; i < editControlFunctions.length; i++)
	{
		var editControlFunction = editControlFunctions[i];
		
		var resultDict = this.executeEditControlFunction(editControlFunction, the_edit_control, the_rn);
		
		if(resultDict != null)
		{
			var childEditControlObject = this.childEditControlObjectFromParent(the_edit_control, resultDict);
		
			this.myExecuteEditControlFunctions(resultDict["recipeAffected"], childEditControlObject, the_rn);
		}
	}
}
window.MyRecipe.prototype.myExecuteEditControlFunctions._methodName='myExecuteEditControlFunctions'
window.MyRecipe.prototype.childEditControlObjectFromParent = function(the_edit_control, resultDict)
{
	var childEditControlObject = {};
	
	childEditControlObject["value"] = resultDict["new_value"];
	childEditControlObject["rowNumber"] = the_edit_control["rowNumber"];
	childEditControlObject["columnNumber"] = resultDict["column"];
	childEditControlObject["cellId"] = this.childCellIdFromEditControlParent(the_edit_control, resultDict);
	
	return childEditControlObject;
}
window.MyRecipe.prototype.childEditControlObjectFromParent._methodName='childEditControlObjectFromParent'
window.MyRecipe.prototype.childCellIdFromEditControlParent = function(the_edit_control, resultDict)
{
	var parentCellId = the_edit_control.cellId;
	var tokens = parentCellId.split("_");
	tokens[tokens.length-1] = resultDict["column"]
	var childCellId = tokens.join("_");
	return childCellId
}
window.MyRecipe.prototype.childCellIdFromEditControlParent._methodName='childCellIdFromEditControlParent'
window.MyRecipe.prototype.myEditControlApply = function()
{
	var the_edit_control=this.tempDS.current_edit_control
	var the_locator_recipe=new SUITableCellValueLocatorRecipe({"initialConfigurationName":"generic_table_cell_value_locator"})
	var the_list_base_name=this.mainDS[the_edit_control.gridId+"list_base_name"]
	var the_list=this.mainDS[the_list_base_name+"_list"]
	if(the_edit_control.idAttribute == "wo_po_material__edit_control" || the_edit_control.idAttribute == "wo_po_other__edit_control")the_list = this.tempDS[the_list_base_name+"_list"]
	var the_headings=this.mainDS[the_list_base_name+"_headings"]
	
	var the_grid_list_base_name=this.mainDS[the_edit_control.gridId+"grid_list_base_name"]
	var the_grid_list=this.tempDS[the_grid_list_base_name+"_list"]
	var the_grid_headings=this.mainDS[the_grid_list_base_name+"_headings"]
    var the_column_index=the_grid_headings.dbIndexOf("RN")
    var the_rn=the_grid_list[the_edit_control.rowNumber][the_column_index]
    
    var the_value=the_edit_control.editElement.value
    
    if(the_edit_control.controlRecipe.validateFormat!=null)
    {
		
		var result;
		if(typeof(the_edit_control.controlRecipe.validateFormat) == "function")
		{
			result = the_edit_control.controlRecipe.validateFormat(the_edit_control)
		}
		else
		{
			result=the_value.validateFormat(the_edit_control.controlRecipe.validateFormat,the_edit_control.recipeName,true)
		}
		if(!result)
		{
			the_edit_control.editElement.focus()
			return
		}
    }
    
    this.myExecuteEditControlFunctions(the_edit_control.recipeName, the_edit_control, the_rn);
    
	the_locator_recipe.tableRows=the_list
	the_locator_recipe.tableHeadings=the_headings
	the_locator_recipe.tableCellNewValue=the_value
	the_locator_recipe.tableLocatorHeading=[].dbPush("RN").dbPush("Work Order Id")
	the_locator_recipe.tableLocatorFilter=[].dbPush(the_rn).dbPush(this.mainDS.current_workorder_id)
	the_locator_recipe.tableTargetCellHeading=the_edit_control.recipeName
	var the_old_value=the_locator_recipe.prepare()
	
	//Mark the edited row as not transferred.
	the_locator_recipe.tableRows=the_list
	the_locator_recipe.tableHeadings=the_headings
	the_locator_recipe.tableCellNewValue="n"
	the_locator_recipe.tableLocatorHeading=[].dbPush("RN").dbPush("Work Order Id")
	the_locator_recipe.tableLocatorFilter=[].dbPush(the_rn).dbPush(this.mainDS.current_workorder_id)
	the_locator_recipe.tableTargetCellHeading="Transmitted"
	var the_old_value2=the_locator_recipe.prepare()
	
	var the_element=window[the_edit_control.cellId]
	var the_prefix="myProgram.myEditControl\\('"
	var the_prefix2="myProgram.myEditControl('"
	
	if(the_value == '')
	{
		the_display_value = "&nbsp;&nbsp;&nbsp;"//this.mainDS.emptyGridCellDisplayValue
	}
	else
	{
		the_display_value = the_value 
	}
	
	if(the_old_value == '')
	{
		the_display_old_value = ""//this.mainDS.emptyGridCellDisplayValue
	}
	else
	{
		the_display_old_value = the_old_value 
	}
	the_value = the_value.replace(/\\/g, "\\\\")
	the_old_value = the_old_value.toString().replace(/\\/g, "\\\\\\\\")
	
	while(the_value.indexOf("\"") != -1 || the_value.indexOf("\'") != -1)
	{
		the_value=the_value.replace(/\"/,'\\x22') 
		the_value=the_value.replace(/\'/,'\\x27')
	}
	
	while(the_old_value.indexOf("\"") != -1 || the_old_value.indexOf("\'") != -1)
	{
		the_old_value=the_old_value.replace(/\"/,'\\\\x22') 
		the_old_value=the_old_value.replace(/\'/,'\\\\x27')
	}
	
	//Escape Regular Expression MetaCharacters |, (, ), [, ], {, }, ^, $, *, +, ?, .
	the_display_old_value = the_display_old_value.replace(/\\/g, "\\\\")
	the_display_old_value = this.myRegExpMetaCharacterEscapeString(the_display_old_value)
	the_old_value = this.myRegExpMetaCharacterEscapeString(the_old_value)
	
	the_display_old_value=the_display_old_value.replace(/&/g,'&amp;')
	the_display_old_value=the_display_old_value.replace(/</g,'&lt;')
	the_display_old_value=the_display_old_value.replace(/>/g,'&gt;')
	
	if(the_display_old_value.trim() == "") the_display_old_value = "&nbsp;&nbsp;&nbsp;"
	
	the_old_value=the_old_value.replace(/&/g,'&amp;')
	
	var the_reg_exp=RegExp('>'+the_display_old_value+'<','g')
	var the_innerHTML=the_edit_control.innerHTML
	var the_new_innerHTML=the_innerHTML.replace(the_reg_exp,'>'+the_display_value+'<')
	var the_reg_exp=RegExp(the_prefix+the_old_value,'g')
	var the_new2_innerHTML=the_new_innerHTML.replace(the_reg_exp,the_prefix2+the_value)
	sysFunctions.setInnerHTMLForElement(the_element, the_new2_innerHTML)//the_element.innerHTML=(the_new2_innerHTML)
	
	if(!myProgram.myEditControlSuccededForGrid(myProgram.tempDS.current_edit_control.gridId))
	{
		myProgram.myEditControlCancel()
	}
	
	// the following line is needed to assure that garbage collection does not crash the browser before the code run by the control completes
	_tmp_control_storage=this.tempDS.current_edit_control
	this.tempDS.current_edit_control=null
	//this.mySaveData()
	
}
window.MyRecipe.prototype.myEditControlApply._methodName='myEditControlApply'
window.MyRecipe.prototype.myEditControlSuccededForGrid = function(gridId)
{
	switch(gridId)
	{
		case 'wo_equipment_':
		case 'wo_equipment_unspecified_':
			return myProgram.mySubmitEquipment()
		break;
	}
	
	return true
}
window.MyRecipe.prototype.myEditControlSuccededForGrid._methodName='myEditControlSuccededForGrid'
window.MyRecipe.prototype.myRegExpMetaCharacterEscapeString = function(stringToEscape)
{
	//Escape Regular Expression MetaCharacters |, (, ), [, ], {, }, ^, $, *, +, ?, .
	stringToEscape=stringToEscape.replace(/\|/g,'\\|')
	stringToEscape=stringToEscape.replace(/\(/g,'\\(')
	stringToEscape=stringToEscape.replace(/\)/g,'\\)')
	stringToEscape=stringToEscape.replace(/\[/g,'\\[')
	stringToEscape=stringToEscape.replace(/\]/g,'\\]')
	stringToEscape=stringToEscape.replace(/\{/g,'\\{')
	stringToEscape=stringToEscape.replace(/\}/g,'\\}')
	stringToEscape=stringToEscape.replace(/\^/g,'\\^')
	stringToEscape=stringToEscape.replace(/\$/g,'\\$')
	stringToEscape=stringToEscape.replace(/\*/g,'\\*')
	stringToEscape=stringToEscape.replace(/\+/g,'\\+')
	stringToEscape=stringToEscape.replace(/\?/g,'\\?')
	stringToEscape=stringToEscape.replace(/\./g,'\\.')
	
	return stringToEscape
}
window.MyRecipe.prototype.myRegExpMetaCharacterEscapeString._methodName='myRegExpMetaCharacterEscapeString'
window.MyRecipe.prototype.myEditControlCancel = function()
{
	if(this.tempDS.current_edit_control!=null)
	{
		var old_control=this.tempDS.current_edit_control
		var old_cell_id=old_control.cellId
		var old_element=window[old_cell_id]
		old_element.innerHTML=old_control.innerHTML
		//2005-12-14 JKC CASE:528 Added the following two lines of code to allow this method to work successfully.
		_tmp_control_storage=this.tempDS.current_edit_control
		this.tempDS.current_edit_control=null
	}
}
window.MyRecipe.prototype.myEditControlCancel._methodName='myEditControlCancel'
window.MyRecipe.prototype.myAcknowledgedWorkOrdersGrid = function(parms) {
    if (parms == null) {
        parms = this.getInProgressParms()
    }
    var open_wos_grid = new GUISimpleGridRecipe('{"initialConfigurationName":"formview_grid",minRowCount:10}')
    open_wos_grid.idAttribute = "open_wo_grid"
    var columnWidthArray = [70, 169, 85, 85, 40, 80, 91, 91]
    open_wos_grid.columnCount = columnWidthArray.length
    open_wos_grid.columnWidths = sysFunctions.makeColumnWidthsEqualTotal(columnWidthArray, sysFunctions.getTechAnywhereScreenWidth() - 70)
    open_wos_grid.gridHeight = 400
    open_wos_grid.scrollingHeight = "0;height:187px;overflow:scroll;"
    open_wos_grid.gridWidth = sysFunctions.getTechAnywhereScreenWidth() - 14//740


    open_wos_grid.sortColumnHeadings = myProgram.mainDS.open_wo_grid_headings
    open_wos_grid.gridInstanceString = "myProgram.myAcknowledgedWorkOrdersGrid()" //
    open_wos_grid.sortRowsLocation = "myProgram.mainDS." + parms.list


    this.mainDS[parms.list] = myProgram.myAcknowledgedWorkOrdersGridRows(parms)
    open_wos_grid.rows = this.mainDS[parms.list]
    open_wos_grid.defaultColumnWidth = null
    open_wos_grid.headings = myProgram.mainDS.open_wo_grid_headings

    open_wos_grid.cellOnClick = ["myProgram.myNewPage('" + parms.page + "','_row_number_','_column_number_')"]
    open_wos_grid.cellToolTips = ["Click here to view the Open Work Order"]
    open_wos_grid.cellOnClickDefault = null
    for (var i = 0; i < open_wos_grid.cellOnClick.length; i++) {
        open_wos_grid.cellOnClickTemplates[i] = '<a href="#abc" style="color:#0800be;font-family:verdana" onclick="_cell_on_click_">_cell_contents_</a>'
    }
    //	alert(open_wos_grid.prepare())
    window.setTimeout("myProgram.addCheckInOutButtonsToAcknowledgedGrid('" + parms.list + "')", 300)
    return open_wos_grid
}
window.MyRecipe.prototype.myAcknowledgedWorkOrdersGrid._methodName='myAcknowledgedWorkOrdersGrid'
window.MyRecipe.prototype.getInProgressParms = function() 
{
    var aParms = {}
    aParms.dateScheduledFilter = myProgram.tempDS.current_wo_filter
    aParms.filter_function = function(val) { return (val.value.trim().toLowerCase() != 'completed' && val.value.trim().toLowerCase() != 'cancelled' && val.value.trim().toLowerCase() != 'pending') }
    aParms.list = "open_wo_list"
    aParms.page = "view_open_workorder_page_tabbed"
    return aParms
}
window.MyRecipe.prototype.getInProgressParms._methodName='getInProgressParms'
window.MyRecipe.prototype.addCheckInOutButtonsToAcknowledgedGrid = function(listKey)
{
	var imageIndex = myProgram.mainDS.open_wo_grid_headings.dbIndexOf("")
	var statusIndex = myProgram.mainDS.open_wo_grid_headings.dbIndexOf("Status")
	
	//"open_wo_grid_cell_row_0_column_7"
	for(var rowIndex = 0; rowIndex < myProgram.mainDS[listKey].length; rowIndex++)
	{
		var imageParent = document.getElementById("open_wo_grid_cell_row_"+rowIndex+"_column_"+imageIndex)
		myProgram.modifyCheckInOrOutDiv(sysFunctions.getNonTextFirstChild(imageParent), myProgram.mainDS[listKey][rowIndex][statusIndex])
	}
}
window.MyRecipe.prototype.addCheckInOutButtonsToAcknowledgedGrid._methodName='addCheckInOutButtonsToAcknowledgedGrid'
window.MyRecipe.prototype.myColorMetricsLinks = function()
{
    var equipment_index = myProgram.mainDS.wo_equipment_grid_headings.dbIndexOf("Equipment Id")
    var metricsIndex = myProgram.mainDS.wo_equipment_grid_headings.dbIndexOf("Metrics")+1
    
    for(var rowIndex = 0; rowIndex < myProgram.tempDS.wo_equipment_grid_list.length; rowIndex++)
    {
        var equipmentId = myProgram.tempDS.wo_equipment_grid_list[rowIndex][equipment_index]
        if(myProgram.doesEquipmentHaveMetricsToAnswer(equipmentId))
        {
            var element = document.getElementById("wo_equipment__cell_row_"+rowIndex+"_column_"+metricsIndex)
            try
            {
                sysFunctions.getNonTextFirstChild(element).style.color = "red"
            }
            catch(e){}
        }
    }
}
window.MyRecipe.prototype.myColorMetricsLinks._methodName='myColorMetricsLinks'
window.MyRecipe.prototype.clearNoSubmittedMetrics = function()
{
    var measurementIndex = myProgram.mainDS.wo_metrics_headings.dbIndexOf("Metrics Measurement")
	var serverRNIndex = myProgram.mainDS.wo_metrics_headings.dbIndexOf("ServerRN")
	
	for(var i = 0; i < this.mainDS.wo_metrics_list.length; i++)
	{
	    if(this.mainDS.wo_metrics_list[i][serverRNIndex]*1 == 0)
	    {
	        this.mainDS.wo_metrics_list[i][measurementIndex] = ""
	    }
	}
}
window.MyRecipe.prototype.clearNoSubmittedMetrics._methodName='clearNoSubmittedMetrics'
window.MyRecipe.prototype.areMetricsAnswered = function()
{
    var equipment_index = myProgram.mainDS.wo_equipment_grid_headings.dbIndexOf("Equipment Id")
    
    for(var rowIndex = 0; rowIndex < myProgram.tempDS.wo_equipment_grid_list.length; rowIndex++)
    {
        var equipmentId = myProgram.tempDS.wo_equipment_grid_list[rowIndex][equipment_index]
        if(myProgram.doesEquipmentHaveMetricsToAnswer(equipmentId))
        {
            return false
        }
    }
    
    return true
}
window.MyRecipe.prototype.areMetricsAnswered._methodName='areMetricsAnswered'
window.MyRecipe.prototype.doesEquipmentHaveMetricsToAnswer = function(equipmentId)
{
    var the_table=new SUIDataModelRecipe({initialConfigurationName:'generic_data_model'})
	the_table.sourceRows=this.mainDS.wo_metrics_list
	the_table.sourceHeadings=this.mainDS.wo_metrics_headings
	the_table.filterOnSourceHeadings=[].dbPush(this.mainDS.wo_id_heading).dbPush("Equipment Id")
	the_table.filterValues=[].dbPush(this.mainDS.current_workorder_id).dbPush(equipmentId)
	the_table.targetHeadings=this.mainDS.wo_metrics_headings
	var metricsList=the_table.prepare()
	
	var measurementIndex = myProgram.mainDS.wo_metrics_headings.dbIndexOf("Metrics Measurement")
	
	for(var i = 0; i < metricsList.length; i++)
	{
	    if(metricsList[i][measurementIndex].trim() == "") return true
	}
	
	return false
}
window.MyRecipe.prototype.doesEquipmentHaveMetricsToAnswer._methodName='doesEquipmentHaveMetricsToAnswer'
window.MyRecipe.prototype.checkoutStatusList = function()
{
	return ["waiting service"
		   ,"waiting parts"
		   ,"parts ordered"
		   ,"parts received"
		   ,"return trip"
		   ,"quote approved"
		   ,"scheduled"
		   ,"rescheduled"]
}
window.MyRecipe.prototype.checkoutStatusList._methodName='checkoutStatusList'
window.MyRecipe.prototype.modifyCheckInOrOutDiv = function(divElement, status)
{
	if(myProgram.checkoutStatusList().dbIndexOf(status.trim().toLowerCase()) !== null)
	{
		divElement.style.backgroundColor = "#ff0080"
		divElement.innerHTML = "Check In"
	}
	else
	{
		divElement.style.backgroundColor = "#00ff40"
		divElement.innerHTML = "Check Out"
	}
}
window.MyRecipe.prototype.modifyCheckInOrOutDiv._methodName='modifyCheckInOrOutDiv'
window.MyRecipe.prototype.myCheckInOrOut = function(divElement) {
	var innerText = (divElement.innerText || divElement.textContent).trim().toLowerCase()
	
	var rowIndex = divElement.parentNode.id.split("_")[5]
	var idIndex = myProgram.mainDS.open_wo_headings.dbIndexOf("Work Order Id")
	var dateIndex = myProgram.mainDS.open_wo_headings.dbIndexOf("Date Scheduled")
	var timeIndex = myProgram.mainDS.open_wo_headings.dbIndexOf("Time Scheduled")
	var workOrderId = myProgram.mainDS.open_wo_list[rowIndex][idIndex]
	var dateScheduled = myProgram.mainDS.open_wo_list[rowIndex][dateIndex]
	var timeScheduled = sysFunctions.getColumnValueForTable(myProgram.mainDS.wo_list, myProgram.mainDS.wo_headings, "Time Scheduled", ["Work Order Id","Date Scheduled"], [workOrderId, dateScheduled])	
	var the_old_value = sysFunctions.getColumnValueForTable(myProgram.mainDS.wo_list, myProgram.mainDS.wo_headings, "Status", ["Work Order Id","Date Scheduled"], [workOrderId, dateScheduled])
	
	if(innerText == "check in")	
	{
		//this.myCheckin(divElement)
                this.openCheckinDialog(workOrderId, dateScheduled, timeScheduled, the_old_value)
	}
	else
	{
		this.openCheckoutDialog(workOrderId, dateScheduled, timeScheduled, the_old_value)
	}
	
	return
}
window.MyRecipe.prototype.myCheckInOrOut._methodName='myCheckInOrOut'
window.MyRecipe.prototype.openCheckinDialog = function(workOrderId, dateScheduled, timeScheduled, oldStatus)
{
    myProgram.myShowModalDialog("Check in: "+workOrderId+" "+dateScheduled,170,450,this.myCheckoutDialogClosed,330)
    window.setTimeout("myProgram.setModalDialogInnerHTML('myProgram.myCheckinDialogHTML(\""+workOrderId+"\", \""+dateScheduled+"\",\""+timeScheduled+"\", \""+oldStatus+"\")')",500)    
}
window.MyRecipe.prototype.openCheckinDialog._methodName='openCheckinDialog'
window.MyRecipe.prototype.openCheckoutDialog = function(workOrderId, dateScheduled, timeScheduled, oldStatus)
{
    myProgram.myShowModalDialog("Check out: "+workOrderId+" "+dateScheduled,170,450,this.myCheckoutDialogClosed,330)
	window.setTimeout("myProgram.setModalDialogInnerHTML('myProgram.myCheckoutDialogHTML(\""+workOrderId+"\", \""+dateScheduled+"\",\""+timeScheduled+"\", \""+oldStatus+"\")');Calendar.setup({inputField : 'eta_date_input_field',ifFormat : '%Y-%m-%d',button:'trigger'})",500)    
}
window.MyRecipe.prototype.openCheckoutDialog._methodName='openCheckoutDialog'
window.MyRecipe.prototype.myCheckoutDialogClosed = function()
{
    
}
window.MyRecipe.prototype.myCheckoutDialogClosed._methodName='myCheckoutDialogClosed'
window.MyRecipe.prototype.processCheckinDialog = function(workOrderId, dateScheduled, timeScheduled, oldStatus, messageDisplayed)
{
    if(!messageDisplayed)
    {
        myProgram.setInformationMessage('Please wait while changes are submitted...')
        window.setTimeout("myProgram.processCheckinDialog('"+workOrderId+"', '"+dateScheduled+"', '"+timeScheduled+"', '"+oldStatus+"', true)",1)
        return
    }
    
    if(this.processCheckin(workOrderId, dateScheduled, timeScheduled, oldStatus))
    {
        GB_hide()
        myProgram.disableInformationMessage()
    }
}
window.MyRecipe.prototype.processCheckinDialog._methodName='processCheckinDialog'
window.MyRecipe.prototype.processCheckoutDialog = function(workOrderId, dateScheduled, timeScheduled, oldStatus)
{
    var result = false
    switch(myProgram.getCheckoutDialogRadioValue())
    {
        case "returntrip":
            if(this.processCheckoutReturnTrip(workOrderId, dateScheduled, timeScheduled, oldStatus))
            {
                GB_close()
                myProgram.disableInformationMessage()
            }
            break
        case "finishjob":
            this.processCheckoutFinishJob(workOrderId, dateScheduled, timeScheduled, oldStatus)
            break
    }
}
window.MyRecipe.prototype.processCheckoutDialog._methodName='processCheckoutDialog'
window.MyRecipe.prototype.myCheckoutWorkOrder = function(workOrderId, dateScheduled, timeScheduled, oldStatus, messageDisplayed)
{
    if(!messageDisplayed)
    {
        myProgram.setInformationMessage()
        window.setTimeout("myProgram.myCheckoutWorkOrder('"+workOrderId+"', '"+dateScheduled+"', '"+timeScheduled+"', '"+oldStatus+"', true)", 1000)
        return
    }
    
    var status = "Checked Out"
    this.myAddStatusChangeRow(workOrderId, dateScheduled, timeScheduled, oldStatus, status)
	
	if(myProgram.mySendStatusMessage())
	{
		sysFunctions.setColumnValueForTable(myProgram.mainDS.wo_list, myProgram.mainDS.wo_headings, "Status", status, ["Work Order Id", "Date Scheduled"], [workOrderId, dateScheduled])
		myProgram.refreshWOList()
		myAvatar.myRefreshOpenWorkOrdersGrid()		
		myUnbilledPage.refreshGrid()
		myProgram.disableInformationMessage()
        myProgram.resetCurrentWorkOrderDiv()	
		return true
	}
	else
	{
		alert("A problem occurred trying to post your changes.  Your changes have NOT been submitted.  Please try again.")
		myProgram.mainDS.wo_status_change_list.pop()
		return false
	}
}
window.MyRecipe.prototype.myCheckoutWorkOrder._methodName='myCheckoutWorkOrder'
window.MyRecipe.prototype.processCheckoutReturnTrip = function(workOrderId, dateScheduled, timeScheduled, oldStatus)
{
    
    if(!this.validateReturnTripForm()) return false
        
	var etaDate = document.getElementById("eta_date_input_field").value
    var etaTime = document.getElementById("eta_time_input_field").value
    
    var status = "Waiting Service"
	this.myAddStatusChangeRow(workOrderId, dateScheduled, timeScheduled, oldStatus, status, etaDate, etaTime)
	
	if(myProgram.mySendStatusMessage())
	{
		sysFunctions.setColumnValueForTable(myProgram.mainDS.wo_list, myProgram.mainDS.wo_headings, "Status", status, ["Work Order Id", "Date Scheduled"], [workOrderId, dateScheduled])
		myProgram.refreshWOList()
		myAvatar.myRefreshOpenWorkOrdersGrid()		
		myUnbilledPage.refreshGrid()
		myProgram.disableInformationMessage()
        myProgram.resetCurrentWorkOrderDiv()
        myProgram.myHideSecondLayerWindow()
	}
	else
	{
		alert("A problem occurred trying to post your changes.  Your changes have NOT been submitted.  Please try again.")
		myProgram.mainDS.wo_status_change_list.pop()
	}
}
window.MyRecipe.prototype.processCheckoutReturnTrip._methodName='processCheckoutReturnTrip'
window.MyRecipe.prototype.getFirstEquipmentIdForWorkOrder = function(workOrderId)
{
    var list = myProgram.myCurrentEquipmentListForWorkOrder(workOrderId, ["Equipment Id"])    
    if(list.length == 0)
    {
        alert("There is no current equipment for this work order.  Please add some current equipment and try again.")
        return null
    }
    return list[0][0]
}
window.MyRecipe.prototype.getFirstEquipmentIdForWorkOrder._methodName='getFirstEquipmentIdForWorkOrder'
window.MyRecipe.prototype.processCheckoutFinishJob = function(workOrderId, dateScheduled, timeScheduled, oldStatus, hidden)
{
    if(hidden == null)
    {
        myProgram.myHideSecondLayerWindow()
        window.setTimeout("myProgram.processCheckoutFinishJob('"+workOrderId+"', '"+dateScheduled+"', '"+timeScheduled+"', '"+oldStatus+"', true)",100)
        return
    }
    this.tempDS.current_equipment_id = equipmentId = this.getFirstEquipmentIdForWorkOrder(workOrderId)
    if(equipmentId == null)
    {
        return
    }
	
	this.myShowModalDialog("Work Performed ["+equipmentId+"]",300,700,myProgram.mySecondLayersClosing,425)//((myProgram.isWorkOrderQuote()) ? myProgram.mySaveWorkRequested : myProgram.mySaveWorkPerformed)
	window.setTimeout("myProgram.setModalDialogInnerHTML('myProgram.myCheckoutAddEditWorkPerformed(\""+equipmentId+"\", \""+workOrderId+"\", \""+dateScheduled+"\", \""+timeScheduled+"\", \""+oldStatus+"\")')",500)
}
window.MyRecipe.prototype.processCheckoutFinishJob._methodName='processCheckoutFinishJob'
window.MyRecipe.prototype.getCheckoutDialogRadioValue = function()
{
    var radios = document.getElementsByName("checkoutradio")
    for(var i = 0; i < radios.length; i++)
    {
        var radio = radios[i]
        if(radio.checked) return radio.value
    }
}
window.MyRecipe.prototype.getCheckoutDialogRadioValue._methodName='getCheckoutDialogRadioValue'
window.MyRecipe.prototype.myCloseCheckoutDialogButton = function(workOrderId, dateScheduled, timeScheduled, oldStatus)
{
    var the_button_recipe=new GUIInputFieldRecipe({"initialConfigurationName":"generic_button_input_field"
                                                  ,"valueAttribute":"Continue"

