/* 
    AEB Pro Document Assembly Methods

    Copyright (C) 2006 AcroTeX.Net
    D. P. Story
    http://www.acrotex.net
    
    Version 1.0
*/


if ( typeof aebTrustedFunctions == "undefined") {
    aebTrustedFunctions = app.trustedFunction( function ( doc, oFunction, oArgs )
    {
        app.beginPriv();
            var retn = oFunction( oArgs, doc )
        app.endPriv();
        return retn;
    });
}
aebAddWatermarkFromFile = app.trustPropagatorFunction( function ( oArgs, doc )
{
    app.beginPriv();
        return retn = doc.addWatermarkFromFile(oArgs);
    app.endPriv();
});
aebImportIcon = app.trustPropagatorFunction( function ( oArgs, doc )
{
    app.beginPriv();
        return retn = doc.importIcon(oArgs);
    app.endPriv();
});
aebInsertPages = app.trustPropagatorFunction( function ( oArgs, doc )
{
    app.beginPriv();
        try { doc.insertPages(oArgs); } catch(e) {console.println("Error: " + e.toString());}
    app.endPriv();
})
aebAppOpenDoc = app.trustPropagatorFunction( function ( oArgs, doc )
{
    app.beginPriv();
        try { var retn = app.openDoc(oArgs); } catch(e) {console.println("Error: " + e.toString());}
    app.endPriv();
    return retn;
})
aebImportSound = app.trustPropagatorFunction( function ( oArgs, doc )
{
    app.beginPriv();
        return retn = doc.importSound(oArgs);
    app.endPriv();
});
aebSaveAs = app.trustPropagatorFunction( function ( oArgs, doc )
{
    app.beginPriv();
        app.execMenuItem("Save");
    app.endPriv();
});
