How to use lotusscript button in web browser? : <p>I have a save button in my lotus notes. My save button will execute some process in lotusscript. I will explain what document related to my save process.</p>

<p>Now I have a document from main view with status "Active", I called it "current" document.</p>

<ol>
<li>First I create copy for all current document with status "Draft" and I called it as "Copy" document.</li>
<li>Second I create "Inspection" document for all copy documents with status "Incomplete" and use all data from copy document with "Computed for display". So my "Copy" is used for all editing while "Inspection" is a Report of document only. It means, changes made in copy documents, when click save, Report will also updated with latest information.</li>
</ol>

<p>So the process will start edit copy document and save it. Copy document status will change from "Draft" to "Active", and current document will change from "Active" to "Inactive". That means, Copy document will be new current document. Then, Inspection Report status will change to "Complete".</p>

<p>Below is my lotusscript button code:</p>

<pre><code>Set db = session.CurrentDatabase
Set uidoc = workspace.CurrentDocument
Set doc = uidoc.Document

'//Set lookup view for current document
keys(0) = doc.PTagNo(0)
keys(1) = "Lock"
Set view = db.GetView("TagNo")

'//Set lookup view for "Inspection" document
pckeys(0) = doc.PTagNo(0)
pckeys(1) = doc.PBatchNo(0)
pckeys(2) = "Incomplete"
Set pcview = db.GetView("BatchPCInspection")

answer% = Messagebox("Save PC Inspection?", 4,"Confirmation")
If Not answer% = 6 Then
    Exit Sub
Else
    '//Make changes for "Inspection" document
    Set comdoc = pcview.GetDocumentByKey(pckeys, True)
    If Not comdoc Is Nothing Then
        If comdoc.AStatus(0) = "Incomplete" Then            
            comdoc.DocId=doc.UniversalID
            comdoc.ATagNo = doc.PTagNo
            comdoc.ADept= doc.PDept
            comdoc.AUserName= doc.PUserName
            comdoc.AStatus="Complete"
            Call comdoc.Save(True, False)
        End If
    End If

    '//Make changes for current document become Inactive
    Set activeDoc = view.GetDocumentByKey(keys, True)       
    If Not activeDoc Is Nothing Then
        If activeDoc.PStatus(0) = "Lock" Then
            activeDoc.DocumetId = doc.UniversalID           
            activeDoc.PStatus = "Inactive"
            Call activeDoc.Save(True, False)
        End If
    End If

    '//Make changes for "Copy" document become Active
    Call uidoc.FieldSetText("PStatus" , "Active")
    Call uidoc.FieldSetText("SaveOptions" , "1")
    Call uidoc.Save
    Call uidoc.Close
End If  
End Sub
</code></pre>

<p>So my question now, how can I convert this lotusscript code to javascript code? Because lotusscript will not run in web browser, so I surely need to convert this to javascript. Anyone know any documentation or way on how to convert this lotusscript button to javascript button. Any help will be appreciated! Thanks in advanced!</p>
