@DocProps PrintProps
var undefined;
function GetContainingFrame(item){
var frame=null;
var container=item;
while((container.type!="Frame") &&(container.parent)){
container=container.parent;}
if(container.type=="Frame" ){
frame=container;}
return frame;}
function showHelp(evt,type,id){
displayHelp(GetContainingFrame(evt), type, id);}
@END
@DocProps PrintProps
function FeatContext(newValue,oldValue){
this._newValue=newValue;
this._oldValue=oldValue;}
FeatContext.prototype.getNewValue=FeatContext_getNewValue;
FeatContext.prototype.getOldValue=FeatContext_getOldValue;
function FeatContext_getNewValue(){
return this._newValue;}
function FeatContext_getOldValue(){
return this._oldValue;}
function FeatureObject(name,value){
this._name=name;
this._value=value;
this._events=new Array();}
FeatureObject.prototype._CreateSubobject=FeatureObject_CreateSubobject;
FeatureObject.prototype.AddEventHandler=FeatureObject_AddEventHandler;
FeatureObject.prototype.RemoveEventHandler=FeatureObject_RemoveEventHandler;
FeatureObject.prototype.setValue=FeatureObject_SetValue;
FeatureObject.prototype.getValue=FeatureObject_GetValue;
FeatureObject.prototype.putValue=FeatureObject_putValue;
FeatureObject.prototype.fireEvents=FeatureObject_fireEvents;
FeatureObject.prototype.reverse=FeatureObject_reverse;
function FeatureObject_CreateSubobject(objName,objValue){
var obj=new FeatureObject(objName,objValue);
this[objName]=obj;
obj._parent=this;
obj.nameId=new FeatureObject("nameId",objName);
return obj;}
function FeatureObject_AddEventHandler(eventName,func,obj){
var evt=new Object();
evt.name=eventName;
evt.func=func;
evt.obj=obj;
this._events[this._events.length]=evt;}
function FeatureObject_RemoveEventHandler(eventName,func,obj){
for(var index=0; index<this._events.length; index++){
if((this._events[index].name==eventName)&&
(this._events[index].func==func)&&
(this._events[index].obj==obj)){
this._events=this._events.slice(0,index).concat(this._events.slice(index+1));
break;}}}
function FeatureObject_SetValue(value,log){
if(value!=this._value){
var context=new FeatContext(value,this._value);
log.scrLog.Add(this,context);}}
function FeatureObject_putValue(value){
this._value=value;}
function FeatureObject_fireEvents(context){
for(var i=0; i<this._events.length; i++){
var event=this._events[i];
if(event.name=="onChange"){
if(event.obj){
event.obj._LogInfoFunc_=event.func;
event.obj._LogInfoFunc_(this, context, event.name);
delete event.obj._LogInfoFunc_;}else{
event.func(this, context, event.name);}}}}
function FeatureObject_reverse(context){
var revContext=new FeatContext(context.getOldValue(),context.getNewValue());
return revContext;}
function FeatureObject_GetValue(){
return this._value;}
var PDS_DrvType="Printer1.PlugInDevmode.DrvType";
var PDS_ModelMiddle="Printer1.PlugInDevmode.ModelMiddle";
var PDS_Templates		="Printer1.Templates"
var PDS_Poster="Printer1.PlugInDevmode.Poster";
var PDS_Poster_Size="Printer1.PlugInDevmode.Poster.Size";
var PDS_Poster_CropMarks="Printer1.PlugInDevmode.Poster.CropMarks";
var PDS_Poster_Overlap="Printer1.PlugInDevmode.Poster.Overlap";
var PDS_AcctTrak="Printer1.PlugInDevmode.AccountTrack";
var PDS_AcctTrak_NoShoMsg="Printer1.PlugInDevmode.AccountTrack.NoShoMsg";
var PDS_Changes="Printer1.DeviceContext.SettingsChanged";
var PDS_Collate="Printer1.Devmode.Collate";
var PDS_Copies="Printer1.Devmode.Copies";
var PDS_Copies_Max="Printer1.Devmode.Copies.Max";
var PDS_Copies_Min="Printer1.Devmode.Copies.Min";
var PDS_Duplex="Printer1.PlugInDevmode.Duplex";
var PDS_AdvanceLayout="Printer1.PlugInDevmode.AdvanceLayout";
var PDS_Duplex_Manual="Printer1.PlugInDevmode.ManualDuplex";
var PDS_Duplex_Manual_Instruct="Printer1.PlugInDevmode.ManualDuplex.PrintInstr";
var PDS_Fax="Printer1.PlugInDevmode.Fax";
var PDS_Fax_NoShoMsg="Printer1.PlugInDevmode.Fax.NoShoMsg";
var PDS_DisplayPerJobFaxPopup="Printer1.PlugInDevmode.Fax.DisplayPerJobFaxPopup";
var PDS_FitToPageSize="Printer1.PlugInDevmode.FitToPageSize";
var PDS_JobSum="Printer1.PlugInDevmode.JobSum";
var PDS_JobSum_NoShoMsg="Printer1.PlugInDevmode.JobSum.NoShoMsg";
var PDS_PaperMargins="Printer1.PlugInDevmode.Margins";
var PDS_PrintBW="Printer1.PlugInDevmode.PrintBW";
var PDS_Orientation="Printer1.Devmode.Orientation";
var PDS_Mirror="Printer1.PlugInDevmode.Mirror";
var PDS_Rotate180="Printer1.PlugInDevmode.Rotate180";
var PDS_PaperDest="Printer1.PlugInDevmode.OutputBin";
var PDS_PaperSize="Printer1.Devmode.PaperSize";
var PDS_PaperSizeSubPolicy="Printer1.PlugInDevmode.FormSubstitutionPolicy";
var PDS_PaperSource="Printer1.Devmode.PaperSource";
var PDS_BookletPaperSource="Printer1.Devmode.BookletPaperSource";
var PDS_PaperType="Printer1.PlugInDevmode.PaperType";
var PDS_BookletPaperType="Printer1.PlugInDevmode.BookletPaperType";
var PDS_PrinterMulti="Printer1.PlugInDevmode.MultiPage.UsePrinterMultiPage";
var PDS_PrintHold="Printer1.PlugInDevmode.PrintHold";
var PDS_KeepDups="Printer1.PlugInDevmode.PrintHold.KeepDuplicates";
var PDS_PrintHold_PIN="Printer1.PlugInDevmode.PrintHold.Pin";
var PDS_PrintHold_PIN_MinLen="Printer1.PlugInDevmode.PrintHold.Pin.MinLen";
var PDS_PrintHold_PIN_MaxLen="Printer1.PlugInDevmode.PrintHold.Pin.MaxLen";
var PDS_PrintHold_User="Printer1.PlugInDevmode.PrintHold.UserName";
var PDS_PrintHold_User_MinLen="Printer1.PlugInDevmode.PrintHold.UserName.MinLen";
var PDS_PrintHold_User_MaxLen="Printer1.PlugInDevmode.PrintHold.UserName.MaxLen";
var PDS_PrintOrder="Printer1.PlugInDevmode.LastPageFirst";
var PDS_MISPageOptions="Printer1.PlugInDevmode.MISPageOptions";
var PDS_chkMIFrontCover="Printer1.PlugInDevmode.chkMIFrontCover";
var PDS_chkMIFirstPage="Printer1.PlugInDevmode.chkMIFirstPage";
var PDS_chkMILastPage="Printer1.PlugInDevmode.chkMILastPage";
var PDS_chkMIBackCover="Printer1.PlugInDevmode.chkMIBackCover";
var PDS_cbMIPaperSourceFrontCover="Printer1.PlugInDevmode.PaperSourceFrontCover";
var PDS_cbMIPaperTypeFrontCover="Printer1.PlugInDevmode.PaperTypesFrontCover";
var PDS_cbMIPaperSourceFirstPage="Printer1.PlugInDevmode.PaperSourceFirstPage";
var PDS_cbMIPaperTypeFirstPage="Printer1.PlugInDevmode.PaperTypesFirstPage";
var PDS_cbMIPaperSourceLastPage="Printer1.PlugInDevmode.PaperSourceLastPage";
var PDS_cbMIPaperTypeLastPage="Printer1.PlugInDevmode.PaperTypesLastPage";
var PDS_cbMIPaperSourceBackCover="Printer1.PlugInDevmode.PaperSourceBackCover";
var PDS_cbMIPaperTypeBackCover="Printer1.PlugInDevmode.PaperTypesBackCover";
var PDS_Scale="Printer1.Devmode.Scaling";
var PDS_Booklet="Printer1.PlugInDevmode.Booklet";
var PDS_FinisherBooklet="Printer1.PlugInDevmode.FinisherBooklet";
var PDS_PrinterLimit="Printer1.PlugInDevmode.PrinterLimit";
var PDS_BookletNoCover="Printer1.PlugInDevmode.BookletNoCover";
var PDS_BookletFFrontCover="Printer1.PlugInDevmode.BookletFFrontCover";
var PDS_BookletBFrontCover="Printer1.PlugInDevmode.BookletBFrontCover";
var PDS_BookletFBackCover="Printer1.PlugInDevmode.BookletFBackCover";
var PDS_BookletBBackCover="Printer1.PlugInDevmode.BookletBBackCover";
var PDS_BasicLayout="Printer1.PlugInDevmode.BasicLayout";
var PDS_Booklet_Sheets="Printer1.PlugInDevmode.Booklet.SheetsPerBundle";
var PDS_Booklet_BindEdge="Printer1.PlugInDevmode.Booklet.BindingEdge";
var PDS_Booklet_FoldMarks="Printer1.PlugInDevmode.Booklet.FoldMark";
var PDS_BookletMaintainLetterA4="Printer1.PlugInDevmode.BookletMaintain";
var PDS_Nup="Printer1.PlugInDevmode.MultiPage";
var PDS_Nup_Borders="Printer1.PlugInDevmode.MultiPage.PrintBorder";
var PDS_Nup_Layout="Printer1.PlugInDevmode.MultiPage.PageLayout";
var PDS_PQCustom="Printer1.Phantom.PQCustom";
var PDS_TonerDark="Printer1.PlugInDevmode.TonerDarkness";
var PDS_FillFine="Printer1.PlugInDevmode.FillResolution";
var PDS_Effect_MakeNegative="Printer1.PlugInDevmode.Negative";
var PDS_Effect_MakeBlack="Printer1.PlugInDevmode.AllColorsToBlack";
var PDS_Effect_Smooth="Printer1.PlugInDevmode.SmoothImages";
var PDS_Halftone="Printer1.PlugInDevmode.CustomHalftone";
var PDS_Halftone_Frequency="Printer1.PlugInDevmode.CustomHalftone.Frequency";
var PDS_Halftone_Angle="Printer1.PlugInDevmode.CustomHalftone.Angle";
var PDS_Watermark="Printer1.PlugInDevmode.Watermarks";
var PDS_Watermark_Style="Printer1.PlugInDevmode.Watermarks";
var PDS_Watermark_Placement="Printer1.PlugInDevmode.Watermarks.Placement";
var PDS_Watermark1="Printer1.PlugInDevmode.Watermarks.Watermark1";
var PDS_Watermark2="Printer1.PlugInDevmode.Watermarks.Watermark2";
var PDS_Overlay="Printer1.PlugInDevmode.Overlay";
var PDS_Overlay_Placement="Printer1.PlugInDevmode.Overlay.Placement";
var PDS_Overlay1="Printer1.PlugInDevmode.Overlay.Overlay1";
var PDS_Overlay2="Printer1.PlugInDevmode.Overlay.Overlay2";
var PDS_OverlayList="Printer1.Phantom.OverlayList";
var PDS_ColorCorrection="Printer1.PlugInDevmode.ColorCorrection";
var PDS_RGBImages="Printer1.PlugInDevmode.RGBImages";
var PDS_RGBText="Printer1.PlugInDevmode.RGBText";
var PDS_RGBGraphics="Printer1.PlugInDevmode.RGBGraphics";
var PDS_CMYKCorr="Printer1.PlugInDevmode.CMYKCorr";
var PDS_ShowPrtrStatus="Printer1.PlugInDevmode.ShowPrtrStatus";
var PDS_ColorBalanceMode="Printer1.PlugInDevmode.ColorBalance.Mode";
var PDS_CyanBalance="Printer1.PlugInDevmode.ColorBalance.Cyan";
var PDS_CyanBalance_Min="Printer1.PlugInDevmode.ColorBalance.Cyan.Min";
var PDS_CyanBalance_Max="Printer1.PlugInDevmode.ColorBalance.Cyan.Max";
var PDS_MagentaBalance="Printer1.PlugInDevmode.ColorBalance.Magenta";
var PDS_MagentaBalance_Min="Printer1.PlugInDevmode.ColorBalance.Magenta.Min";
var PDS_MagentaBalance_Max="Printer1.PlugInDevmode.ColorBalance.Magenta.Max";
var PDS_YellowBalance="Printer1.PlugInDevmode.ColorBalance.Yellow";
var PDS_YellowBalance_Min="Printer1.PlugInDevmode.ColorBalance.Yellow.Min";
var PDS_YellowBalance_Max="Printer1.PlugInDevmode.ColorBalance.Yellow.Max";
var PDS_BlackBalance="Printer1.PlugInDevmode.ColorBalance.Black";
var PDS_BlackBalance_Min="Printer1.PlugInDevmode.ColorBalance.Black.Min";
var PDS_BlackBalance_Max="Printer1.PlugInDevmode.ColorBalance.Black.Max";
var PDS_ColorSaver="Printer1.PlugInDevmode.ColorSaver";
var PDS_PictureGrade="Printer1.PlugInDevmode.JCLPictureGrade";
var PDS_PictureGradePCL="Printer1.PlugInDevmode.PictureGrade";
var PDS_Font_TT_Download="Printer1.PlugInDevmode.FontHandling.TrueType.Download";
var PDS_Font_TT_SubPrinter="Printer1.PlugInDevmode.FontHandling.TrueType.SubPrinter";
var PDS_Font_TT_PrtrWidths="Printer1.PlugInDevmode.FontHandling.TrueType.PrinterWidths";
var PDS_Font_PF_TellApp="Printer1.PlugInDevmode.FontHandling.PrinterFonts.TellApp";
var PDS_Font_PF_W1="Printer1.PlugInDevmode.FontHandling.PrinterFonts.CharSets.W1";
var PDS_Font_PF_WE="Printer1.PlugInDevmode.FontHandling.PrinterFonts.CharSets.WE";
var PDS_Font_PF_WR="Printer1.PlugInDevmode.FontHandling.PrinterFonts.CharSets.WR";
var PDS_Font_PF_WG="Printer1.PlugInDevmode.FontHandling.PrinterFonts.CharSets.WG";
var PDS_Font_PF_WT="Printer1.PlugInDevmode.FontHandling.PrinterFonts.CharSets.WT";
var PDS_Font_PF_WL="Printer1.PlugInDevmode.FontHandling.PrinterFonts.CharSets.WL";
var PDS_Phantom="Printer1.Phantom";
var PDS_Spec="Printer1.PrinterSpec";
var PDS_WebIP="Printer1.PrinterSpec.WebIP";
var PDS_PrtrURL="Printer1.Phantom.PrtrURL";
var PDS_EditWatermark="Printer1.Phantom.EditWatermark";
var PDS_WatermarkSel="Printer1.Phantom.WatermarkSel";
var PDS_ChkWmarkName="Printer1.Procedures.CanAddWatermark";
var PDS_AddWatermark="Printer1.Procedures.AddWatermark";
var PDS_RemoveWatermark="Printer1.Procedures.RemoveWatermark";
var PDS_UpdWatermarkOpt="Printer1.Procedures.UpdateWatermark";
var PDS_Admin="Printer1.DeviceContext.Administrator";
var PDS_MasterUnits="Printer1.DeviceContext.MasterUnits";
var PDS_Permission="Printer1.DeviceContext.Permission";
var PDS_InstallableOptions="Printer1.PlugInDevmode.InstallableOptions";
var PDS_InstalledItem="Printer1.Phantom.InstalledOption";
var PDS_InstallableItem="Printer1.Phantom.InstallableOption";
var PDS_AutoBiDiUpdate="Printer1.PlugInDevmode.AutoBiDiUpdate";
var PDS_BiDiAvailable="Printer1.Phantom.BiDiAvailable";
var PDS_Constraints="Printer1.Constraints";
var PDS_InstalledMem="Printer1.PlugInDevmode.InstalledMemory";
var PDS_PrtrCollate="Printer1.PlugInDevmode.PrinterBasedCollate";
var PDS_Profiles="Printer1.PlugInDevmode.Profiles";
var PDS_ProfSaveName="Printer1.Phantom.ProfSaveName";
var PDS_LoadDelProfItem="Printer1.Phantom.LoadDelProfItem";
var PDS_SaveProfile="Printer1.Procedures.SaveProfile";
var PDS_LoadProfile="Printer1.Procedures.LoadProfile";
var PDS_DelProfile="Printer1.Procedures.DeleteProfile";
var PDS_MetaFile="Printer1.PlugInDevmode.MetaFile";
var PDS_Brightness="Printer1.PlugInDevmode.Brightness";
var PDS_Contrast="Printer1.PlugInDevmode.Contrast";
var PDS_Saturation="Printer1.PlugInDevmode.Saturation";
var PDS_RGBCorrection="Printer1.PlugInDevmode.RGBCorrection";
var PDS_GrayCorrection="Printer1.PlugInDevmode.GrayCorrection";
var PDS_FineLines="Printer1.PlugInDevmode.FineLines";
var PDS_SelFontSub="Printer1.Phantom.SelFontSub";
var PDS_FontSub="Printer1.PlugInDevmode.FontSubstitution";
var PDS_DefaultFontSub="Printer1.Procedures.DefaultFontSubTable";
var PDS_MaxFontSize="Printer1.PSDevmode.MaxFontSize";
var PDS_MinFontSize="Printer1.PSDevmode.MinFontSize";
var PDS_OptimizeOutput="Printer1.PSDevmode.OptimizeOutput";
var PDS_MISFrontCoverProc="Printer1.Procedures.MISFrontCover";
var PDS_MISFirstPageProc="Printer1.Procedures.MISFirstPage";
var PDS_MISLastPageProc="Printer1.Procedures.MISLastPage";
var PDS_MISBackCoverProc="Printer1.Procedures.MISBackCover";
var PDS_MISOnLoadProc="Printer1.Procedures.MISOnLoad";
var PDS_Resolution="Printer1.Devmode.PrintQualityPCL";
var PDS_GraphicMode="Printer1.PlugInDevmode.GraphicMode";
var PDS_XLPageSize="Printer1.PlugInDevmode.XlPageSize";
var PDS_MetafileSpooling="Printer1.PlugInDevmode.MetafileSpooling";
var PDS_Dithering="Printer1.PlugInDevmode.Dithering";
var PDS_TextBrt="Printer1.PlugInDevmode.ColorManagement.TextBrightness";
var PDS_TextSat="Printer1.PlugInDevmode.ColorManagement.TextSaturation";
var PDS_TextGam="Printer1.PlugInDevmode.ColorManagement.TextGamma";
var PDS_GraphicsBrt="Printer1.PlugInDevmode.ColorManagement.GraphicsBrightness";
var PDS_GraphicsSat="Printer1.PlugInDevmode.ColorManagement.GraphicsSaturation";
var PDS_GraphicsGam="Printer1.PlugInDevmode.ColorManagement.GraphicsGamma";
var PDS_ImageBrt="Printer1.PlugInDevmode.ColorManagement.ImageBrightness";
var PDS_ImageSat="Printer1.PlugInDevmode.ColorManagement.ImageSaturation";
var PDS_ImageGam="Printer1.PlugInDevmode.ColorManagement.ImageGamma";
var PDS_PgProtect="Printer1.PlugInDevmode.PageProtect";
var PDS_SelUserPaper="Printer1.Phantom.SelUserPaper";
var PDS_EditUserPaper="Printer1.Phantom.EditUserPaper";
var PDS_AddUserPaper="Printer1.Procedures.AddUserPaper";
var PDS_EditUserPaper1="Printer1.Procedures.EditUserPaper1";
var PDS_RemoveUserPaper="Printer1.Procedures.RemoveUserPaper";
var PDS_UserPaperSpec="Printer1.PrinterSpec.UserPaper";
var PDS_UserPaperSize="Printer1.PlugInDevmode.UserPaperSize";
var PDS_AdminUserPaperSize="Printer1.PlugInDevmode.AdminUserPaperSize";
var PDS_SelCustomForm="Printer1.Phantom.SelCustomForm";
var PDS_EditCustomForm="Printer1.Phantom.EditCustomForm";
var PDS_AddCustomForm="Printer1.Procedures.AddCustomForm";
var PDS_RemoveCustomForm="Printer1.Procedures.RemoveCustomForm";
var PDS_CustomFormSize="Printer1.PlugInDevmode.CustomFormSize";
var PDS_ColorSaverPCL="Printer1.PlugInDevmode.ColorSaver";
var PDS_AllServerPapers="Printer1.PlugInDevmode.AllServerPaperSize"
var PDS_UpdUserPaperOpt="Printer1.Procedures.UpdateUserPaper";
var PDS_ModelLow="Printer1.PlugInDevmode.ModelLow";
var PDS_PQLabel="Printer1.PlugInDevmode.PQLabel";
var PDS_NPAValue="Printer1.PlugInDevmode.NPAValue";
var PDS_SmallFontEnhancer="Printer1.PlugInDevmode.SmallFontEnhancer";
var PDS_PixelBoost="Printer1.PlugInDevmode.PixelBoost";
@END
@DocProps PrintProps
function InitPhantomFeatures(src){
var pqCust=true;
var values=new Object();
var feat;
if(((feat=eval(PDS_TonerDark))!==undefined)){
values.td=feat.getValue().nameId.getValue();
}else{
values.td="PrinterSetting";}
if((feat=eval(PDS_Resolution))!==undefined){
values.res=feat.getValue().nameId.getValue();}
if((feat=eval(PDS_ColorSaver))!==undefined){
values.cs=feat.getValue().nameId.getValue();}
if((feat=eval(PDS_PictureGradePCL))!==undefined){
values.pg=feat.getValue().nameId.getValue();}
if((feat=eval(PDS_FineLines))!==undefined){
values.fl=feat.getValue().nameId.getValue();}
if((feat=eval(PDS_ColorCorrection))!==undefined){
values.cc=feat.getValue().nameId.getValue();}
if((feat=eval(PDS_RGBImages))!==undefined){
values.rgbim=feat.getValue().nameId.getValue();}
if((feat=eval(PDS_RGBText))!==undefined){
values.rgbtt=feat.getValue().nameId.getValue();}
if((feat=eval(PDS_RGBGraphics))!==undefined){
values.rgbgp=feat.getValue().nameId.getValue();}
if((feat=eval(PDS_RGBCorrection))!==undefined){
values.rgbcc=feat.getValue().nameId.getValue();}
if((feat=eval(PDS_Saturation))!==undefined){
values.sat=feat.getValue();}
var mItem=PQ_map_Match(values);
if(mItem!==undefined){
pqCust=mItem.cust;}
var trans=new Transaction(src);
var fCust=eval(PDS_PQCustom);
fCust.setValue(pqCust);
trans.evaluate();
trans.commit();}
function proto_PhantomFeature(){
this.AddEventHandler=PhantomFeature_AddEventHandler;
this.RemoveEventHandler=PhantomFeature_RemoveEventHandler;
this.setValue=PhantomFeature_SetValue;
this.getValue=PhantomFeature_GetValue;
this.putValue=PhantomFeature_putValue;
this.fireEvents=PhantomFeature_fireEvents;
this.reverse=PhantomFeature_reverse;}
proto_PhantomFeature.prototype=null;
function PhantomFeature(name){
this.name=name;
this._objects=new Object();
this._events=new Array();}
PhantomFeature.base=null;
PhantomFeature.prototype=new proto_PhantomFeature();
PhantomFeature.prototype.constructor=PhantomFeature;
function PhantomFeature_AddEventHandler(eventName,func,obj){
var evt=new Object();
evt.name=eventName;
evt.func=func;
evt.obj=obj;
this._events[this._events.length]=evt;}
function PhantomFeature_RemoveEventHandler(eventName,func){
for(var index=0; index<this._events.length; index++){
if((this._events[index].name==eventName)&&
(this._events[index].func==func)){
this._events=this._events.slice(0,index).concat(this._events.slice(index+1));
break;}}}
function PhantomFeature_SetValue(value,log){
if(value!=this._value){
var context=new FeatContext(value,this._value);
log.scrLog.Add(this,context);}}
function PhantomFeature_GetValue(){
if(this._value==undefined){
this._value=this.GetInitialValue();}
return this._value;}
function PhantomFeature_putValue(value){
this._value=value;}
function PhantomFeature_fireEvents(context){
for(var i=0; i<this._events.length; i++){
var event=this._events[i];
if(event.name=="onChange"){
if(event.obj){
event.obj._LogInfoFunc_=event.func;
event.obj._LogInfoFunc_(this, context, event.name);
delete event.obj._LogInfoFunc_;
}else{
event.func(this, context, event.name);}}}}
function PhantomFeature_reverse(context){
var revContext=new FeatContext(context.getOldValue(),context.getNewValue());
return revContext;}
@END
@DocProps PrintProps
function Transaction(uiObj){
FeatureContext.openTransaction();}
Transaction.prototype.evaluate=Transaction_evaluate;
Transaction.prototype.commit=Transaction_commit;
Transaction.prototype.rollback=Transaction_rollback;
function Transaction_evaluate(){
FeatureContext.evalTransaction();}
function Transaction_commit(){
FeatureContext.closeTransaction();}
function Transaction_rollback(){
FeatureContext.undoTransaction();
FeatureContext.closeTransaction();}
@END
@DocProps PrintProps
function proto_ObjectProxy(){
this.HostObj=ObjectProxy_HostObj;
this.NotifyHostObjRemoved=ObjectProxy_NotifyHostObjRemoved;
this.Destroy=ObjectProxy_Destroy;
this.TerminateNotice=ObjectProxy_TerminateNotice;
this.HookEvent=ObjectProxy_HookEvent;
this.UnhookEvent=ObjectProxy_UnhookEvent;
this.AddObitRequest=ObjectProxy_AddObitRequest;
this.RemoveObitRequest=ObjectProxy_RemoveObitRequest;
this.Attach=ObjectProxy_Attach;
this.Detach=ObjectProxy_Detach;
this.OnHostObjRetire=ObjectProxy_OnHostObjRetire;}
proto_ObjectProxy.prototype=null;
function ObjectProxy(){
this.hostObjs=new Object();
this.hookedEvents=new Array();}
ObjectProxy.base=proto_ObjectProxy.prototype;
ObjectProxy.prototype=new proto_ObjectProxy();
ObjectProxy.prototype.constructor=ObjectProxy;
function ObjectProxy_Attach(hostObj,objId){
if(!this.hostObjs[objId]){
this.hostObjs[objId]=hostObj;
this.HookEvent(objId,"onRetire",this.OnHostObjRetire);
}else throw new Error("Already exists");}
function ObjectProxy_Detach(objId){
var hostObj=this.hostObjs[objId];
if(hostObj){
for(var i=0; i<this.hookedEvents.length; i++){
if(this.hookedEvents[i].obj==hostObj){
var evt=this.hookedEvents[i];
evt.obj.RemoveEventHandler(evt.name,evt.func,this);
this.hookedEvents=this.hookedEvents.slice(0,i).concat(this.hookedEvents.slice(i+1));
i--;}}
for(var objId in this.hostObjs){
if(this.hostObjs[objId]==hostObj){
delete this.hostObjs[objId];
break;}}
}else throw new Error("Does not exist");}
function ObjectProxy_HostObj(objId){
return this.hostObjs[objId];}
function ObjectProxy_OnHostObjRetire(src,context,name){
for(var i=0; i<this.hookedEvents.length; i++){
if(this.hookedEvents[i].obj==src){
this.hookedEvents=this.hookedEvents.slice(0,i).concat(this.hookedEvents.slice(i+1));
i--;}}
var destroy_requested;
for(var objId in this.hostObjs){
if(this.hostObjs[objId]==src){
delete this.hostObjs[objId];
if(this.NotifyHostObjRemoved(objId)){
destroy_requested=true;}}}
if(destroy_requested){
this.Destroy();}}
function ObjectProxy_NotifyHostObjRemoved(objId){
return true;}
function ObjectProxy_Destroy(){
for(var i=0; i<this.hookedEvents.length; i++){
var evt=this.hookedEvents[i];
evt.obj.RemoveEventHandler(evt.name,evt.func,this);}
this.hookedEvents.length=0;
this.TerminateNotice();
for(var objId in this.hostObjs){
delete this.hostObjs[objId];}
if(this.obitRequests){
for(var i=0; i<this.obitRequests.length; i++){
var req=this.obitRequests[i];
req.obj.ObitNotice(this,req.cbData);}
delete this.obitRequests;}}
function ObjectProxy_TerminateNotice(){}
function ObjectProxy_AddObitRequest(requestor,cbData){
if(this.obitRequests===undefined){
this.obitRequests=new Array();}
this.obitRequests[this.obitRequests.length]={obj : requestor, cbData : cbData};}
function ObjectProxy_RemoveObitRequest(requestor){
if(this.obitRequests){
for(var i=0; i<this.obitRequests.length; i++){
if(this.obitRequests[i].obj==requestor){
this.obitRequests=this.obitRequests.slice(0,i).concat(this.obitRequests.slice(i+1));
break;}}}}
function ObjectProxy_HookEvent(objId,eventName,func){
var hostObj=this.hostObjs[objId];
if(hostObj){
hostObj.AddEventHandler(eventName,func,this);
var evt={obj : hostObj, name : eventName, func : func};
this.hookedEvents[this.hookedEvents.length]=evt;
}else throw new Error("Does not exist");}
function ObjectProxy_UnhookEvent(objId,eventName,func){
var hostObj=this.hostObjs[objId];
if(hostObj){
for(var i=0; i<this.hookedEvents.length; i++){
if((this.hookedEvents[i].obj==hostObj)&&
(this.hookedEvents[i].name==eventName)&&
(this.hookedEvents[i].func==func)){
var evt=this.hookedEvents[i];
evt.obj.RemoveEventHandler(evt.name,evt.func,this);
this.hookedEvents=this.hookedEvents.slice(0,i).concat(this.hookedEvents.slice(i+1));
break;}}
}else throw new Error("Does not exist");}
function proto_ListItemProxy(){
this.Init=ListItemProxy_Init;
this.AttachFeature=ListItemProxy_AttachFeature;
this.AttachFeatObj=ListItemProxy_AttachFeatObj;
this.OnTextChange=ListItemProxy_OnTextChange;
this.OnConstraintChange=ListItemProxy_OnConstraintChange;
this.UpdateConstraint=ListItemProxy_UpdateConstraint;
this.textId="resId";}
proto_ListItemProxy.prototype=ObjectProxy.prototype;
function ListItemProxy(uiObj){
this._BaseClassConstructor_=arguments.callee.base.constructor;
this._BaseClassConstructor_();
delete this._BaseClassConstructor_;
this.Attach(uiObj,"uiObj");}
ListItemProxy.base=proto_ListItemProxy.prototype;
ListItemProxy.prototype=new proto_ListItemProxy();
ListItemProxy.prototype.constructor=ListItemProxy;
function ListItemProxy_Init(obj){
if(obj){
this.AttachFeatObj(obj);}
var constraint=this.HostObj("constraint");
if(constraint){
this.UpdateConstraint(this.HostObj("uiObj"),constraint);}}
function ListItemProxy_AttachFeature(fPath){
var obj=eval(fPath+".getValue()");
if(obj){
this.AttachFeatObj(obj);}}
function ListItemProxy_AttachFeatObj(obj){
var feature;
if(this.textId!=""){
feature=obj[this.textId];
}else{
feature=obj;}
if(feature){
this.Attach(feature,"txtFeat");
this.HookEvent("txtFeat","onChange",this.OnTextChange);}
feature=obj.isConstrained;
if(feature){
this.Attach(feature,"constraint");
this.HookEvent("constraint","onChange",this.OnConstraintChange);}}
function ListItemProxy_OnTextChange(src,context,name){
var fVal=context.getNewValue();
this.HostObj("uiObj").text=fVal;}
function ListItemProxy_OnConstraintChange(src,context,name){
this.UpdateConstraint(this.HostObj("uiObj"),src);}
function ListItemProxy_UpdateConstraint(uiObj,constraint){
var isConstrained=constraint.getValue();
if(uiObj.isEnabled!==undefined){
uiObj.isEnabled=(isConstrained!=true);
}else{
uiObj.color=(isConstrained==true)? 8421504 : 0;}}
function proto_SelectItemAttrProxy(){
this.AttachFeature=SelectItemAttrProxy_AttachFeature;
this.AttachFeatObj=SelectItemAttrProxy_AttachFeatObj;
this.NotifyHostObjRemoved=SelectItemAttrProxy_NotifyHostObjRemoved;
this.OnSelectionChange=SelectItemAttrProxy_OnSelectionChange;
this.OnAttrChange=SelectItemAttrProxy_OnAttrChange;
this.SetAttr=SelectItemAttrProxy_SetAttr;
this.attrId="resId";}
proto_SelectItemAttrProxy.prototype=ObjectProxy.prototype;
function SelectItemAttrProxy(uiObj){
this._BaseClassConstructor_=arguments.callee.base.constructor;
this._BaseClassConstructor_();
delete this._BaseClassConstructor_;
this.Attach(uiObj,"uiObj");}
SelectItemAttrProxy.base=proto_SelectItemAttrProxy.prototype;
SelectItemAttrProxy.prototype=new proto_SelectItemAttrProxy();
SelectItemAttrProxy.prototype.constructor=SelectItemAttrProxy;
function SelectItemAttrProxy_AttachFeature(fPath){
var obj=eval(fPath);
if(obj){
this.AttachFeatObj(obj);}}
function SelectItemAttrProxy_AttachFeatObj(selFeat){
var attrFeat=selFeat.getValue()[this.attrId];
if(attrFeat){
this.Attach(selFeat,"selFeat");
this.HookEvent("selFeat","onChange",this.OnSelectionChange);
this.Attach(attrFeat,"attrFeat");
this.HookEvent("attrFeat","onChange",this.OnAttrChange);
var value=attrFeat.getValue();
this.SetAttr(this.HostObj("uiObj"),value);}}
function SelectItemAttrProxy_NotifyHostObjRemoved(objId){
var rc=true;
if(objId=="attrFeat"){
rc=false;}
return rc;}
function SelectItemAttrProxy_OnSelectionChange(src,context,name){
if(this.HostObj("attrFeat")){
this.Detach("attrFeat");}
var value;
var attrFeat=context.getNewValue()[this.attrId];
if(attrFeat){
this.Attach(attrFeat,"attrFeat");
this.HookEvent("attrFeat","onChange",this.OnAttrChange);
value=attrFeat.getValue();}
this.SetAttr(this.HostObj("uiObj"),value);}
function SelectItemAttrProxy_OnAttrChange(src,context,name){
var value=context.getNewValue();
this.SetAttr(this.HostObj("uiObj"),value);}
function SelectItemAttrProxy_SetAttr(uiObj,value){}
function proto_LabelProxy(){
this.Init=LabelProxy_Init;
this.AttachFeature=LabelProxy_AttachFeature;
this.AttachFeatObj=LabelProxy_AttachFeatObj;
this.OnFeatChange=LabelProxy_OnFeatChange;}
proto_LabelProxy.prototype=ObjectProxy.prototype;
function LabelProxy(uiObj){
this._BaseClassConstructor_=arguments.callee.base.constructor;
this._BaseClassConstructor_();
delete this._BaseClassConstructor_;
this.Attach(uiObj,"uiObj");}
LabelProxy.base=proto_LabelProxy.prototype;
LabelProxy.prototype=new proto_LabelProxy();
LabelProxy.prototype.constructor=LabelProxy;
function LabelProxy_AttachFeature(fPath){
var feature=eval(fPath);
if(feature){
this.AttachFeatObj(feature);}}
function LabelProxy_AttachFeatObj(feature){
this.Attach(feature,"feat");
this.HookEvent("feat","onChange",this.OnFeatChange);}
function LabelProxy_Init(){
var val=this.HostObj("feat").getValue();
this.HostObj("uiObj").setLabel(val);}
function LabelProxy_OnFeatChange(src,context,name){
var val=context.getNewValue();
this.HostObj("uiObj").setLabel(val);}
function proto_SliderProxy(){
this.Init=SliderProxy_Init;
this.AttachFeature=SliderProxy_AttachFeature;
this.AttachFeatObj=SliderProxy_AttachFeatObj;
this.OnCtrlChange=SliderProxy_OnCtrlChange;
this.OnFeatChange=SliderProxy_OnFeatChange;}
proto_SliderProxy.prototype=ObjectProxy.prototype;
function SliderProxy(uiObj){
this._BaseClassConstructor_=arguments.callee.base.constructor;
this._BaseClassConstructor_();
delete this._BaseClassConstructor_;
this.Attach(uiObj,"uiObj");
this.HookEvent("uiObj","onChange",this.OnCtrlChange);}
SliderProxy.base=proto_SliderProxy.prototype;
SliderProxy.prototype=new proto_SliderProxy();
SliderProxy.prototype.constructor=SliderProxy;
function SliderProxy_AttachFeature(fPath){
var feature=eval(fPath);
if(feature){
this.AttachFeatObj(feature);}}
function SliderProxy_AttachFeatObj(feature){
this.Attach(feature,"feat");
this.HookEvent("feat","onChange",this.OnFeatChange);}
function SliderProxy_Init(){
var val=this.HostObj("feat").getValue();
this.HostObj("uiObj").setPos(val);}
function SliderProxy_OnCtrlChange(src,context,name){
var trans=new Transaction(src);
var cVal=src.getPos();
this.HostObj("feat").setValue(cVal);
trans.evaluate();
trans.commit();}
function SliderProxy_OnFeatChange(src,context,name){
var val=context.getNewValue();
this.HostObj("uiObj").setPos(val);}
function proto_ButtonProxy(){
this.Init=ButtonProxy_Init;
this.AttachFeature=ButtonProxy_AttachFeature;
this.AttachFeatObj=ButtonProxy_AttachFeatObj;
this.OnFeatChange=ButtonProxy_OnFeatChange;
this.OnCtrlChange=ButtonProxy_OnCtrlChange;
this.Convert=ButtonProxy_Convert;
this.GetOnVal=ButtonProxy_GetOnVal;
this.GetOffVal=ButtonProxy_GetOffVal;
this.fOn=true;
this.fOff=false;}
proto_ButtonProxy.prototype=ObjectProxy.prototype;
function ButtonProxy(uiObj){
this._BaseClassConstructor_=arguments.callee.base.constructor;
this._BaseClassConstructor_();
delete this._BaseClassConstructor_;
this.Attach(uiObj,"uiObj");
this.HookEvent("uiObj","onClick",this.OnCtrlChange);}
ButtonProxy.base=proto_ButtonProxy.prototype;
ButtonProxy.prototype=new proto_ButtonProxy();
ButtonProxy.prototype.constructor=ButtonProxy;
function ButtonProxy_AttachFeature(fPath){
var feature=eval(fPath);
if(feature){
this.AttachFeatObj(feature);}}
function ButtonProxy_AttachFeatObj(feature){
this.Attach(feature,"feat");
this.HookEvent("feat","onChange",this.OnFeatChange);}
function ButtonProxy_Init(){
var val=this.Convert("f2c",this.HostObj("feat").getValue());
this.HostObj("uiObj").isChecked=val;}
function ButtonProxy_OnFeatChange(src,context,name){
var val=this.Convert("f2c",context.getNewValue());
this.HostObj("uiObj").isChecked=val;}
function ButtonProxy_OnCtrlChange(src,context,name){
var val=this.Convert("c2f",src.isChecked);
if(val!==undefined){
var trans=new Transaction(src);
this.HostObj("feat").setValue(val);
trans.evaluate();
trans.commit();}}
function ButtonProxy_Convert(direction,inVal){
var outVal;
if(direction=="c2f"){
if(this.invert){
inVal=!inVal;}
if(inVal){
outVal=this.GetOnVal();
}else{
outVal=this.GetOffVal();}
}else{
outVal=false;
if(inVal==this.GetOnVal()){
outVal=true;}
if(this.invert){
outVal=!outVal;}}
return outVal;}
function ButtonProxy_GetOnVal(){
return this.fOn;}
function ButtonProxy_GetOffVal(){
return this.fOff;}
function proto_ContainerProxy(){
this.GetUiObjId=ContainerProxy_GetUiObjId;
this.AttachComponent=ContainerProxy_AttachComponent;
this.AttachFeature=ContainerProxy_AttachFeature;
this.ComponentTerminated=ContainerProxy_ComponentTerminated;
this.NotifyCompRemoved=ContainerProxy_NotifyCompRemoved;
this.TerminateNotice=ContainerProxy_TerminateNotice;
this.Init=ContainerProxy_Init;
this.InitUiObj=ContainerProxy_InitUiObj;
this.CompValChange=ContainerProxy_CompValChange;
this.GetComponent=ContainerProxy_GetComponent;
this.GetComponentValues=ContainerProxy_GetComponentValues;
this.GetComponentDefaults=ContainerProxy_GetComponentDefaults;
this.GetDefaultUiVal=ContainerProxy_GetDefaultUiVal;
this.SetUiValFromComps=ContainerProxy_SetUiValFromComps;
this.OnUiValChange=ContainerProxy_OnUiValChange;
this.PostUiValChange=ContainerProxy_PostUiValChange;
this.SetComponents=ContainerProxy_SetComponents;
this.SetUiVal=ContainerProxy_SetUiVal;
this.GetUiVal=ContainerProxy_GetUiVal;
this.Convert=ContainerProxy_Convert;
this.uiObjId="uiObj";}
proto_ContainerProxy.prototype=ObjectProxy.prototype;
function ContainerProxy(uiObj,uiObjId){
this._BaseClassConstructor_=arguments.callee.base.constructor;
this._BaseClassConstructor_();
delete this._BaseClassConstructor_;
if(uiObjId){
this.uiObjId=uiObjId;}
this.Attach(uiObj,this.uiObjId);}
ContainerProxy.base=proto_ContainerProxy.prototype;
ContainerProxy.prototype=new proto_ContainerProxy();
ContainerProxy.prototype.constructor=ContainerProxy;
function ContainerProxy_GetUiObjId(){
return this.uiObjId;}
function ContainerProxy_AttachComponent(obj,name, options){
if(!this.proxies){
this.proxies=new Array();}
this.proxies[this.proxies.length]={obj : obj, component : name}, options;
obj.AddCompListener(this,name);}
function ContainerProxy_AttachFeature(fPath){
var ap=new VariablePathProxy();
ap.AttachFeature(fPath);
this.AttachComponent(ap,"val");
return ap;}
function ContainerProxy_ComponentTerminated(obj,cbData){
for(var i=0; i<this.proxies.length; i++){
if(this.proxies[i].obj==obj){
this.proxies=this.proxies.slice(0,i).concat(this.proxies.slice(i+1));
break;}}
if(this.NotifyCompRemoved(cbData)){
this.Destroy();}}
function ContainerProxy_NotifyCompRemoved(cbData){
return true;}
function ContainerProxy_TerminateNotice(){
if(this.proxies!==undefined){
for(var i=0; i<this.proxies.length; i++){
this.proxies[i].obj.RemoveCompListener(this);}}
this._TerminateNotice_=ContainerProxy.base.TerminateNotice;
this._TerminateNotice_();
delete this._TerminateNotice_;}
function ContainerProxy_Init(){
for(var i=0; i<this.proxies.length; i++){
var pxInfo=this.proxies[i];
pxInfo.obj.InitComp();}
this.InitUiObj();}
function ContainerProxy_InitUiObj(){
this.SetUiValFromComps();}
function ContainerProxy_CompValChange(compVal,aggrPrxy,cbData){
var val=new Object();
val[cbData]=compVal;
this.SetUiValFromComps(val);}
function ContainerProxy_GetComponent(compName){
var obj;
for(var i=0; i<this.proxies.length; i++){
var pxInfo=this.proxies[i];
if((pxInfo.component)&&
(pxInfo.component==compName)){
obj=pxInfo.obj;
break;}}
return obj;}
function ContainerProxy_GetComponentValues(val){
if(!val){
val=new Object();}
for(var i=0; i<this.proxies.length; i++){
var pxInfo=this.proxies[i];
if((pxInfo.component)&&
(!pxInfo.manualRead)&&
(val[pxInfo.component]===undefined)){
val[pxInfo.component]=pxInfo.obj.GetCompValue();}}
return val;}
function ContainerProxy_GetComponentDefaults(){
var val=new Object();
for(var i=0; i<this.proxies.length; i++){
var pxInfo=this.proxies[i];
if((pxInfo.component)&&
(!pxInfo.manualRead)&&
(val[pxInfo.component]===undefined)){
val[pxInfo.component]=pxInfo.obj.GetCompDefault();}}
return val;}
function ContainerProxy_GetDefaultUiVal(){
var fVal=this.GetComponentDefaults();
var val=this.Convert("f2c",fVal);
return val;}
function ContainerProxy_SetUiValFromComps(val){
val=this.GetComponentValues(val);
var uiVal=this.Convert("f2c",val);
if(uiVal!==undefined){
this.SetUiVal(this.HostObj(this.uiObjId),uiVal);}}
function ContainerProxy_OnUiValChange(src,context,name){
var uiVal=this.GetUiVal(this.HostObj(this.uiObjId));
this.PostUiValChange(uiVal,src,context,name);}
function ContainerProxy_PostUiValChange(uiVal,src,context,name){
var val=this.Convert("c2f",uiVal);
if(val!==undefined){
var trans=new Transaction(src);
this.SetComponents(val);
trans.evaluate();
trans.commit();}}
function ContainerProxy_SetComponents(val,cLog){
for(var i=0; i<this.proxies.length; i++){
var pxInfo=this.proxies[i];
if((pxInfo.component)&&(!pxInfo.readOnly)){
var pVal=val[pxInfo.component];
if(pVal!==undefined){
pxInfo.obj.SetCompValue(pVal,cLog);}}}}
function ContainerProxy_NotifyCompRemoved(cbData){
return true;}
function ContainerProxy_SetUiVal(uiObj,uiVal){}
function ContainerProxy_GetUiVal(uiObj){
return undefined;}
function ContainerProxy_Convert(direction,inVal){
return inVal;}
function proto_VariablePathProxy(){
this.Init=VariablePathProxy_Init;
this.AttachFeature=VariablePathProxy_AttachFeature;
this.SetParms=VariablePathProxy_SetParms;
this.OnChangeInFeaturePath=VariablePathProxy_OnChangeInFeaturePath;
this.RefreshFeaturePath=VariablePathProxy_RefreshFeaturePath;
this.OnUiValChange=VariablePathProxy_OnUiValChange;
this.SetFeatFromKey=VariablePathProxy_SetFeatFromKey;
this.SetFeature=VariablePathProxy_SetFeature;
this.GetUiObjId=VariablePathProxy_GetUiObjId;
this.HostObjExplicit=VariablePathProxy_HostObjExplicit;
this.ParseNodes=VariablePathProxy_ParseNodes;
this.ReparseNodes=VariablePathProxy_ReparseNodes;
this.NextNode=VariablePathProxy_NextNode;
this.AllowEmptyNode=false;
this.SetUiValFromFeatVal=VariablePathProxy_SetUiValFromFeatVal;
this.SetFeatValue=VariablePathProxy_SetFeatValue;
this.GetFeatValue=VariablePathProxy_GetFeatValue;
this.OnFeatValChange=VariablePathProxy_OnFeatValChange;
this.RefreshFeature=VariablePathProxy_RefreshFeature;
this.GetSubObjFromPath=VariablePathProxy_GetSubObjFromPath;
this.GetUiVal=VariablePathProxy_GetUiVal;
this.SetUiVal=VariablePathProxy_SetUiVal;
this.featId="feature";
this.uiObjId="uiObj";
this.InitComp=VariablePathProxy_InitComp;
this.AddCompListener=VariablePathProxy_AddCompListener;
this.RemoveCompListener=VariablePathProxy_RemoveCompListener;
this.SetCompValue=VariablePathProxy_SetCompValue;
this.GetCompValue=VariablePathProxy_GetCompValue;
this.GetCompDefault=VariablePathProxy_GetCompDefault;
this.TerminateNotice=VariablePathProxy_TerminateNotice;
this.fKeyId="nameId";
this.fKeyPath=null;
this.GetKeyFromFeatValue=VariablePathProxy_GetKeyFromFeatValue;
this.GetFeatValueFromKey=VariablePathProxy_GetFeatValueFromKey;
this.GetKeyObjFromFeatValue=VariablePathProxy_GetKeyObjFromFeatValue;
this.GetUiValFromKey=VariablePathProxy_GetUiValFromKey;
this.GetKeyFromUiVal=VariablePathProxy_GetKeyFromUiVal;}
proto_VariablePathProxy.prototype=ObjectProxy.prototype;
function VariablePathProxy(uiObj,uiObjId){
this._BaseClassConstructor_=arguments.callee.base.constructor;
this._BaseClassConstructor_();
delete this._BaseClassConstructor_;
if(uiObj){
if(uiObjId){
this.uiObjId=uiObjId;}
this.Attach(uiObj,this.uiObjId);}}
VariablePathProxy.base=proto_VariablePathProxy.prototype;
VariablePathProxy.prototype=new proto_VariablePathProxy();
VariablePathProxy.prototype.constructor=VariablePathProxy;
function VariablePathProxy_Init(feature){
this.AttachFeature(feature);
var uiObj=this.HostObj(this.uiObjId);
feature=this.HostObj(this.featId);
this.SetUiValFromFeatVal(uiObj,this.GetFeatValue(feature));}
function VariablePathProxy_InitComp(){}
function VariablePathProxy_AttachFeature(feature){
if(feature){
if(typeof feature=="string"){
this[this.featId+"Path"]=feature;
feature=eval(feature);
}else if((typeof feature=="object") &&(feature.constructor==Array)){
this[this.featId+"Paths"]=feature;
feature=this.ParseNodes(feature,"featNode",this.OnChangeInFeaturePath);}
if(feature){
this.Attach(feature,this.featId);
this.HookEvent(this.featId,"onChange",this.OnFeatValChange);}}}
function VariablePathProxy_SetParms(parms){
for(var parmId in parms){
this[parmId]=parms[parmId];}}
function VariablePathProxy_GetUiObjId(){
return this.uiObjId;}
function VariablePathProxy_ParseNodes(paths,idPrefix,func){
var obj=this.NextNode(null,paths,0);
for(var i=1; i<paths.length; i++){
this.Attach(obj,idPrefix+i);
this.HookEvent(idPrefix+i,"onChange",func);
obj=this.NextNode(obj,paths,i);
if(!obj){
break;}}
return obj;}
function VariablePathProxy_GetUiValFromKey(key){
return key;}
function VariablePathProxy_GetKeyFromUiVal(uiVal){
return uiVal;}
function VariablePathProxy_SetUiValFromFeatVal(uiObj,featVal){
var key=this.GetKeyFromFeatValue(featVal);
if(this.listeners!==undefined){
for(var i=0; i<this.listeners.length; i++){
this.listeners[i].obj.CompValChange(key,this,this.listeners[i].data);}}
if(uiObj){
var uiVal=this.GetUiValFromKey(key);
this.SetUiVal(uiObj,uiVal);}}
function VariablePathProxy_OnChangeInFeaturePath(src,context,name){
this.RefreshFeaturePath(src);}
function VariablePathProxy_RefreshFeaturePath(src){
var uiObj=this.HostObj(this.uiObjId);
var newFeature=this.ReparseNodes(src,this[this.featId+"Paths"],"featNode",this.OnChangeInFeaturePath);
var oldFeature=this.HostObj(this.featId);
if(newFeature===oldFeature){
newFeature=null;}
if((oldFeature)&&
(newFeature!==null)){
this.Detach(this.featId);}
if(newFeature){
this.Attach(newFeature,this.featId);
this.HookEvent(this.featId,"onChange",this.OnFeatValChange);
this.SetUiValFromFeatVal(uiObj,this.GetFeatValue(newFeature));
}else if(newFeature===undefined){
this.SetUiValFromFeatVal(uiObj,undefined);}}
function VariablePathProxy_ReparseNodes(src,paths,idPrefix,func){
var newNode;
var oldNode;
var i=1;
while(oldNode=this.HostObj(idPrefix+i)){
if(oldNode==src){
newNode=this.NextNode(src,paths,i);
i++;
while(i<paths.length){
oldNode=this.HostObj(idPrefix+i);
if(newNode===oldNode){
newNode=null;
break;}
if(oldNode){
this.Detach(idPrefix+i);}
if(newNode){
this.Attach(newNode,idPrefix+i);
this.HookEvent(idPrefix+i,"onChange",func);
newNode=this.NextNode(newNode,paths,i);}
i++;}
break;}
i++;}
return newNode;}
function VariablePathProxy_NextNode(node,paths,idx){
var nextNode;
if(idx==0){
if(!(nextNode=eval(paths[0]))){
throw new Error("Invalid path");}
}else{
if(nextNode=node.getValue()){
if(paths[idx]!=""){
if(!(nextNode=eval("nextNode." + paths[idx]))){
throw new Error("Invalid path");}}
}else{
if(!this.AllowEmptyNode){
throw new Error("Node value is empty");}}}
return nextNode;}
function VariablePathProxy_OnFeatValChange(src,context,name){
this.SetUiValFromFeatVal(this.HostObj(this.uiObjId),context.getNewValue());}
function VariablePathProxy_RefreshFeature(feature){
this.SetUiValFromFeatVal(this.HostObj(this.uiObjId),this.GetFeatValue(feature));}
function VariablePathProxy_SetFeatValue(fObj,fVal){
fObj.setValue(fVal);}
function VariablePathProxy_GetFeatValue(fObj){
return fObj.getValue();}
function VariablePathProxy_SetFeatFromKey(feature,key){
var fVal=this.GetFeatValueFromKey(key);
this.SetFeature(feature,fVal);}
function VariablePathProxy_SetFeature(feature,fVal){
if(fVal!==undefined){
var trans=new Transaction(this.HostObj(this.uiObjId));
this.SetFeatValue(feature,fVal);
trans.evaluate();
trans.commit();}}
function VariablePathProxy_OnUiValChange(src,context,name){
var uiVal=this.GetUiVal(src);
var key=this.GetKeyFromUiVal(uiVal);
this.SetFeatFromKey(this.HostObj(this.featId),key);}
function VariablePathProxy_GetFeatValueFromKey(key){
return key;}
function VariablePathProxy_GetKeyFromFeatValue(featVal){
var key;
if(featVal!==undefined){
var keyObj=this.GetKeyObjFromFeatValue(featVal);
if(this.fKeyId!=null){
if(this.fKeyId!=""){
key=keyObj[this.fKeyId].getValue();
}else{
key=keyObj.getValue();}
}else{
key=keyObj;}
}else{
key=this.nullFeatVal;}
return key;}
function VariablePathProxy_GetKeyObjFromFeatValue(featVal){
return this.GetSubObjFromPath(featVal,this.fKeyPath);}
function VariablePathProxy_GetSubObjFromPath(obj,path){
var subObj;
if(path){
subObj=eval("obj." + path);
}else{
subObj=obj;}
return subObj;}
function VariablePathProxy_HostObjExplicit(objId){
var obj;
if(this[objId+"Paths"]){
var paths=this[objId+"Paths"];
var node=this.NextNode(null,paths,0);
for(var i=1; i<paths.length; i++){
node=this.NextNode(node,paths,i);
if(!node){
break;}}
obj=node;
}else
if(this[objId+"Path"]){
obj=eval(this[objId+"Path"]);
}else{
obj=this.HostObj(objId);}
return obj;}
function VariablePathProxy_GetUiVal(){
return undefined;}
function VariablePathProxy_SetUiVal(uiObj,uiVal){}
function VariablePathProxy_AddCompListener(obj,callBackData){
if(!this.listeners){
this.listeners=new Array();}
this.listeners[this.listeners.length]={obj : obj,data : callBackData};}
function VariablePathProxy_RemoveCompListener(obj){
for(var i=0; i<this.listeners.length; i++){
if(obj==this.listeners[i].obj){
this.listeners=this.listeners.slice(0,i).concat(this.listeners.slice(i+1));
break;}}
if((this.listeners.length==0)&&(this.HostObj(this.GetUiObjId())==null)){
this.Destroy();}}
function VariablePathProxy_SetCompValue(key){
var fVal=this.GetFeatValueFromKey(key);
if(fVal!==undefined){
this.SetFeatValue(this.HostObj(this.featId),fVal);}}
function VariablePathProxy_GetCompValue(){
var key;
var feature=this.HostObj(this.featId);
if(feature!==undefined){
var featVal=this.GetFeatValue(feature);
key=this.GetKeyFromFeatValue(featVal);}
return key;}
function VariablePathProxy_GetCompDefault(){
var key;
var feature=this.HostObj(this.featId);
if((feature!==undefined)&&(feature.Default!==undefined)){
var featVal=feature.Default.getValue();
key=this.GetKeyFromFeatValue(featVal);}
return key;}
function VariablePathProxy_TerminateNotice(){
if(this.listeners!==undefined){
for(var i=0; i<this.listeners.length; i++){
this.listeners[i].obj.ComponentTerminated(this,this.listeners[i].data);}
this.listeners.length=0;}
this._TerminateNotice_=VariablePathProxy.base.TerminateNotice;
this._TerminateNotice_();
delete this._TerminateNotice_;}
function proto_OptionListProxy(){
this.Init=OptionListProxy_Init;
this.AttachFeature=OptionListProxy_AttachFeature;
this.ValidateFeatVal=OptionListProxy_ValidateFeatVal;
this.CurrentFeatValInvalid=OptionListProxy_CurrentFeatValInvalid;
this.GetDefaultOptionObj=OptionListProxy_GetDefaultOptionObj;
this.OnChangeInCollectPath=OptionListProxy_OnChangeInCollectPath;
this.OnChangeInFeaturePath=OptionListProxy_OnChangeInFeaturePath;
this.OnOptionsChange=OptionListProxy_OnOptionsChange;
this.IsRefreshReqd=OptionListProxy_IsRefreshReqd;
this.ResetList=OptionListProxy_ResetList;
this.PopulateList=OptionListProxy_PopulateList;
this.GetMatchingOptionObj=OptionListProxy_GetMatchingOptionObj;
this.IsDisabled=OptionListProxy_IsDisabled;
this.GetFeatValueFromKey=OptionListProxy_GetFeatValueFromKey;
this.collId=this.featId;
this.keyId="nameId";
this.keyPath=null;
this.featValId=null;
this.featValPath=null;
this.GetKeyFromOptObj=OptionListProxy_GetKeyFromOptObj;
this.GetFeatValueFromOptObj=OptionListProxy_GetFeatValueFromOptObj;
this.GetKeyObjFromOptObj=OptionListProxy_GetKeyObjFromOptObj;
this.GetFValObjFromOptObj=OptionListProxy_GetFValObjFromOptObj;}
proto_OptionListProxy.prototype=VariablePathProxy.prototype;
function OptionListProxy(uiObj,uiObjId){
this._BaseClassConstructor_=arguments.callee.base.constructor;
this._BaseClassConstructor_(uiObj,uiObjId);
delete this._BaseClassConstructor_;}
OptionListProxy.base=proto_OptionListProxy.prototype;
OptionListProxy.prototype=new proto_OptionListProxy();
OptionListProxy.prototype.constructor=OptionListProxy;
function OptionListProxy_Init(feature,collection){
this.AttachFeature(feature,collection);
var uiObj=this.HostObj(this.uiObjId);
feature=this.HostObj(this.featId);
collection=this.HostObj(this.collId);
if(collection){
this.ResetList(uiObj);
this.PopulateList(uiObj,collection);
if(feature){
var fVal=this.GetFeatValue(feature);
if(this.ValidateFeatVal(fVal,collection)==false){
this.CurrentFeatValInvalid(feature,collection);
}else{
this.SetUiValFromFeatVal(uiObj,fVal);}}}}
function OptionListProxy_AttachFeature(feature,collection){
if(feature){
if(typeof feature=="string"){
this[this.featId+"Path"]=feature;
feature=eval(feature);
}else if((typeof feature=="object") &&(feature.constructor==Array)){
this[this.featId+"Paths"]=feature;
feature=this.ParseNodes(feature,"featNode",this.OnChangeInFeaturePath);}
if(feature){
this.Attach(feature,this.featId);
this.HookEvent(this.featId,"onChange",this.OnFeatValChange);}
if(collection){
this.collId="collection";
if(typeof collection=="string"){
this[this.collId+"Path"]=collection;
collection=eval(collection);
}else if((typeof collection=="object") &&(collection.constructor==Array)){
this[this.collId+"Paths"]=collection;
collection=this.ParseNodes(collection,"collNode",this.OnChangeInCollectPath);}
if(collection){
this.Attach(collection,this.collId);}}
if(this.HostObj(this.collId)){
this.HookEvent(this.collId,"onCollectionUpdate",this.OnOptionsChange);}}}
function OptionListProxy_ValidateFeatVal(featVal,collection){
var key=this.GetKeyFromFeatValue(featVal);
var collObj=this.GetMatchingOptionObj(key,collection);
return(collObj!=null);}
function OptionListProxy_CurrentFeatValInvalid(feature,collection){
var featVal;
var collObj=this.GetDefaultOptionObj(collection);
if(collObj){
featVal=this.GetFeatValueFromOptObj(collObj);
if(this.ValidateFeatVal(featVal,collection)==false){
featVal=undefined;}}
if(featVal===undefined){
for(var enumObjects=new Enumerator(collection);
!enumObjects.atEnd();
enumObjects.moveNext()){
collObj=enumObjects.item();
featVal=this.GetFeatValueFromOptObj(collObj);
if(this.ValidateFeatVal(featVal,collection)==true){
break;
}else{
featVal=undefined;}}}
if(featVal!==undefined){
this.SetFeature(feature,featVal);}}
function OptionListProxy_GetDefaultOptionObj(collection){
var def;
if(collection.Default){
def=collection.Default.getValue();}
return def;}
function OptionListProxy_OnChangeInCollectPath(src,context,name){
var uiObj=this.HostObj(this.uiObjId);
var newCollection=this.ReparseNodes(src,this[this.collId+"Paths"],"collNode",this.OnChangeInCollectPath);
var oldCollection=this.HostObj(this.collId);
if(newCollection===oldCollection){
newCollection=null;}
if((oldCollection)&&
(newCollection!==null)){
this.Detach(this.collId);
this.ResetList(uiObj);}
if(newCollection){
this.Attach(newCollection,this.collId);
this.HookEvent(this.collId,"onCollectionUpdate",this.OnOptionsChange);
this.PopulateList(uiObj,newCollection);
var feature=this.HostObjExplicit(this.featId);
if(feature){
var fVal=this.GetFeatValue(feature);
if(this.ValidateFeatVal(fVal,newCollection)==false){
this.CurrentFeatValInvalid(feature,newCollection);
}else{
this.SetUiValFromFeatVal(uiObj,fVal);}
}else if(feature===undefined){
this.SetUiVal(uiObj,undefined)}}}
function OptionListProxy_OnChangeInFeaturePath(src,context,name){
var uiObj=this.HostObj(this.uiObjId);
var newFeature=this.ReparseNodes(src,this[this.featId+"Paths"],"featNode",this.OnChangeInFeaturePath);
var oldFeature=this.HostObj(this.featId);
if(newFeature===oldFeature){
newFeature=null;}
if((oldFeature)&&
(newFeature!==null)){
this.Detach(this.featId);
if(this.featId==this.collId){
this.ResetList(uiObj);}}
if(newFeature){
this.Attach(newFeature,this.featId);
this.HookEvent(this.featId,"onChange",this.OnFeatValChange);
if(this.featId==this.collId){
this.HookEvent(this.collId,"onCollectionUpdate",this.OnOptionsChange);
this.PopulateList(uiObj,newFeature);}
var collection=this.HostObjExplicit(this.collId);
if(collection){
var fVal=this.GetFeatValue(newFeature);
if(this.ValidateFeatVal(fVal,collection)==false){
this.CurrentFeatValInvalid(newFeature,collection);
}else{
this.SetUiValFromFeatVal(uiObj,fVal);}}
}else if(newFeature===undefined){
this.SetUiVal(uiObj,undefined)}}
function OptionListProxy_IsRefreshReqd(src,context,name, feature,collection){
return true;}
function OptionListProxy_OnOptionsChange(src,context,name){
var feature=this.HostObj(this.featId);
var collection=this.HostObj(this.collId);
if(this.IsRefreshReqd(src,context,name, feature,collection)){
var uiObj=this.HostObj(this.uiObjId);
this.ResetList(uiObj);
if(collection){
this.PopulateList(uiObj,collection);
if(feature){
var fVal=this.GetFeatValue(feature);
if(this.ValidateFeatVal(fVal,collection)==false){
this.CurrentFeatValInvalid(feature,collection);
}else{
this.SetUiValFromFeatVal(uiObj,fVal);}}}}}
function OptionListProxy_GetFeatValueFromKey(key){
var fVal;
var collObj=this.GetMatchingOptionObj(key,this.HostObj(this.collId));
if(collObj){
fVal=this.GetFeatValueFromOptObj(collObj);
}else{
if(this.GetFeatValForUnmatchedKey){
fVal=this.GetFeatValForUnmatchedKey(key);}}
return fVal;}
function OptionListProxy_GetMatchingOptionObj(key,collection){
var obj=null;
if((typeof collection=="object") &&(collection.constructor==FeatureObject)){
collection=collection.Options.getValue();}
if(collection){
for(var enumObjects=new Enumerator(collection);
!enumObjects.atEnd();
enumObjects.moveNext()){
var collObject=enumObjects.item();
if((key==this.GetKeyFromOptObj(collObject))&&
(this.IsDisabled(collObject)==false)){
obj=collObject;
break;}}}
return obj;}
function OptionListProxy_IsDisabled(collObject){
var disabled=false;
if((collObject.isConstrained!==undefined)&&
(collObject.isConstrained.getValue()==true)){
disabled=true;}
return disabled;}
function OptionListProxy_GetKeyFromOptObj(collObj){
var key;
var keyObj=this.GetKeyObjFromOptObj(collObj);
if(this.keyId!=null){
if(this.keyId!=""){
key=keyObj[this.keyId].getValue();
}else{
key=keyObj.getValue();}
}else{
key=keyObj;}
return key;}
function OptionListProxy_GetFeatValueFromOptObj(collObj){
var val;
var fValObj=this.GetFValObjFromOptObj(collObj);
if(this.featValId!=null){
if(this.featValId!=""){
val=fValObj[this.featValId].getValue();
}else{
val=fValObj.getValue();}
}else{
val=fValObj;}
return val;}
function OptionListProxy_GetKeyObjFromOptObj(collObj){
return this.GetSubObjFromPath(collObj,this.keyPath);}
function OptionListProxy_GetFValObjFromOptObj(collObj){
return this.GetSubObjFromPath(collObj,this.featValPath);}
function OptionListProxy_ResetList(uiObj){}
function OptionListProxy_PopulateList(uiObj,collection){}
function xxxOptionListProxy_ReloadOptions(uiObj,collection){}
function proto_ListBoxProxy(){
this.InitComp=ListBoxProxy_InitComp;
this.GetUiVal=ListBoxProxy_GetUiVal;
this.SetUiVal=ListBoxProxy_SetUiVal;
this.AddItem=ListBoxProxy_AddItem;
this.InitItem=ListBoxProxy_InitItem;
this.ResetList=ListBoxProxy_ResetList;
this.PopulateList=ListBoxProxy_PopulateList;
this.IsItemListed=ListBoxProxy_IsItemListed;
this.ValidateFeatVal=ListBoxProxy_ValidateFeatVal;
this.AddProxyToItem=ListBoxProxy_AddProxyToItem;
this.CreateItemProxy=ListBoxProxy_CreateItemProxy;
this.textId="resId";
this.textPath=null;
this.iconId="iconId";
this.iconPath=null;
this.ItemProxyConstructor=ListItemProxy;
this.GetTextFromOptObj=ListBoxProxy_GetTextFromOptObj;
this.GetIconFromOptObj=ListBoxProxy_GetIconFromOptObj;
this.GetTextObjFromOptObj=ListBoxProxy_GetTextObjFromOptObj;
this.GetIconObjFromOptObj=ListBoxProxy_GetIconObjFromOptObj;}
proto_ListBoxProxy.prototype=OptionListProxy.prototype;
function ListBoxProxy(uiObj,uiObjId){
this._BaseClassConstructor_=arguments.callee.base.constructor;
this._BaseClassConstructor_(uiObj,uiObjId);
delete this._BaseClassConstructor_;
if(uiObj!==undefined){
this.HookEvent(this.GetUiObjId(),"onChange",this.OnUiValChange);}}
ListBoxProxy.base=proto_ListBoxProxy.prototype;
ListBoxProxy.prototype=new proto_ListBoxProxy();
ListBoxProxy.prototype.constructor=ListBoxProxy;
function ListBoxProxy_InitComp(){
this.Init(undefined,undefined);}
function ListBoxProxy_PopulateList(uiObj,collection){
if((typeof collection=="object") &&(collection.constructor==FeatureObject)){
collection=collection.Options.getValue();}
for(var enumObjects=new Enumerator(collection);
!enumObjects.atEnd();
enumObjects.moveNext()){
var collObject=enumObjects.item();
if(this.IsItemListed(collObject)){
var uiItemObj=this.AddItem(uiObj,collObject);
if(uiItemObj){
	this.InitItem(uiItemObj,collObject);
	this.AddProxyToItem(uiItemObj,collObject);
	}
	}
	}}
function ListBoxProxy_ValidateFeatVal(featVal,collection){
var key=this.GetKeyFromFeatValue(featVal);
var collObj=this.GetMatchingOptionObj(key,collection);
if((collObj!=null)&&(this.IsItemListed(collObj)==false)){
collObj=null;}
return(collObj!=null);}
function ListBoxProxy_IsItemListed(collObj){
return true;}
function ListBoxProxy_InitItem(uiItem,collObj){}
function ListBoxProxy_AddItem(uiObj,collObj){
var key=this.GetKeyFromOptObj(collObj);
var text=this.GetTextFromOptObj(collObj);
var icon=this.GetIconFromOptObj(collObj);
var uiItemObj;
if(uiObj){
uiItemObj=uiObj.addItem(key,text,icon);}
if(this.listeners!==undefined){
for(var i=0; i<this.listeners.length; i++){
var listener=this.listeners[i].obj;
if(listener.AddListItem){
listener.AddListItem(key,text,icon);}}}
return uiItemObj;}
function ListBoxProxy_AddProxyToItem(uiObj,collObj){
var itmProxy=this.CreateItemProxy(uiObj);
if(itmProxy){
var txtObj=this.GetTextObjFromOptObj(collObj);
itmProxy.Init(txtObj);}}
function ListBoxProxy_CreateItemProxy(uiObj){
var proxy;
if(this.ItemProxyConstructor){
proxy=new this.ItemProxyConstructor(uiObj);
proxy.textId=this.textId;}
return proxy;}
function ListBoxProxy_ResetList(uiObj){
if(uiObj){
uiObj.deleteAllItems();}
if(this.listeners!==undefined){
for(var i=0; i<this.listeners.length; i++){
var listener=this.listeners[i].obj;
if(listener.ResetList){
listener.ResetList();}}}}
function xxxListBoxProxy_ReloadOptions(uiObj,collection){
this.ResetList(uiObj);
this.PopulateList(uiObj,collection);}
function ListBoxProxy_GetUiVal(uiObj){
return uiObj.getSelectedItem();}
function ListBoxProxy_SetUiVal(uiObj,key){
uiObj.setSelectedItem(key);}
function ListBoxProxy_GetTextFromOptObj(collObj){
var text;
var txtObj=this.GetTextObjFromOptObj(collObj);
if(this.textId!=null){
if(this.textId!=""){
text=txtObj[this.textId].getValue();
}else{
text=txtObj.getValue();}
}else{
text=txtObj;}
return text;}
function ListBoxProxy_GetIconFromOptObj(collObj){
var icon=null;
var iconObj=this.GetIconObjFromOptObj(collObj);
if(iconObj){
if(this.iconId!=null){
if(this.iconId!=""){
if(iconObj[this.iconId]){
icon=iconObj[this.iconId].getValue();}
}else{
icon=iconObj.getValue();}
}else{
icon=iconObj;}}
return icon;}
function ListBoxProxy_GetTextObjFromOptObj(collObj){
return this.GetSubObjFromPath(collObj,this.textPath);}
function ListBoxProxy_GetIconObjFromOptObj(collObj){
return this.GetSubObjFromPath(collObj,this.iconPath);}
function proto_OptionButtonProxy(){
this.GetUiVal=OptionButtonProxy_GetUiVal;
this.SetUiVal=OptionButtonProxy_SetUiVal;
this.PopulateList=OptionButtonProxy_PopulateList;
this.SetUiEnable=OptionButtonProxy_SetUiEnable;
this.GetUiValFromKey=OptionButtonProxy_GetUiValFromKey;
this.GetKeyFromUiVal=OptionButtonProxy_GetKeyFromUiVal;
this.GetOnVal=OptionButtonProxy_GetOnVal;
this.GetOffVal=OptionButtonProxy_GetOffVal;
this.GetDefaultUiVal=OptionButtonProxy_GetDefaultUiVal;
this.Convert=OptionButtonProxy_Convert;
this.onKey="on";}
proto_OptionButtonProxy.prototype=OptionListProxy.prototype;
function OptionButtonProxy(uiObj,uiObjId){
this._BaseClassConstructor_=arguments.callee.base.constructor;
this._BaseClassConstructor_(uiObj,uiObjId);
delete this._BaseClassConstructor_;
if(uiObj!==undefined){
this.HookEvent(this.GetUiObjId(),"onClick",this.OnUiValChange);}}
OptionButtonProxy.base=proto_OptionButtonProxy.prototype;
OptionButtonProxy.prototype=new proto_OptionButtonProxy();
OptionButtonProxy.prototype.constructor=OptionButtonProxy;
function OptionButtonProxy_PopulateList(uiObj,collection){
var onOpt=true;
var offOpt=true;
var key=this.GetOnVal();
if(key!==undefined){
var optObj=this.GetMatchingOptionObj(key,collection);
if(optObj==null){
onOpt=false;}}
key=this.GetOffVal();
if(key!==undefined){
var optObj=this.GetMatchingOptionObj(key,collection);
if(optObj==null){
offOpt=false;}}
if(this.SetUiEnable){
this.SetUiEnable(uiObj,onOpt && offOpt);}}
function OptionButtonProxy_SetUiEnable(uiObj,ena){
uiObj.isEnabled=ena;}
function OptionButtonProxy_GetUiVal(uiObj){
return uiObj.isChecked;}
function OptionButtonProxy_SetUiVal(uiObj,uiVal){
if(uiVal!==undefined){
uiObj.isChecked=uiVal;}}
function OptionButtonProxy_GetOnVal(){
return this.onKey;}
function OptionButtonProxy_GetOffVal(){
return this.offKey;}
function OptionButtonProxy_GetDefaultUiVal(){
return this.defUiVal;}
function OptionButtonProxy_GetUiValFromKey(key){
return this.Convert("f2c",key);}
function OptionButtonProxy_GetKeyFromUiVal(uiVal){
return this.Convert("c2f",uiVal);}
function OptionButtonProxy_Convert(direction,inVal){
var outVal;
if(direction=="c2f"){
if(this.invert){
inVal=!inVal;}
if(inVal){
outVal=this.GetOnVal();
}else{
outVal=this.GetOffVal();}
}else{
var outVal;
if(inVal==this.GetOnVal()){
outVal=true;
}else
if(inVal==this.GetOffVal()){
outVal=false;}
if(outVal===undefined){
outVal=this.GetDefaultUiVal();}
if((outVal!==undefined)
&& this.invert){
outVal=!outVal;}}
return outVal;}
function proto_FeatureGrpProxy(){
this.Init=FeatureGrpProxy_Init;
this.atchFeat=FeatureGrpProxy_AtchFeat;
this.getValue=FeatureGrpProxy_GetVal;
this.onFeatChange=FeatureGrpProxy_OnFeatChange;
this.setCtrl=FeatureGrpProxy_SetCtrl;}
proto_FeatureGrpProxy.prototype=ObjectProxy.prototype;
function FeatureGrpProxy(ctrl,features){
this._BaseClassConstructor_=arguments.callee.base.constructor;
this._BaseClassConstructor_();
delete this._BaseClassConstructor_;
this._hdlrs=new Object();
this._feats=new Array();
this.Attach(ctrl,"ctrlObj");
for(var i=0; i<features.length;++i){
this.atchFeat(features[i].id,features[i].path);}}
FeatureGrpProxy.base=proto_FeatureGrpProxy.prototype;
FeatureGrpProxy.prototype=new proto_FeatureGrpProxy();
FeatureGrpProxy.prototype.constructor=FeatureGrpProxy;
function FeatureGrpProxy_AtchFeat(fId,fPath){
var f=eval(fPath);
if(f){
this.Attach(f,fId);
this.HookEvent(fId,"onChange",this.onFeatChange);
var index=this._feats.length;
this._feats[index]=fId;}}
function FeatureGrpProxy_GetVal(){
var grpVal=new Object();
for(var i=0; i<this._feats.length;++i){
var fId=this._feats[i];
var value=this.HostObj(fId).getValue();
grpVal[fId]=value;}
return grpVal;}
function FeatureGrpProxy_Init(){
this.setCtrl();}
function FeatureGrpProxy_OnFeatChange(){
this.setCtrl();}
function FeatureGrpProxy_SetCtrl(){
var ctrl=this.HostObj("ctrlObj");
if(ctrl && this.ChangeHandler){
var grpVal=this.getValue()
this.ChangeHandler(ctrl, this, grpVal);}}
function proto_ClickProxy(){
this.Init=ClickProxy_Init;
this.AttachFeature=ClickProxy_AttachFeature;
this.OnClick=ClickProxy_OnClick;
this.ClickValue=true;}
proto_ClickProxy.prototype=ObjectProxy.prototype;
function ClickProxy(ctrl){
this._BaseClassConstructor_=arguments.callee.base.constructor;
this._BaseClassConstructor_();
delete this._BaseClassConstructor_;
this.Attach(ctrl,"ctrl");
this.HookEvent("ctrl","onClick",this.OnClick);}
ClickProxy.base=proto_ClickProxy.prototype;
ClickProxy.prototype=new proto_ClickProxy();
ClickProxy.prototype.constructor=ClickProxy;
function ClickProxy_AttachFeature(fPath){
var feature=eval(fPath);
if(feature){
this.Attach(feature,"feat");}}
function ClickProxy_Init(){}
function ClickProxy_OnClick(src,context,name){
var trans=new Transaction(src);
this.HostObj("feat").setValue(this.ClickValue);
trans.evaluate();
trans.commit();}
function proto_ButtonContProxy(){
this.GetUiVal=ButtonContProxy_GetUiVal;
this.SetUiVal=ButtonContProxy_SetUiVal;
this.Convert=ButtonContProxy_Convert;
this.Compare=ButtonContProxy_Compare;
this.GetOnVal=ButtonProxy_GetOnVal;
this.GetOffVal=ButtonProxy_GetOffVal;
this.fOn=true;
this.fOff=false;}
proto_ButtonContProxy.prototype=ContainerProxy.prototype;
function ButtonContProxy(uiObj){
this._BaseClassConstructor_=arguments.callee.base.constructor;
this._BaseClassConstructor_(uiObj);
delete this._BaseClassConstructor_;
this.HookEvent(this.GetUiObjId(),"onClick",this.OnUiValChange);}
ButtonContProxy.base=proto_ButtonContProxy.prototype;
ButtonContProxy.prototype=new proto_ButtonContProxy();
ButtonContProxy.prototype.constructor=ButtonContProxy;
function ButtonContProxy_GetUiVal(uiObj){
return uiObj.isChecked;}
function ButtonContProxy_SetUiVal(uiObj,uiVal){
if(uiVal!==undefined){
uiObj.isChecked=uiVal;}}
function ButtonContProxy_Convert(direction,inVal){
var outVal;
if(direction=="c2f"){
if(inVal){
outVal=this.GetOnVal();
}else{
outVal=this.GetOffVal();}
}else{
var outVal;
var mapVal=this.GetOnVal();
if((mapVal!==undefined)&&(this.Compare(inVal,mapVal))){
outVal=true;
}else{
var mapVal=this.GetOffVal();
if((mapVal!==undefined)&&(this.Compare(inVal,mapVal))){
outVal=false;}}}
return outVal;}
function ButtonContProxy_Compare(valObj,mapObj){
var match=true;
for(var comp in mapObj){
if((valObj[comp]===undefined)||
(valObj[comp]!=mapObj[comp])){
match=false;
break;}}
return match;}
function proto_ScrollContProxy(){
this.SetUiVal=ScrollContProxy_SetUiVal;
this.GetUiVal=ScrollContProxy_GetUiVal;
this.Convert=ScrollContProxy_Convert;}
proto_ScrollContProxy.prototype=ContainerProxy.prototype;
function ScrollContProxy(uiObj){
this._BaseClassConstructor_=arguments.callee.base.constructor;
this._BaseClassConstructor_(uiObj);
delete this._BaseClassConstructor_;
this.HookEvent(this.GetUiObjId(),"onChange",this.OnUiValChange);}
ScrollContProxy.base=proto_ScrollContProxy.prototype;
ScrollContProxy.prototype=new proto_ScrollContProxy();
ScrollContProxy.prototype.constructor=ScrollContProxy;
function ScrollContProxy_SetUiVal(uiObj,uiVal){
if(uiVal!==undefined){
uiObj.setPos(uiVal);}}
function ScrollContProxy_GetUiVal(uiObj){
return uiObj.getPos();}
function ScrollContProxy_Convert(direction,inVal){
var outVal;
if(direction=="c2f"){
if(inVal!==undefined){
var size=this.GetComponent("size").GetCompValue();
outVal={val : size*inVal/100};}
}else{
if(inVal!==undefined){
outVal=inVal.val*100/inVal.size;}}
return outVal;}
function proto_EditBoxContProxy(){
this.Init=EditBoxContProxy_Init;
this.OnUiValChange=EditBoxContProxy_OnUiValChange;
this.OnValidate=EditBoxContProxy_OnValidate;
this.ValidateUiValue=EditBoxContProxy_ValidateUiValue;
this.FixUpUiValue=EditBoxContProxy_Std$FixUpUiValue;
this.HandleInvalidValue=EditBoxContProxy_Std$HandleInvalidValue;
this.GetUiVal=EditBoxContProxy_GetUiVal;
this.SetUiVal=EditBoxContProxy_SetUiVal;
this.CompareUiVal=EditBoxContProxy_CompareUiVal;
this.Convert=EditBoxContProxy_Convert;
this.Std$HandleInvalidValue=EditBoxContProxy_Std$HandleInvalidValue;
this.Numeric$HandleInvalidValue=EditBoxContProxy_Numeric$HandleInvalidValue;
this.Std$FixUpUiValue=EditBoxContProxy_Std$FixUpUiValue;
this.NumericSet$FixUpUiValue=EditBoxContProxy_NumericSet$FixUpUiValue;
this.OnUiValChangeEvtName="onChange";}
proto_EditBoxContProxy.prototype=ContainerProxy.prototype;
function EditBoxContProxy(uiObj){
this._BaseClassConstructor_=arguments.callee.base.constructor;
this._BaseClassConstructor_(uiObj);
delete this._BaseClassConstructor_;
this.blockRedun=0;}
EditBoxContProxy.base=proto_EditBoxContProxy.prototype;
EditBoxContProxy.prototype=new proto_EditBoxContProxy();
EditBoxContProxy.prototype.constructor=EditBoxContProxy;
function EditBoxContProxy_Init(){
this._Init_=this.constructor.base.Init;
this._Init_();
delete this._Init_
this.HookEvent(this.GetUiObjId(),this.OnUiValChangeEvtName,this.OnUiValChange);
HookValidationEvents(this,this.GetUiObjId(),this.OnValidate,"ui");}
function HookValidationEvents(proxy,uiObjId,func,type){
var uiObj=proxy.HostObj(uiObjId);
var container=uiObj;
while(container){
if((container.type=="Panel") ||(container.type=="Frame")){
var vp=GetValidationProxy(container);
var validator=new Validator(proxy,vp,func,type);}
container=container.parent;}}
function GetValidationProxy(uiObj){
var vp=uiObj.ValidationProxy;
if(vp===undefined){
if(uiObj.type=="Panel"){
vp=new PanelValidationProxy(uiObj);}
else if(uiObj.type=="Frame"){
vp=new FrameValidationProxy(uiObj);}
vp.Init();
uiObj.ValidationProxy=vp;}
return vp;}
function EditBoxContProxy_OnUiValChange(src,context,name){
this.blockRedun+=1;
if((this.ValidateUiValue(src,context,name))||
(this.FixUpUiValue(src,context,name))){
this._OnUiValChange_=EditBoxContProxy.base.OnUiValChange;
this._OnUiValChange_(src,context,name);
delete this._OnUiValChange_;}
this.blockRedun -=1;}
function EditBoxContProxy_OnValidate(src){
var rc=1;
var uiObj=this.HostObj(this.GetUiObjId());
if(!this.ValidateUiValue(uiObj,undefined,name)){
if(this.HandleInvalidValue(uiObj,undefined,name)){
rc=-1;}}
return rc;}
function EditBoxContProxy_ValidateUiValue(uiObj,context,name){
var valid=true;
if((context)&&(context.data!==undefined)){
valid=(context.data==0);}
if(valid &&(uiObj.valueError!==undefined)){
valid=(uiObj.valueError==0);}
if(valid && this.validateRE){
valid=this.validateRE.test(this.GetUiVal(uiObj));}
return valid;}
function EditBoxContProxy_Std$HandleInvalidValue(uiObj,context,name){
return false;}
function EditBoxContProxy_Numeric$HandleInvalidValue(uiObj,context,name){
if(this.invalidMsgBox){
var mb=getMessageBox(this.invalidMsgBox);
mb.addParm(getPrinterInfo(2));
var label=uiObj.label;
if(label===undefined){
label="";}
mb.addParm(label);
mb.show(GetContainingFrame(uiObj));}
uiObj.isFocus=true;
return true;}
function EditBoxContProxy_Std$FixUpUiValue(uiObj,context,name){
return false;}
function EditBoxContProxy_NumericSet$FixUpUiValue(uiObj,context,name){
var val;
if(context.data==2){
val=this.GetUiVal(uiObj);
}else{
val=this.GetDefaultUiVal();}
uiObj.setNextValidItem(val);
return false;}
function EditBoxContProxy_SetUiVal(uiObj,uiVal){
var inhibit=false;
if(this.blockRedun){
var crntUiVal=this.GetUiVal(uiObj);
if(this.CompareUiVal(uiObj,uiVal,crntUiVal)){
inhibit=true;}}
if(!inhibit){
uiObj.setEditItem(uiVal);}}
function EditBoxContProxy_CompareUiVal(uiObj,newVal,crntVal){
return(newVal==crntVal);}
function EditBoxContProxy_GetUiVal(uiObj){
return uiObj.getEditItem(this.isNumeric);}
function EditBoxContProxy_Convert(direction,inVal){
var outVal;
if(direction=="c2f"){
outVal={val : inVal};
}else{
if(inVal!==undefined){
outVal=inVal.val;}}
return outVal;}
function proto_ConstraintButtonContProxy(){
this.OnUiValChange=ConstraintButtonContProxy_OnUiValChange;
this.SetUiVal=ConstraintButtonContProxy_SetUiVal;
this.IsConstrained=ConstraintButtonContProxy_IsConstrained;
this.GetContextId=ConstraintButtonContProxy_GetContextId;}
proto_ConstraintButtonContProxy.prototype=ContainerProxy.prototype;
function ConstraintButtonContProxy(uiObj){
this._BaseClassConstructor_=arguments.callee.base.constructor;
this._BaseClassConstructor_(uiObj);
delete this._BaseClassConstructor_;
this.HookEvent(this.GetUiObjId(),"onClick",this.OnUiValChange);}
ConstraintButtonContProxy.base=proto_ConstraintButtonContProxy.prototype;
ConstraintButtonContProxy.prototype=new proto_ConstraintButtonContProxy();
ConstraintButtonContProxy.prototype.constructor=ConstraintButtonContProxy;
function ConstraintButtonContProxy_OnUiValChange(src,context,name){
var contextId;
var vals=this.GetComponentValues();
for(var cons in vals){
if(this.IsConstrained(cons,vals[cons])){
contextId=this.GetContextId(cons,vals[cons]);
if(contextId!==undefined){
break;}}}
if(contextId!==undefined){
context.result=contextId;}}
function ConstraintButtonContProxy_SetUiVal(uiObj,uiVal){
var isConstrained=false;
for(var cons in uiVal){
if(this.IsConstrained(cons,uiVal[cons])){
isConstrained=true;
break;}}
uiObj.isVisible=isConstrained;}
function ConstraintButtonContProxy_IsConstrained(compId,compVal){
return((compVal)? true : false);}
function ConstraintButtonContProxy_GetContextId(compId,compVal){
var contextId;
if(compVal){
var itm=compVal.item(1);
if(itm){
var itmCid=itm.contextId;
if(itmCid){
contextId=itmCid.getValue();}}}
return contextId;}
function proto_ConstraintFeatureProxy(){
this.fKeyId=null;
this.GetFeatValue=ConstraintFeatureProxy_GetFeatValue;}
proto_ConstraintFeatureProxy.prototype=VariablePathProxy.prototype;
function ConstraintFeatureProxy(uiObj,uiObjId){
this._BaseClassConstructor_=arguments.callee.base.constructor;
this._BaseClassConstructor_(uiObj,uiObjId);
delete this._BaseClassConstructor_;}
ConstraintFeatureProxy.base=proto_ConstraintFeatureProxy.prototype;
ConstraintFeatureProxy.prototype=new proto_ConstraintFeatureProxy();
ConstraintFeatureProxy.prototype.constructor=ConstraintFeatureProxy;
function ConstraintFeatureProxy_GetFeatValue(fObj){
var fVal=null;
if(fObj.getValue()){
fVal=new Enumerator(fObj);}
return fVal;}
function proto_Validator(){
this.Validate=Validator_Validate;
this.ObitNotice=Validator_ObitNotice;}
proto_Validator.prototype=null;
function Validator(ctrlObj,signalObj,fnValidate,type){
this.ctrlObj=ctrlObj;
ctrlObj.AddObitRequest(this,null);
this.signalObj=signalObj;
signalObj.AddObitRequest(this,null);
this.fnValidate=fnValidate;
signalObj.AddValidator(this,type);}
Validator.base=proto_Validator.prototype;
Validator.prototype=new proto_Validator();
Validator.prototype.constructor=Validator;
function Validator_Validate(src){
this.ctrlObj._Validator_=this.fnValidate;
var rc=this.ctrlObj._Validator_(src);
delete this.ctrlObj._Validator_;
return rc;}
function Validator_ObitNotice(sender,cbData){
if(sender==this.signalObj){
this.signalObj=undefined;}
if(sender==this.ctrlObj){
this.ctrlObj=undefined;
if(this.signalObj){
this.signalObj.RemoveValidator(this);
this.signalObj.RemoveObitRequest(this);
this.signalObj=undefined;}}}
function proto_ValidationProxy(){
this.Init=ValidationProxy_Init;
this.AddValidator=ValidationProxy_AddValidator;
this.RemoveValidator=ValidationProxy_RemoveValidator;
this.OnValidate=ValidationProxy_OnValidate;
this.InvokeValidators=ValidationProxy_InvokeValidators}
proto_ValidationProxy.prototype=ObjectProxy.prototype;
function ValidationProxy(uiObj){
this._BaseClassConstructor_=arguments.callee.base.constructor;
this._BaseClassConstructor_();
delete this._BaseClassConstructor_;
this.Attach(uiObj,"uiObj");}
ValidationProxy.base=proto_ValidationProxy.prototype;
ValidationProxy.prototype=new proto_ValidationProxy();
ValidationProxy.prototype.constructor=ValidationProxy;
function ValidationProxy_Init(){}
function ValidationProxy_AddValidator(validator,type){
if(this.validators===undefined){
this.validators=new Array();}
if(this.validators.length==0){
this.HookEvent("uiObj",this.eventName,this.OnValidate);}
this.validators[this.validators.length]={obj : validator, type : type};}
function ValidationProxy_RemoveValidator(validator){
if(this.validators){
for(var i=0; i<this.validators.length; i++){
if(this.validators[i].obj==validator){
this.validators=this.validators.slice(0,i).concat(this.validators.slice(i+1));
break;}}
if(this.validators.length==0){
this.UnhookEvent("uiObj",this.eventName,this.OnValidate);
delete this.validators;}}}
function ValidationProxy_OnValidate(src,context,evtName){
if((context.result===undefined)||(context.result==0)){
if(this.validators){
var rc=this.InvokeValidators("ui",src);
if(rc>0){
rc=this.InvokeValidators("feat",src);}
if(rc==-1){
context.result=1;}}}}
function ValidationProxy_InvokeValidators(type,src){
var rc=1;
for(var i=0; i<this.validators.length; i++){
if(this.validators[i].type==type){
rc=this.validators[i].obj.Validate(src);
if(rc==-1){
break;}}}
return rc;}
function proto_PanelValidationProxy(){
this.eventName="onKillActive";}
proto_PanelValidationProxy.prototype=ValidationProxy.prototype;
function PanelValidationProxy(uiObj){
this._BaseClassConstructor_=arguments.callee.base.constructor;
this._BaseClassConstructor_(uiObj);
delete this._BaseClassConstructor_;}
PanelValidationProxy.base=proto_PanelValidationProxy.prototype;
PanelValidationProxy.prototype=new proto_PanelValidationProxy();
PanelValidationProxy.prototype.constructor=PanelValidationProxy;
function proto_FrameValidationProxy(){
this.eventName="onQueryTerminate";
this.OnValidate=FrameValidationProxy_OnValidate;}
proto_FrameValidationProxy.prototype=ValidationProxy.prototype;
function FrameValidationProxy(uiObj){
this._BaseClassConstructor_=arguments.callee.base.constructor;
this._BaseClassConstructor_(uiObj);
delete this._BaseClassConstructor_;}
FrameValidationProxy.base=proto_FrameValidationProxy.prototype;
FrameValidationProxy.prototype=new proto_FrameValidationProxy();
FrameValidationProxy.prototype.constructor=FrameValidationProxy;
function FrameValidationProxy_OnValidate(src,context,evtName){
if(context.data==1){
this._OnValidate_=FrameValidationProxy.base.OnValidate;
this._OnValidate_(src,context,evtName);
delete this._OnValidate_;}}
@END
@DocProps PrintProps
function main(){
AddEventHandler("onLoadFrame",OnLoadFrame);
frames(1).AddEventHandler("onTerminate", TerminateNotification);
ResolveFeatureConflicts();
InitPhantomFeatures();
for(var enumFrames=new Enumerator(frames);
!enumFrames.atEnd();
enumFrames.moveNext()){
var frame=enumFrames.item();
RegisterOnLoadPanel(frame);
OnLoadPanel.deferredPanels=new Array();
var pn=0;
for(var enumPanes=new Enumerator(frame.panes);
!enumPanes.atEnd();
enumPanes.moveNext()){
var pane=enumPanes.item();
if(pn>0){
for(var enumPanels=new Enumerator(pane.panels);
!enumPanels.atEnd();
enumPanels.moveNext()){
var panel=enumPanels.item();
var deferredPanel=new Object();
deferredPanel.panelName=panel.name;
deferredPanel.paneName=pane.name;
deferredPanel.frameName=frame.name;
OnLoadPanel.deferredPanels[OnLoadPanel.deferredPanels.length]=deferredPanel;}}
++pn;}}
OnLoadPanel.initMenus=true;
OnLoadPanel.initApply=true;}
function TerminateNotification(src,context,name){
if(context.data==1){
Printer1.DeviceContext.Apply.setValue(true);}else{
Printer1.DeviceContext.Apply.setValue(false);}}
function OnLoadFrame(src,context,name){
var frame=context.handle;
frame.trans=new Transaction();
frame.AddEventHandler("onTerminate",OnTerminateFrame);
InitItems("Menu", frame.menus);
for(var enumPanes=new Enumerator(frame.panes);
!enumPanes.atEnd();
enumPanes.moveNext()){
var pane=enumPanes.item();
for(var enumPanels=new Enumerator(pane.panels);
!enumPanels.atEnd();
enumPanels.moveNext()){
var panel=enumPanels.item();
InitItems("Control", panel.controls);}}
var func;
try{
eval("func = onLoad_" +context.label+";" );}
catch(exception){
func=null;
if((exception.name &&(exception.name!="TypeError" && exception.name!="SyntaxError")) ||
(!exception.name &&(exception.number!=-2146823281 && exception.number!=-2146827284 && exception.number!=-2146823279 && exception.number!=-2146827258))){
throw exception;}}
if(func){
func(context.handle,context.label);}}
function OnTerminateFrame(src,context,name){
if(src.trans){
var results=src.trans.evaluate();
var action;
if(context.data==1 || src.name=="dlgCustomPapers"){
src.trans.commit();
}else{
src.trans.rollback();}}}
function RegisterOnLoadPanel(frame){
var enumPanes;
var enumPanels;
var pane;
var panel;
for(enumPanes=new Enumerator(frame.panes);
!enumPanes.atEnd();
enumPanes.moveNext()){
pane=enumPanes.item();
for(enumPanels=new Enumerator(pane.panels);
!enumPanels.atEnd();
enumPanels.moveNext()){
panel=enumPanels.item();
panel.AddEventHandler("onLoad",OnLoadPanel);}}}
function OnLoadPanel(src, context, name){
if(OnLoadPanel.initMenus){
OnLoadPanel.initMenus=false;
InitItems("Menu", menus);}
for(var i=0; i<OnLoadPanel.deferredPanels.length; i++){
var deferredPanel=OnLoadPanel.deferredPanels[i];
var frame=frames(deferredPanel.frameName);
if(frame){
var pane=frame.panes(deferredPanel.paneName);
if(pane){
var panel=pane.panels(deferredPanel.panelName);
InitItems("Control",panel.controls);}}}
OnLoadPanel.deferredPanels.length=0;
if(OnLoadPanel.initApply){
var chgs=eval(PDS_Changes);
setApply(chgs.getValue());
var px=new ObjectProxy();
px.Attach(chgs,"chgs");
px.onUpdate=updtApply;
px.HookEvent("chgs","onChange",px.onUpdate);}
InitItems("Control", src.controls);}
function updtApply(src,context,name){
var val=src.getValue();
setApply(val);}
function InitItems(type,items){
var i;
var count=items.count;
var item;
for(i=1; i<=count; i++){
item=items(i);
Init(type,item.name,item);}}
function Init(type, name, item){
var label=name;
if(label.charAt(0)=="!"){
label=name.slice(1);}
var pos=label.indexOf("(");
if(pos>0){
label=label.slice(0,pos);}
var func;
try{
eval("func = Init"+type+"_"+ label+";");}
catch(exception){
func=null;
if((exception.name &&(exception.name!="TypeError" && exception.name!="SyntaxError" )) ||
(!exception.name &&(exception.number!=-2146823281 && exception.number!=-2146827284 && exception.number!=-2146823279 && exception.number!=-2146827258))){
throw exception;}}
if(func){
func(item, name);}}
function FixOptionListFeatureConflict(fPath){
var feat=eval(fPath);
var fVal=feat.getValue();
if((fVal.isConstrained)&&(fVal.isConstrained.getValue())){
if(feat.Default){
fVal=feat.Default.getValue();}
if((fVal.isConstrained)&&(fVal.isConstrained.getValue())){
for(var en=new Enumerator(feat);
(en!==undefined)&&(fVal.isConstrained)&&(fVal.isConstrained.getValue())&& !en.atEnd();
en.moveNext()){
fVal=en.item();}}
if((!fVal.isConstrained)||(!fVal.isConstrained.getValue())){
var trans=new Transaction();
feat.setValue(fVal);
trans.evaluate();
trans.commit();}}}
@END
@PrintProps
function ResolveFeatureConflicts(){}
@END
@DocProps
function ResolveFeatureConflicts(){}
@END
@DocProps PrintProps
function InitControl_bmCompany(ctrl,name){
ctrl.AddEventHandler("onClick",linkHome);}
function linkHome(src){
webLink("Home",src);}
function webLink(urlId,addr,src){
var id=eval(PDS_Spec+".WebPrinterId").getValue();
var ppm=eval(PDS_Spec+".PagesPerMinute").getValue();
var web=newObject();
var rc=web.gotoURL(urlId,"!loadWeb",id,ppm,addr);
if(rc=="NoBrowser"){
var msg=getMessageBox("mbNoBrowser");
msg.addParm(web.getFileName());
msg.show(GetContainingFrame(src));}
web.destroy();
return rc;}
@END
@DocProps
function InitMenu_mpWeb(menu,name){
if(eval(PDS_Permission).getValue()){
menu.isEnabled=true;}else{
menu.isEnabled=false;}}
function InitMenu_mpSettings(menu,name){
bldProfMenu(menu);
if(eval(PDS_Permission).getValue()){
var profs=eval(PDS_Profiles);
if(profs){
var px=new ObjectProxy();
px.menu=name;
px.Attach(menu,"menu");
px.Attach(profs,"profs");
px.onUpdate=newActivePro;
px.HookEvent("profs","onCollectionUpdate",px.onUpdate);
px.HookEvent("profs","onChange",px.onUpdate);}}else{
menu.isEnabled=false;}}
function bldProfMenu(menu){
var items=new Array();
var profs=eval(PDS_Profiles);
for(var en=new Enumerator(profs); !en.atEnd(); en.moveNext()){
var p=en.item();
var pType=p.ptype.getValue();
if((pType!="factory" ) &&
(pType!="installed" )){
items[items.length]=p;}}
if(items.length>0){
var ms=menu.appendItem("mi$Psep" );
var si=items.sort(itemSorter);
var numItems=Math.min(si.length,6);
for(var i=0; i<numItems;++i){
var proName=si[i].resId.getValue();
var item=menu.appendItem("mi$P"+proName, proName);
var itmPxy=new ObjectProxy();
itmPxy.Attach(item,"uiObj");
itmPxy.HookEvent("uiObj","onClick",profileClick);
itmPxy.Attach(si[i],"prof");}}}
function itemSorter(item1,item2){
return(item2.lastUsed.getValue()- item1.lastUsed.getValue());}
function newActivePro(src,context,name){
var menu=menus(this.menu);
for(var en=new Enumerator(menu.parent.menus); !en.atEnd(); en.moveNext()){
var item=en.item();
if(item.name.substr(0,4)=="mi$P"){
item.deleteItem();}}
bldProfMenu(menu);}
function profileClick(src,context,name){
setActiveProfile(this.HostObj("prof"),src);}
function InitMenu_miSaveSettings(item,name){
item.AddEventHandler("onClick",ShoSaveSet);}
function ShoSaveSet(evt){
showFrame("dlgSaveSettings");}
function init_miLoadProf(item,name,pType){
var ena=false;
var profs=eval(PDS_Profiles);
for(var en=new Enumerator(profs); !en.atEnd(); en.moveNext()){
var p=en.item();
if(pType==p.ptype.getValue()){
var px=new ObjectProxy();
px.onClick=profileClick;
px.Attach(item,"uiObj");
px.HookEvent("uiObj","onClick",px.onClick);
px.Attach(p,"prof");
ena=true;
break;}}
item.isEnabled=ena;
item.isVisible=ena;}
function InitMenu_miLoadFactory(item,name){
init_miLoadProf(item,name,"factory");}
function InitMenu_miLoadInstalled(item,name){
init_miLoadProf(item,name,"installed")}
function InitMenu_miLoadCustom(item,name){
item.AddEventHandler("onClick",ShoLoadCustom);}
function ShoLoadCustom(evt){
showFrame("dlgLoadDelCustomSettings");}
@END
@DocProps PrintProps
function InitMenu_miUrls(item,name){
if(eval(PDS_Admin).getValue())
item.AddEventHandler("onClick",ShoConfigUrls);else
item.isEnabled=false;}
function ShoConfigUrls(src,context,evt){
showFrame("dlgConfigURL");}
function InitMenu_miAbout(item,name){
item.AddEventHandler("onClick",ShoAbout);}
function ShoAbout(evt){
showFrame("dlgAbout");}
function GrayIfNoWeb(item){
var webObject=newObject();
item.isEnabled=webObject.isEcommSupported();
if(eval(webObject.isEcommSupported())){
item.AddEventHandler("onClick",ShowWebPages);}
webObject.destroy();}
function InitMenu_miPrinter(){
menus("miPrinter").AddEventHandler("onClick",ShowWebPages);}
function InitMenu_miDrivers(){
GrayIfNoWeb(menus("miDrivers"));}
function InitMenu_miSupplies(){
GrayIfNoWeb(menus("miSupplies"));}
function InitMenu_miPubs(){
GrayIfNoWeb(menus("miPubs"));}
function InitMenu_miTech(){
GrayIfNoWeb(menus("miTech"));}
function InitMenu_miHome(){
GrayIfNoWeb(menus("miHome"));}
function ShowWebPages(evt){
var id="";
var addr="";
if(evt.name=="miPrinter"){
id="Printer";
addr=eval(PDS_WebIP).getValue();}
if(evt.name=="miDrivers"){
id="Drivers";}
if(evt.name=="miSupplies"){
id="Supplies";}
if(evt.name=="miPubs"){
id="Pubs";}
if(evt.name=="miTech"){
id="Tech";}
if(evt.name=="miHome"){
id="Home";}
var rc=webLink(id,addr,evt);
if(rc=="NoIPAddress"){
if(eval(PDS_Admin).getValue()){
showFrame("dlgNoPrtIP");}else{
var mb=getMessageBox("mbPrtrCommErr");
mb.addParm(getPrinterInfo(2));
mb.show(GetContainingFrame(evt));}}}
function InitMenu_miIndex(){
menus("miIndex").AddEventHandler("onClick",showHelpIndex);}
function showHelpIndex(evt){
showHelp(evt,"Index",0);}
function InitMenu_miSearch(){
menus("miSearch").AddEventHandler("onClick",showHelpSearch);}
function showHelpSearch(evt){
showHelp(evt,"Search",0);}
@END
@DocProps
function onLoad_dlgSaveSettings(frame){
frame.AddEventHandler("onQueryTerminate",exitSaveSet);}
function exitSaveSet(frame,context,name){
if((context.data==1)
&&((context.result===undefined)||(context.result==0))){
var f=eval(PDS_Profiles);
var rawName=eval(PDS_ProfSaveName).getValue();
var name=deblank(rawName);
var tstName=name.toLowerCase();
for(var en=new Enumerator(f); !en.atEnd(); en.moveNext()){
var curName=en.item().resId.getValue();
if(tstName==curName.toLowerCase()){
var proc=eval(PDS_DelProfile);
var trans=new Transaction(frame);
proc.Profile.setValue(en.item());
proc.execute();
trans.evaluate();
trans.commit();
name=curName;
break;}}
var proc=eval(PDS_SaveProfile);
var trans=new Transaction(frame);
proc.Description.setValue(name);
proc.execute();
trans.evaluate();
trans.commit();}}
function InitControl_ebSettingsName(ctrl,name){
var trans=new Transaction(ctrl);
eval(PDS_ProfSaveName+".setValue(\"\")");
trans.evaluate();
trans.commit();
ctrl.setTextLimit(eval(PDS_Profiles).MaxNameLen.getValue());
var px=new EditBoxContProxy(ctrl);
var f=eval(PDS_Profiles);
if(f.NameRE){
px.validateRE=new RegExp(f.NameRE.getValue());
px.HandleInvalidValue=px.Numeric$HandleInvalidValue;
px.invalidMsgBox="mbInvalidEditVal";
ctrl.label=getUiLabel("!sSettingsName");}
var ap=px.AttachFeature(PDS_ProfSaveName);
ap.fKeyId=null;
px.Init();
ctrl.setEditItem("");
HookValidationEvents(px,px.GetUiObjId(),ebSettingsName_FeatValidate,"feat");}
function ebSettingsName_FeatValidate(src){
var rc=1;{
var f=eval(PDS_Profiles);
var rawName=eval(PDS_ProfSaveName).getValue();
var name=deblank(rawName);
if(name.length<f.MinNameLen.getValue()){
rc=-1;
var frame=GetContainingFrame(src);
var mb=getMessageBox("mbBadProfName");
mb.addParm(getPrinterInfo(2));
mb.show(frame);}else{
var err=0;
var tstName=name.toLowerCase();
for(var en=new Enumerator(f); !en.atEnd(); en.moveNext()){
var curName=en.item().resId.getValue();
if(tstName==curName.toLowerCase()){
var type=en.item().ptype.getValue();;
var isAdmin=eval(PDS_Admin+".getValue()");
if(type=="user"
||(type=="admin" && isAdmin)){
err=1;}else{
err=2;}
name=curName;
break;}}
if(err==1){
var frame=GetContainingFrame(src);
var mb=getMessageBox("mbSameProfName");
mb.addParm(getPrinterInfo(2));
mb.addParm(curName);
if(mb.show(frame)!="Ok" ){
rc=-1;}}
else if(err==2){
var frame=GetContainingFrame(src);
var mb=getMessageBox("mbNameExists");
mb.addParm(getPrinterInfo(2));
mb.addParm(curName);
mb.show(frame);
rc=-1;}}}
if(rc==-1){
this.HostObj(this.GetUiObjId()).isFocus=true;}
return rc;}
function InitControl_pbSaveSettingsHelp(ctrl,name){
ctrl.AddEventHandler("onClick",SaveSettingsHelp);}
function SaveSettingsHelp(evt){
showHelp(evt,"Context",0);}
@END
@DocProps PrintProps
function InitControl_sAboutPrinterName(ctrl,name){
ctrl.setLabel(getPrinterInfo(4));}
function InitControl_sAboutVersion(ctrl,name){
ctrl.setLabel(eval(PDS_Spec+".Version").getValue());}
function InitControl_lvAboutFiles(ctrl,name){
ctrl.addPackageFiles();}
@END
@DocProps
function InitControl_ebCopies(ctrl,name){
var feat=eval(PDS_Copies);
var min=feat.Min.getValue();
var max=feat.Max.getValue();
ctrl.setValueTable(min+"."+max);
var px=new EditBoxContProxy(ctrl);
px.HandleInvalidValue=px.Numeric$HandleInvalidValue;
px.invalidMsgBox="mbInvalidEditVal";
ctrl.label=getUiLabel("!sCopies");
px.isNumeric=true;
var ap=px.AttachFeature(PDS_Copies);
ap.fKeyId=null;
px.Init();}
function InitControl_ilCopies(ctrl,name){
var px=new FeatureGrpProxy(ctrl,[{id:"copies",path:PDS_Copies}
,{id:"order",path:PDS_PrintOrder}
,{id:"collate",path:PDS_Collate}]);
px.ChangeHandler=selCopiesImg;
px.Init();}
function selCopiesImg(ctrl,grp,vals){
var img=0;
if(vals.copies>1){
img=vals.collate ? 4 : 2;}
if(vals.order)
++img;
ctrl.selectImage(img);}
function InitControl_chkCollate(ctrl,name){
var px=new ButtonProxy(ctrl);
px.AttachFeature(PDS_Collate);
px.Init();}
function InitControl_chkLastFirst(ctrl,name){
var px=new ButtonProxy(ctrl);
px.AttachFeature(PDS_PrintOrder);
px.Init();
px=new FeatureGrpProxy(ctrl,[{id:"pMult",path:PDS_PrinterMulti}
,{id:"FrontCover",path:PDS_chkMIFrontCover},{id:"FirstPage",path:PDS_chkMIFirstPage},{id:"LastPage",path:PDS_chkMILastPage},{id:"BackCover",path:PDS_chkMIBackCover}]);
px.ChangeHandler=enab_chkLastFirst;
px.Init();}
function enab_chkLastFirst(ctrl,grp,vals){
ctrl.isEnabled=!(vals.fax || vals.pMult || vals.FrontCover || vals.FirstPage || vals.LastPage || vals.BackCover);}
function InitControl_pbLastFirstXQ(ctrl,name){
if(hasPermission()){
var px=new ConstraintButtonContProxy(ctrl);
px.GetContextId=pbLastFirstXQ_GetContextId;
px.SetUiVal=pbLastFirstXQ_SetUiVal;
	 var ap=new VariablePathProxy();
ap.fKeyId=null;
ap.AttachFeature(PDS_chkMIFrontCover);
px.AttachComponent(ap,"FrontCover");
	 var ap=new VariablePathProxy();
ap.fKeyId=null;
ap.AttachFeature(PDS_chkMIFirstPage);
px.AttachComponent(ap,"FirstPage");
	 var ap=new VariablePathProxy();
ap.fKeyId=null;
ap.AttachFeature(PDS_chkMILastPage);
px.AttachComponent(ap,"LastPage");
	 var ap=new VariablePathProxy();
ap.fKeyId=null;
ap.AttachFeature(PDS_chkMIBackCover);
px.AttachComponent(ap,"BackCover");
px.Init();}}
function pbLastFirstXQ_SetUiVal(uiObj, uiVal){
	var FrontCover=this.GetComponent("FrontCover").GetCompValue();
	var FirstPage=this.GetComponent("FirstPage").GetCompValue();
	var LastPage=this.GetComponent("LastPage").GetCompValue();
	var BackCover=this.GetComponent("BackCover").GetCompValue();
	uiObj.isVisible=FrontCover || FirstPage || LastPage || BackCover;}
function pbLastFirstXQ_GetContextId(compId,compVal){
return 1109;	}
function InitControl_pbDuplexXQ(ctrl,name){
if(hasPermission()){
var px=new ConstraintButtonContProxy(ctrl);
px.IsConstrained=pbDuplexXQ_IsConstrained;
px.GetContextId=pbDuplexXQ_GetContextId;
	var f=eval(PDS_ModelLow);
var m=f.getValue();
if(m==false){
var ap=new VariablePathProxy();
ap.AttachFeature(PDS_InstallableOptions+".Duplexer");
px.AttachComponent(ap,"dOpt");
var ap=new ConstraintFeatureProxy();
ap.AttachFeature(PDS_Constraints+".Duplex.isConstrained");}else{
var ap=new ConstraintFeatureProxy();
ap.AttachFeature(PDS_Constraints+".Duplex.isConstrained");}
px.AttachComponent(ap,"cons");
var ap=new VariablePathProxy();
ap.fKeyId=null;
ap.AttachFeature(PDS_Poster);
px.AttachComponent(ap,"post");
var ap=new VariablePathProxy();
ap.fKeyId=null;
ap.AttachFeature(PDS_Booklet);
px.AttachComponent(ap,"book");
px.Init();}}
function pbDuplexXQ_IsConstrained(compId,compVal){
var f=eval(PDS_ModelLow);
var m=f.getValue();
var isCons=false;
if(m==false){
switch(compId){
case "dOpt":{
isCons=(compVal=="NotInstalled");
break;}
default:{
this._IsConstrained_=this.constructor.prototype.IsConstrained;
isCons=this._IsConstrained_(compId,compVal);
delete this._IsConstrained_;}}}else{
switch(compId){
default:{
this._IsConstrained_=this.constructor.prototype.IsConstrained;
isCons=this._IsConstrained_(compId,compVal);
delete this._IsConstrained_;}}}
return isCons;}
function pbDuplexXQ_GetContextId(compId,compVal){
var f=eval(PDS_ModelLow);
var m=f.getValue();
var id;
if(m==false){
switch(compId){
case "post": id=1100; break;
case "dOpt": id=1102; break;
case "book": id=1101; break;
default:{
this._GetContextId_=this.constructor.prototype.GetContextId;
id=this._GetContextId_(compId,compVal);
delete this._GetContextId_;}}}else{
switch(compId){
case "post": id=1100; break;
case "book": id=1101; break;
default:{
this._GetContextId_=this.constructor.prototype.GetContextId;
id=this._GetContextId_(compId,compVal);
delete this._GetContextId_;}}}
return id;}
function InitControl_pbNupXQ(ctrl,name){
if(hasPermission()){
var px=new ConstraintButtonContProxy(ctrl);
px.GetContextId=pbNupXQ_GetContextId;
var ap=new ConstraintFeatureProxy();
var ap=new VariablePathProxy();
ap.fKeyId=null;
ap.AttachFeature(PDS_Poster);
px.AttachComponent(ap,"post");
var ap=new VariablePathProxy();
ap.fKeyId=null;
ap.AttachFeature(PDS_Booklet);
px.AttachComponent(ap,"book");
var ap=new VariablePathProxy();
ap.fKeyId=null;
ap.AttachFeature(PDS_Constraints+".NoEnv.PaperSize");
px.AttachComponent(ap,"SzEnv_PaperSize");
var ap=new VariablePathProxy();
ap.fKeyId=null;
ap.AttachFeature(PDS_Constraints+".NoEnv.PaperType");
px.AttachComponent(ap,"SzEnv_PaperType");
	var ap=new VariablePathProxy();
ap.fKeyId=null;
ap.AttachFeature(PDS_Constraints+".NupSourceMedia");
px.AttachComponent(ap,"EnvSource");
px.Init();}}
function pbNupXQ_GetContextId(compId,compVal){
var id;
switch(compId){
case "post": id=1100; break;
case "book": id=1101; break;
case "SzEnv_PaperSize": id=1107; break;
case "SzEnv_PaperType": id=1108; break;
	 case "EnvSource": id=1107; break;
default:{
this._GetContextId_=this.constructor.prototype.GetContextId;
id=this._GetContextId_(compId,compVal);
delete this._GetContextId_;}}
return id;}
function InitControl_chkDuplex(ctrl,name){
var f=eval(PDS_ModelLow);
var m=f.getValue();
var px=new OptionButtonProxy(ctrl);
px.SetUiEnable=undefined;
px.onKey="Longedge";
px.offKey="Simplex";
px.defUiVal=true;
px.AttachFeature(PDS_Duplex);
px.Init();
if(m==false){
px=new FeatureGrpProxy(ctrl,[{id:"book",path:PDS_Booklet}
,{id:"post",path:PDS_Poster}				
,{id:"dOpt",path:PDS_InstallableOptions+".Duplexer"}
,{id:"cons",path:PDS_Constraints+".Duplex.isConstrained"}]);}else{
px=new FeatureGrpProxy(ctrl,[{id:"book",path:PDS_Booklet}
,{id:"post",path:PDS_Poster}				
,{id:"cons",path:PDS_Constraints+".Duplex.isConstrained"}]);}
px.ChangeHandler=enab_chkDuplex;
px.Init();}
function enab_chkDuplex(ctrl,src,vals){
var f=eval(PDS_ModelLow);
var m=f.getValue();
if(m==false){
ctrl.isEnabled=vals.dOpt.nameId.getValue()=="Installed" && !(vals.book
|| vals.post
|| vals.cons);}else{
ctrl.isEnabled=!(vals.book
|| vals.post
|| vals.cons);}}
function hookEnabDuplexOpts(ctrl){
var f=eval(PDS_ModelLow);
var m=f.getValue();
if(m==false){
var px=new FeatureGrpProxy(ctrl,[{id:"duplex",path:PDS_Duplex}
,{id:"book",path:PDS_Booklet}
,{id:"post",path:PDS_Poster}
,{id:"dOpt",path:PDS_InstallableOptions+".Duplexer"}
,{id:"cons",path:PDS_Constraints+".Duplex.isConstrained"}]);}else{
var px=new FeatureGrpProxy(ctrl,[{id:"duplex",path:PDS_Duplex}
,{id:"book",path:PDS_Booklet}
,{id:"post",path:PDS_Poster}
,{id:"cons",path:PDS_Constraints+".Duplex.isConstrained"}]);}
px.ChangeHandler=enabDuplexOpts;
px.Init();}
function hookEnabSimplexOpts(ctrl){
var f=eval(PDS_ModelLow);
var m=f.getValue();
if(m==false){
var px=new FeatureGrpProxy(ctrl,[{id:"duplex",path:PDS_Duplex}
,{id:"book",path:PDS_Booklet}
,{id:"post",path:PDS_Poster}
,{id:"dOpt",path:PDS_InstallableOptions+".Duplexer"}
]);}else{
var px=new FeatureGrpProxy(ctrl,[{id:"duplex",path:PDS_Duplex}
,{id:"book",path:PDS_Booklet}
,{id:"post",path:PDS_Poster}
]);}
px.ChangeHandler=enabSimplexOpts;
px.Init();}
function InitControl_ilUsePrt(ctrl,name){
var imgPx=new FeatureGrpProxy(ctrl,[{id:"orient",path:PDS_Orientation}]);
imgPx.ChangeHandler=selUsePrtImg;
imgPx.Init();
var px=new ClickProxy(ctrl);
px.AttachFeature(PDS_Duplex);
px.ClickValue=eval(PDS_Duplex+".Options.PrinterSetting");}
function selUsePrtImg(ctrl,src,value){
ctrl.selectImage(6);}
function InitControl_ilSimplx(ctrl,name){
var imgPx=new FeatureGrpProxy(ctrl,[{id:"orient",path:PDS_Orientation}]);
imgPx.ChangeHandler=selSimplxLongImg;
imgPx.Init();
var px=new ClickProxy(ctrl);
px.AttachFeature(PDS_Duplex);
px.ClickValue=eval(PDS_Duplex+".Options.Simplex");}
function selSimplxLongImg(ctrl,src,value){
ctrl.selectImage(value.orient.getValue()==1 ? 4 : 5);}
function InitControl_ilDplexLong(ctrl,name){
var imgPx=new FeatureGrpProxy(ctrl,[{id:"orient",path:PDS_Orientation}]);
imgPx.ChangeHandler=selDplxLongImg;
imgPx.Init();
var px=new ClickProxy(ctrl);
px.AttachFeature(PDS_Duplex);
px.ClickValue=eval(PDS_Duplex+".Options.Longedge");}
function selDplxLongImg(ctrl,src,value){
ctrl.selectImage(value.orient.getValue()==1 ? 0 : 2);}
function enabDuplexOpts(ctrl,src,vals){
var f=eval(PDS_ModelLow);
var m=f.getValue();
if(m==false){
ctrl.isEnabled=(!vals.book
&& !vals.post
&& vals.dOpt.nameId.getValue()=="Installed"
&& !vals.cons);}else{
ctrl.isEnabled=(!vals.book
&& !vals.post
&& !vals.cons);}}
function enabSimplexOpts(ctrl,src,vals){
var f=eval(PDS_ModelLow);
var m=f.getValue();
if(m==false){
ctrl.isEnabled=(!vals.book
&& !vals.post
&& vals.dOpt.nameId.getValue()=="Installed"
);}else{
ctrl.isEnabled=(!vals.book
&& !vals.post
);}}
function InitControl_ilDplexShort(ctrl,name){
var px=new FeatureGrpProxy(ctrl,[{id:"orient",path:PDS_Orientation}]);
px.ChangeHandler=selDplxShrtImg;
px.Init();
px=new ClickProxy(ctrl);
px.AttachFeature(PDS_Duplex);
px.ClickValue=eval(PDS_Duplex+".Options.Shortedge");}
function selDplxShrtImg(ctrl,src,value){
ctrl.selectImage(value.orient.getValue()==1 ? 1 : 3);}
function InitControl_rbLongEdge(ctrl,name){	
	var f=eval(PDS_ModelLow);
	var m=f.getValue();
	if(m==false)
	{
		var px=new OptionButtonProxy(ctrl);
		px.SetUiEnable=undefined;
		px.onKey="Longedge";
		px.AttachFeature(PDS_Duplex);
		px.Init();
		
		hookEnabDuplexOpts(ctrl);
	}
	else{
var px=new OptionButtonProxy(ctrl);
		px.SetUiEnable=undefined;
		px.onKey="Longedge";
		px.AttachFeature(PDS_Duplex);
		px.Init();
		
		hookEnabDuplexOpts(ctrl);
		}}
function InitControl_rbShortEdge(ctrl,name){	
	var f=eval(PDS_ModelLow);
	var m=f.getValue();
	if(m==false)
	{
		var px=new OptionButtonProxy(ctrl);
		px.SetUiEnable=undefined;
		px.onKey="Shortedge";
		px.AttachFeature(PDS_Duplex);
		px.Init();
		
		
		hookEnabDuplexOpts(ctrl);
	}else{
var px=new OptionButtonProxy(ctrl);
		px.SetUiEnable=undefined;
		px.onKey="Shortedge";
		px.AttachFeature(PDS_Duplex);
		px.Init();
		
		
		hookEnabDuplexOpts(ctrl);
		}}
function InitControl_rbUsePrt(ctrl,name){
var f=eval(PDS_ModelLow);
var m=f.getValue();
var mid=eval(PDS_ModelMiddle);
var midvalue=mid.getValue();
if((m==false)||(midvalue==true)){
	 var px=new OptionButtonProxy(ctrl);
	 px.SetUiEnable=undefined;
	 px.onKey="PrinterSetting";
	 px.AttachFeature(PDS_Duplex);
	 px.Init();	
	 hookEnabSimplexOpts(ctrl);}
else{
	 var px=new OptionButtonProxy(ctrl);
	 px.SetUiEnable=undefined;
	 px.onKey="PrinterSetting";
	 px.AttachFeature(PDS_Duplex);
	 px.Init();
	 hookEnabSimplexOpts(ctrl);}}
function InitControl_rbOneSided(ctrl,name){
	var f=eval(PDS_ModelLow);
	var m=f.getValue();	
	if(m==false)
	{
		var px=new OptionButtonProxy(ctrl);
		px.SetUiEnable=undefined;
		px.onKey="Simplex";
		px.AttachFeature(PDS_Duplex);
		px.Init();
		
		
		hookEnabSimplexOpts(ctrl);
	}
	else{
var px=new OptionButtonProxy(ctrl);
		px.SetUiEnable=undefined;
		px.onKey="Simplex";
		px.AttachFeature(PDS_Duplex);
		px.Init();
		
		
		hookEnabSimplexOpts(ctrl);
		}}
function InitControl_chkManual(ctrl,name){
var px=new ButtonProxy(ctrl);
px.AttachFeature(PDS_Duplex_Manual);
px.Init();
hookEnabDuplexOpts(ctrl);}
function InitControl_bmPortrait(ctrl,name){
var px=new ClickProxy(ctrl);
px.AttachFeature(PDS_Orientation);
px.ClickValue=eval(PDS_Orientation+".Options.Portrait");}
function InitControl_bmLandscape(ctrl,name){
var px=new ClickProxy(ctrl);
px.AttachFeature(PDS_Orientation);
px.ClickValue=eval(PDS_Orientation+".Options.Landscape");}
function InitControl_rbPortrait(ctrl,name){
var px=new OptionButtonProxy(ctrl);
px.onKey="Portrait";
px.AttachFeature(PDS_Orientation);
px.Init();}
function InitControl_rbLandscape(ctrl,name){
var px=new OptionButtonProxy(ctrl);
px.onKey="Landscape";
px.AttachFeature(PDS_Orientation);
px.Init();}
function InitControl_chkRotate(ctrl,name){
var px=new ButtonProxy(ctrl);
px.AttachFeature(PDS_Rotate180);
px.Init();}
function enabNup(ctrl,src,vals){
if(
(vals.cons)||(getPrinterInfo(1)=="FILE:")
					 ||(vals.srcm)){
var ctrl1=controls("ebNup");
if(ctrl1)
ctrl1.setNextValidItem(0);}
ctrl.isEnabled=!(vals.book
					 ||(vals.chkMIFrontCover &&((vals.MIStypeFront.nameId.getValue()=="Envelope")||(vals.MIStypeFront.nameId.getValue()=="RoughEnvelope")))
					 ||(vals.chkMIFirstPage &&((vals.MIStypeFirst.nameId.getValue()=="Envelope")||(vals.MIStypeFirst.nameId.getValue()=="RoughEnvelope")))
					 ||(vals.chkMILastPage &&((vals.MIStypeLast.nameId.getValue()=="Envelope")||(vals.MIStypeLast.nameId.getValue()=="RoughEnvelope")))
					 ||(vals.chkMIBackCover &&((vals.MIStypeBack.nameId.getValue()=="Envelope")||(vals.MIStypeBack.nameId.getValue()=="RoughEnvelope")))
|| vals.post
||vals.cons
||(getPrinterInfo(1)=="FILE:")
					||vals.srcm
					
);}
function hookEnabNup(ctrl){
var px=new FeatureGrpProxy(ctrl,[{id:"book",path:PDS_Booklet}
,{id:"size",path:PDS_PaperSize}
,{id:"post",path:PDS_Poster}
									,{id:"srcm",path:PDS_Constraints+".NupSourceMedia"}
,{id:"type",path:PDS_PaperType}
									,{id:"MIStypeFront",path:PDS_cbMIPaperTypeFrontCover}
									,{id:"MIStypeFirst",path:PDS_cbMIPaperTypeFirstPage}
									,{id:"MIStypeLast",path:PDS_cbMIPaperTypeLastPage}
									,{id:"MIStypeBack",path:PDS_cbMIPaperTypeBackCover}
									,{id:"chkMIFrontCover",path:PDS_chkMIFrontCover}
									,{id:"chkMIFirstPage",path:PDS_chkMIFirstPage}
									,{id:"chkMILastPage",path:PDS_chkMILastPage}
									,{id:"chkMIBackCover",path:PDS_chkMIBackCover}
,{id:"cons",path:PDS_Constraints+".NoEnv"}
]);
px.ChangeHandler=enabNup;
px.Init();}
function InitControl_sNup(ctrl,name){
hookEnabNup(ctrl);}
function InitControl_ebNup(ctrl,name){
var valTable="";
var feat=eval(PDS_Nup);
for(var iter=new Enumerator(feat); !iter.atEnd(); iter.moveNext()){
var opt=iter.item();
valTable=valTable+","+ opt.getValue();}
ctrl.setValueTable(valTable.substr(1));
var px=new EditBoxContProxy(ctrl);
px.HandleInvalidValue=px.Numeric$HandleInvalidValue;
px.FixUpUiValue=px.NumericSet$FixUpUiValue;
px.invalidMsgBox="mbInvalidEditVal";
ctrl.label=getUiLabel("!sNup");
px.isNumeric=true;
var ap=new OptionListProxy();
ap.fKeyId="";
ap.keyId="";
ap.AttachFeature(PDS_Nup);
px.AttachComponent(ap,"val");
px.Init();
hookEnabNup(ctrl);}
function InitControl_chkBorders(ctrl,name){
var px=new FeatureGrpProxy(ctrl,[{id:"nup",path:PDS_Nup}
,{id:"book",path:PDS_Booklet}
,{id:"post",path:PDS_Poster}
,{id:"cons",path:PDS_Constraints+".NoEnv"}
									,{id:"srcm",path:PDS_Constraints+".NupSourceMedia"}
]);
px.ChangeHandler=enab_chkBorders;
px.Init();
px=new ButtonProxy(ctrl);
px.AttachFeature(PDS_Nup_Borders);
px.Init();}
function enab_chkBorders(ctrl,src,vals){
ctrl.isEnabled=(vals.nup.getValue()>1 && !vals.book
&& !vals.post
&& !vals.cons
					&& !vals.srcm
);}
function InitControl_ilMultiPage(ctrl,name){
var px=new FeatureGrpProxy(ctrl,[{id:"book",path:PDS_Booklet}
,{id:"post",path:PDS_Poster}
,{id:"postSize",path:PDS_Poster_Size}
,{id:"orient",path:PDS_Orientation}
,{id:"nup",path:PDS_Nup}
,{id:"borders",path:PDS_Nup_Borders}]);
px.ChangeHandler=selMultiImg;
px.Init();
ctrl.AddEventHandler("onClick",incrNup);
px=new FeatureGrpProxy(ctrl,[{id:"book",path:PDS_Booklet}
,{id:"size",path:PDS_PaperSize}
										 ,{id:"type",path:PDS_PaperType}
										 ,{id:"MIStypeFront",path:PDS_cbMIPaperTypeFrontCover}
										 ,{id:"MIStypeFirst",path:PDS_cbMIPaperTypeFirstPage}
										 ,{id:"MIStypeLast",path:PDS_cbMIPaperTypeLastPage}
										 ,{id:"MIStypeBack",path:PDS_cbMIPaperTypeBackCover}
										 ,{id:"chkMIFrontCover",path:PDS_chkMIFrontCover}
										 ,{id:"chkMIFirstPage",path:PDS_chkMIFirstPage}
										 ,{id:"chkMILastPage",path:PDS_chkMILastPage}
										 ,{id:"chkMIBackCover",path:PDS_chkMIBackCover}
,{id:"cons",path:PDS_Constraints+".NoEnv"}
								,{id:"srcm",path:PDS_Constraints+".NupSourceMedia"}
,{id:"post",path:PDS_Poster}]);
px.ChangeHandler=enab_ilMultiPage;
px.Init();}
function incrNup(src,context,name){
var ctrl=controls("ebNup");
if(ctrl)
ctrl.setNextValidItem();}
function selMultiImg(ctrl,src,vals){
var img=0;
if(vals.book)
img=30;else
if(vals.post)
img=29+vals.postSize.getValue();
if(img==0){
if(vals.orient.getValue()==2)
img=15;
var nup=vals.nup.getValue();
switch(nup){
case 2:
img+=1;
break;
case 3:
img+=3;
break;
case 4:
img+=5;
break;
case 6:
img+=7;
break;
case 9:
img+=9;
break;
case 12:
img+=11;
break;
case 16:
img+=13;
break;}
if(nup>1 && vals.borders)
++img;}
ctrl.selectImage(img);}
function enab_ilMultiPage(ctrl,src,vals){
ctrl.isEnabled=!(vals.book
|| vals.cons
||(getPrinterInfo(1)=="FILE:")
					 ||(vals.chkMIFrontCover &&((vals.MIStypeFront.nameId.getValue()=="Envelope")||(vals.MIStypeFront.nameId.getValue()=="RoughEnvelope")))
					 ||(vals.chkMIFirstPage &&((vals.MIStypeFirst.nameId.getValue()=="Envelope")||(vals.MIStypeFirst.nameId.getValue()=="RoughEnvelope")))
					 ||(vals.chkMILastPage &&((vals.MIStypeLast.nameId.getValue()=="Envelope")||(vals.MIStypeLast.nameId.getValue()=="RoughEnvelope")))
					 ||(vals.chkMIBackCover &&((vals.MIStypeBack.nameId.getValue()=="Envelope")||(vals.MIStypeBack.nameId.getValue()=="RoughEnvelope")))
|| vals.post
					 || vals.srcm);}
function enabLayoutOpts(ctrl,src,vals){
var isEnabled=!(vals.book
|| vals.post
|| vals.cons
					|| vals.srcm)
&& vals.nup.getValue()>3;
ctrl.isEnabled=isEnabled;}
function InitControl_sLayout(ctrl,name){
var px=new FeatureGrpProxy(ctrl,[{id:"book",path:PDS_Booklet}
,{id:"post",path:PDS_Poster}
,{id:"cons",path:PDS_Constraints+".NoEnv"}
									,{id:"srcm",path:PDS_Constraints+".NupSourceMedia"}
,{id:"nup",path:PDS_Nup}]);
px.ChangeHandler=enabLayoutOpts;
px.Init();}
function InitControl_rbAcross(ctrl,name){
var px=new OptionButtonProxy(ctrl);
px.SetUiEnable=undefined;
px.onKey="Across";
px.AttachFeature(PDS_Nup_Layout);
px.Init();}
function InitControl_rbDown(ctrl,name){
var px=new OptionButtonProxy(ctrl);
px.SetUiEnable=undefined;
px.onKey="Down";
px.AttachFeature(PDS_Nup_Layout);
px.Init();}
function InitControl_pbMoreLayoutXQ(ctrl,name){
if(hasPermission()){
var px=new ConstraintButtonContProxy(ctrl);
px.GetContextId=pbMoreLayoutXQ_GetContextId;
px.IsConstrained=isMoreLayoutConstrained;
		
px.Init();}}
function isMoreLayoutConstrained(compId,compVal){
if(compId=="fax" )
return compVal;
else return false;}
function pbMoreLayoutXQ_GetContextId(compId,compVal){
if(compId=="fax" )
return 1509;}
function InitControl_pbMoreLayout(ctrl,name){	
ctrl.AddEventHandler("onClick", ShowMoreLayout);
var px=new FeatureGrpProxy(ctrl,[
{id:"dummy",path:PDS_Collate}	
									]);														
px.ChangeHandler=enabMoreLayoutCtls1;
px.Init();}
function ShowMoreLayout(src,context,name){
showFrame("dlgMoreLayout1" );}
function enabMoreLayoutCtls1(ctrl,grp,value){
var stploff=true;
var punchoff=true;
var foldfinishoff=true;
var offset=true;
var fax=true;
	 ctrl.isEnabled=fax;						}
function enabMoreLayoutConstraints(){
return((eval(PDS_Staple).getValue().nameId.getValue()=="Off") &&(eval(PDS_Offset).getValue().nameId.getValue()=="Off")
		);}
@END
@DocProps
function InitControl_cbPaperSize(ctrl,name){
var px=new ListBoxProxy(ctrl);
px.AttachFeature(PDS_PaperSize);
px.Init();}
function InitControl_cbFitTo(ctrl,name){
var px=new ListBoxProxy(ctrl);
px.AttachFeature(PDS_FitToPageSize);
px.Init();
hookEnabFitToCtls(ctrl);}
function enabFitToCtls(ctrl,grp,value){
ctrl.isEnabled=!value.maintain;}
function hookEnabFitToCtls(ctrl){
var px=new FeatureGrpProxy(ctrl,[{id:"maintain",path:PDS_BookletMaintainLetterA4}]);
px.ChangeHandler=enabFitToCtls;
px.Init();}
function InitControl_cbTray(ctrl,name){
var px=new ListBoxProxy(ctrl);
px.AttachFeature(PDS_PaperSource);
px.Init();}
function InitControl_cbPaperType(ctrl,name){
var px=new ListBoxProxy(ctrl);
px.AttachFeature(PDS_PaperType);
px.Init();}
function InitControl_cbOutBin(ctrl,name){
var f=eval(PDS_ModelLow);
var m=f.getValue();
if(m==true){
ctrl.isVisible=false;}else{
ctrl.isVisible=true;
var px=new ListBoxProxy(ctrl);
px.AttachFeature(PDS_PaperDest);
px.Init();}}
function InitControl_sOutputBin(ctrl,name){
ctrl.isVisible=true;}
function InitControl_pbMorePaperXQ(ctrl,name){
if(hasPermission()){
var px=new ConstraintButtonContProxy(ctrl);
px.GetContextId=pbMorePaperXQ_GetContextId;
	 px.SetUiVal=pbMorePaperXQ_SetUiVal;
	 var ap=new VariablePathProxy();
ap.fKeyId=null;
ap.AttachFeature(PDS_Poster);
px.AttachComponent(ap,"post");
var ap=new VariablePathProxy();
ap.fKeyId=null;
ap.AttachFeature(PDS_Booklet);
px.AttachComponent(ap,"book");
	 var ap=new VariablePathProxy();
ap.fKeyId=null;
ap.AttachFeature(PDS_PrintOrder);
px.AttachComponent(ap,"order");
	 px.Init();}}
function pbMorePaperXQ_SetUiVal(uiObj, uiVal){
	var fax=false;
	var post=this.GetComponent("post").GetCompValue();
	var book=this.GetComponent("book").GetCompValue();
	var order=this.GetComponent("order").GetCompValue();
	uiObj.isVisible=post || book || order || fax;}
function pbMorePaperXQ_GetContextId(compId,compVal){
if(compId=="post" )
	return 1101;
else if(compId=="book" )
	return 1101;
else if(compId=="order" )
	return 1110;else
	return false;}
function InitControl_pbMorePaper(ctrl,name){
ctrl.AddEventHandler("onClick", ShowMorePaper);}
function ShowMorePaper(src,context,name){
showFrame("dlgMorePaper" );}
function enabMoreFinishCtls(ctrl,grp,value){
var stploff=false;
var punchoff=false;
var foldfinishoff=true;
var fax=true;
if(value.stpl.nameId.getValue()=="Off")
stploff=true;
ctrl.isEnabled=(!stploff || !punchoff || !foldfinishoff)&& fax;
					}
function InitControl_pbMoreFinish(ctrl,name){
ctrl.AddEventHandler("onClick", ShowMoreFinish);
var px=new FeatureGrpProxy(ctrl,[{id:"stpl",path:PDS_Staple}
									
									]);
px.ChangeHandler=enabMoreFinishCtls;
px.Init();}
function ShowMoreFinish(){
showFrame("dlgMoreFinish1" );}
function enabOtherThanFoldConstraints(){
	return(eval(PDS_FoldFinish).getValue().nameId.getValue()=="Off");}
function enabPaperConstraints(compVal){
	var cmp=(compVal.mtype.getValue()=="envelope" || compVal.nameId.getValue()=="A5" || compVal.nameId.getValue()=="STATEMENT" || compVal.nameId.getValue()=="LEGAL" || compVal.nameId.getValue()=="FOLIO" || compVal.nameId.getValue()=="EXECUTIVE" || compVal.nameId.getValue()=="B5" || compVal.nameId.getValue()=="Universal" || compVal.nameId.getValue()=="Oficio");
	return cmp;}
function enabPapTypeConstraints(compVal){
	var cmp=(compVal.nameId.getValue()=="Transparency" || compVal.nameId.getValue()=="Labels");
	return cmp;}
function enabOutBinConstraints(compVal){
	var cmp=(compVal.nameId.getValue()=="StandardBin" || compVal.nameId.getValue()=="Bin1");
	return cmp;}
function InitControl_pbMoreInputOptions(ctrl,name){
ctrl.AddEventHandler("onClick", ShowMoreInput);
var px=new FeatureGrpProxy(ctrl,[{id:"post",path:PDS_Poster}
,{id:"book",path:PDS_Booklet},{id:"LastPageFirst",path:PDS_PrintOrder}]);
px.ChangeHandler=enabMoreInputCtls;
px.Init();}
function enabMoreInputCtls(ctrl,grp,value){
	 ctrl.isEnabled=!value.post
					&& !value.book
					&& !value.LastPageFirst
					 ;}
function InitControl_sCustomPapersL(ctrl,name){
ctrl.AddEventHandler("onClick", ShowCustomPapers);}
function ShowCustomPapers(src,context,name){
showFrame("dlgCustomPapers" );}
function ShowMoreInput(src,context,name){
showFrame("dlgMoreInput" );}
@END
@DocProps PrintProps
function getPQmap(){		
if(getPQmap.PQMap===undefined){
		getPQmap.PQMap=
[{td: "_8", res: "_1200dpi", cust: false, label: "!Best_$!"}
,{td: "PrinterSetting", res: "_600dpi2", cust: false, label: "!Normal_$!"}
,{td: "PrinterSetting", res: "_600dpi", cust: false, label: "!Draft_$!"}
,{cust: true, label: "!Custom_$!"}];	
var td=eval(PDS_TonerDark)
if((td!==undefined)&&(td.Default!==undefined)){
var tdDef=td.Default.getValue().nameId.getValue();
var values={label : "!Best_$!"};
var mItem=PQ_map_Match(values);
if(mItem){
mItem.td=tdDef;}}}
return getPQmap.PQMap;}
function PQ_map_Match(values){
var PQ_map=getPQmap();
var mItem=undefined;
for(var i=0;(i<PQ_map.length)&&(mItem===undefined); i++){
mItem=PQ_map[i];
for(var comp in mItem){
if((values[comp]!==undefined)&&(mItem[comp]!=values[comp])){
mItem=undefined;
break;}}}
return mItem;}
@END
@DocProps
function InitPQButton(ctrl,label){
var PQ_map=getPQmap();
var values;
for(var i=0; i<PQ_map.length; i++){
var mItem=PQ_map[i];
if(label==mItem.label){
values=mItem;
break;}}
if(values!==undefined){
var ap;
var bp=new ButtonContProxy(ctrl);
bp.fOn=new Object();
if((values.td!==undefined)&&
(eval(PDS_TonerDark)!==undefined)){
bp.fOn.td=values.td;
ap=new OptionListProxy();
ap.AttachFeature(PDS_TonerDark);
bp.AttachComponent(ap,"td");}
if((values.res!==undefined)&&
(eval(PDS_Resolution)!==undefined)){
bp.fOn.res=values.res;
ap=new OptionListProxy();
ap.AttachFeature(PDS_Resolution);
bp.AttachComponent(ap,"res");}
if((values.cs!==undefined)&&
(eval(PDS_ColorSaver)!==undefined)){
bp.fOn.cs=values.cs;
ap=new OptionListProxy();
ap.AttachFeature(PDS_ColorSaver);
bp.AttachComponent(ap,"cs");
}	
if((values.fl!==undefined)&&
(eval(PDS_FineLines)!==undefined)){
bp.fOn.fl=values.fl;
ap=new OptionListProxy();
ap.AttachFeature(PDS_FineLines);
bp.AttachComponent(ap,"fl");
}	
if((values.cc!==undefined)&&
(eval(PDS_ColorCorrection)!==undefined)){
bp.fOn.cc=values.cc;
ap=new OptionListProxy();
ap.AttachFeature(PDS_ColorCorrection);
bp.AttachComponent(ap,"cc");}
	 if((values.rgbim!==undefined)&&
(eval(PDS_RGBImages)!==undefined)){
bp.fOn.rgbim=values.rgbim;
ap=new OptionListProxy();
ap.AttachFeature(PDS_RGBImages);
bp.AttachComponent(ap,"rgbim");
}	
if((values.rgbtt!==undefined)&&
(eval(PDS_RGBText)!==undefined)){
bp.fOn.rgbtt=values.rgbtt;
ap=new OptionListProxy();
ap.AttachFeature(PDS_RGBText);
bp.AttachComponent(ap,"rgbtt");
}	
if((values.rgbgp!==undefined)&&
(eval(PDS_RGBGraphics)!==undefined)){
bp.fOn.rgbgp=values.rgbgp;
ap=new OptionListProxy();
ap.AttachFeature(PDS_RGBGraphics);
bp.AttachComponent(ap,"rgbgp");
}	
if((values.rgbcc!==undefined)&&
(eval(PDS_RGBCorrection)!==undefined)){
bp.fOn.rgbcc=values.rgbcc;
ap=new OptionListProxy();
ap.AttachFeature(PDS_RGBCorrection);
bp.AttachComponent(ap,"rgbcc");}
if((values.sat!==undefined)&&
(eval(PDS_Saturation)!==undefined)){
bp.fOn.sat=values.sat;
ap=new VariablePathProxy();
		 ap.fKeyId=null;
ap.AttachFeature(PDS_Saturation);
		 bp.AttachComponent(ap,"sat");
	}
if((values.pg!==undefined)&&
(eval(PDS_PictureGradePCL)!==undefined)){
bp.fOn.pg=values.pg;
ap=new OptionListProxy();
ap.AttachFeature(PDS_PictureGradePCL);
bp.AttachComponent(ap,"pg");}
if(values.cust!==undefined){
bp.fOn.cust=values.cust;
ap=new VariablePathProxy();
ap.fKeyId=null;
ap.AttachFeature(PDS_PQCustom);
bp.AttachComponent(ap,"cust");}
bp.fOff=undefined;
bp.Compare=PQButtonCompare;
bp.Init();}}
function PQButtonCompare(valObj,mapObj){
var match=true;
for(var comp in mapObj){
if((valObj[comp]===undefined)||(valObj[comp]!=mapObj[comp])){
match=false;
break;}}
return match;}
function InitControl_rbBest(ctrl,name){
	 InitPQButton(ctrl,"!Best_$!");
var px=new FeatureGrpProxy(ctrl,[{id:"prtBw",path:PDS_PrintBW}
,{id:"fax",path:PDS_Fax}]);
px.ChangeHandler=selBestImg;
px.Init();}
	function selBestImg(ctrl,grp,value)
	{
	 ctrl.selectImage(4);	
	 ctrl.isEnabled=!value.fax;
	}
function InitControl_rbBetter(ctrl,name){
InitPQButton(ctrl,"!Best_$!");
var px=new FeatureGrpProxy(ctrl,[{id:"prtBw",path:PDS_PrintBW}
,{id:"fax",path:PDS_Fax}]);
px.ChangeHandler=selBestImg;
px.Init();}
function selBetterImg(ctrl,grp,value){
ctrl.selectImage(value.prtBw ? 5 : 1);}
function InitControl_rbNormal(ctrl,name){
	InitPQButton(ctrl,"!Normal_$!");
var px=new FeatureGrpProxy(ctrl,[{id:"prtBw",path:PDS_PrintBW}
,{id:"fax",path:PDS_Fax}]);
px.ChangeHandler=selNormImg;
px.Init();}
	function selNormImg(ctrl,grp,value)
	{
	 ctrl.selectImage(6);	
	 ctrl.isEnabled=!value.fax;
	}
function InitControl_rbDraft(ctrl,name){
	InitPQButton(ctrl,"!Draft_$!");
var px=new FeatureGrpProxy(ctrl,[{id:"prtBw",path:PDS_PrintBW}
,{id:"fax",path:PDS_Fax}]);
px.ChangeHandler=selDraftImg;
px.Init();}
	function selDraftImg(ctrl,grp,value)
	{
	 ctrl.selectImage(7);	
	 ctrl.isEnabled=!value.fax;
	}
function InitControl_rbCustom(ctrl,name){
InitPQButton(ctrl,"!Custom_$!");
var px=new FeatureGrpProxy(ctrl,[{id:"fax",path:PDS_Fax}]);
px.ChangeHandler=rbCustom_ChangeHandler;
px.Init();}
function rbCustom_ChangeHandler(ctrl,grp,value){
ctrl.isEnabled=!value.fax;}
function InitControl_bmBW(ctrl,name){
ctrl.AddEventHandler("onClick",toglBW);
ctrl.isVisible=true;}
function toglBW(src,context,name){
var f=eval(PDS_PrintBW);
var newBW=!f.getValue();
var trans=new Transaction(src);
f.setValue(newBW);
trans.evaluate();
trans.commit();
controls("chkBW").isFocus=true;}
function InitControl_chkBW(ctrl,name){
var px=new ButtonProxy(ctrl);
px.AttachFeature(PDS_PrintBW);
ctrl.isVisible=true;
px.Init();}
function InitControl_chkBlack1(ctrl,name){
var px=new ButtonProxy(ctrl);
px.AttachFeature(PDS_Effect_MakeBlack);
px.Init();}
function init_cbResolution(ctrl,name){
var px=new ListBoxProxy(ctrl);
px.AttachFeature(PDS_Resolution);
px.Init();}
function InitControl_cbResolution2(ctrl,name){
init_cbResolution(ctrl,name);
var px=new FeatureGrpProxy(ctrl,[{id:"cust",path:PDS_PQCustom}]);
px.ChangeHandler=enab_sRes;
px.Init();}
function InitControl_cbResolution1(ctrl,name){
init_cbResolution(ctrl,name);
var px=new FeatureGrpProxy(ctrl,[{id:"cust",path:PDS_PQCustom}]);
px.ChangeHandler=enab_sRes;
px.Init();}
function InitControl_cbResolution(ctrl,name){
init_cbResolution(ctrl,name);
var px=new FeatureGrpProxy(ctrl,[{id:"cust",path:PDS_PQCustom}]);
px.ChangeHandler=enab_sRes;
px.Init();}
function InitControl_sResolutionL(ctrl,name){
var px=new FeatureGrpProxy(ctrl,[{id:"cust",path:PDS_PQCustom}]);
px.ChangeHandler=enab_sRes;
px.Init();}
function enab_sRes(ctrl,grp,val){
ctrl.isEnabled=val.cust;}
function InitControl_sPictureGradeUsePrt(ctrl,name){
var px=new FeatureGrpProxy(ctrl,[{id:"cust",path:PDS_PQCustom}
,{id:"mono",path:PDS_PictureGradePCL}]);
px.ChangeHandler=InitControl_sPictureGradeUsePrt_ChangeHandler;
px.Init();}
function InitControl_sPictureGradeUsePrt_ChangeHandler(ctrl,grp,vals){
var isVisible=!vals.cust;
ctrl.isVisible=isVisible;
ctrl.isEnabled=false;
var lbl="";
if(isVisible){
lbl=vals.mono.resId.getValue();}
ctrl.setLabel(lbl);}
function InitControl_cbPictureGrade(ctrl,name){
var px=new ListBoxProxy(ctrl);
px.AttachFeature(PDS_PictureGradePCL);
px.Init();
px=new FeatureGrpProxy(ctrl,[{id:"cust",path:PDS_PQCustom}]);
px.ChangeHandler=cbPictureGrade_ChangeHandler;
px.Init();}
function cbPictureGrade_ChangeHandler(ctrl,grp,val){
var isVisible=val.cust;
var isEnabled=(isVisible);
ctrl.isEnabled=isEnabled;
ctrl.isVisible=isVisible;}
function InitControl_sTonerDark(ctrl,name){
var px=new FeatureGrpProxy(ctrl,[{id:"cust",path:PDS_PQCustom}
,{id:"color",path:PDS_ColorSaver}]);
px.ChangeHandler=sTonerDark_ChangeHandler;
px.Init();}
function sTonerDark_ChangeHandler(ctrl,grp,vals){
var chkEnabled=vals.cust &&(vals.color.nameId.getValue()!="On");
ctrl.isEnabled=vals.cust ||(vals.color.nameId.getValue()=="On");;
ctrl.isVisible=!chkEnabled;	}
function InitControl_sTonerDarkUsePrt(ctrl,name){
var px=new FeatureGrpProxy(ctrl,[{id:"cust",path:PDS_PQCustom}
,{id:"td",path:PDS_TonerDark}
,{id:"color",path:PDS_ColorSaver}]);
px.ChangeHandler=sTonerDarkUsePrt_ChangeHandler;
px.Init();}
function sTonerDarkUsePrt_ChangeHandler(ctrl,grp,vals){
ctrl.isEnabled=vals.cust;}
function InitControl_chkTonerDark(ctrl,name){
var px=new OptionButtonProxy(ctrl);
px.SetUiEnable=undefined;
px.onKey=eval(PDS_TonerDark+".Default.getValue().nameId.getValue()");
px.offKey="PrinterSetting";
px.defUiVal=true;
px.AttachFeature(PDS_TonerDark);
px.Init();
px=new FeatureGrpProxy(ctrl,[{id:"cust",path:PDS_PQCustom}
,{id:"color",path:PDS_ColorSaver}]);
px.ChangeHandler=chkTonerDark_ChangeHandler;
px.Init();}
function chkTonerDark_ChangeHandler(ctrl,grp,vals){
var isVisible=vals.cust &&(vals.color.nameId.getValue()!="On");
var isEnabled=isVisible;
ctrl.isEnabled=isEnabled;
ctrl.isVisible=isVisible;}
function InitControl_sTonerDarkMin(ctrl,name){
var feat=eval(PDS_TonerDark);
var val=feat.Min.getValue();
ctrl.setLabel(""+val);}
function InitControl_sTonerDarkMax(ctrl,name){
var feat=eval(PDS_TonerDark);
var val=feat.Max.getValue();
ctrl.setLabel(""+val);}
function InitControl_sTonerDarkVal(ctrl,name){
var px=new FeatureGrpProxy(ctrl,[{id:"cust",path:PDS_PQCustom}
,{id:"td",path:PDS_TonerDark}
,{id:"color",path:PDS_ColorSaver}]);
px.ChangeHandler=sTonerDarkVal_ChangeHandler;
px.Init();}
function sTonerDarkVal_ChangeHandler(ctrl,grp,vals){
ctrl.setLabel(""+vals.td.getValue());}
function InitControl_sldTonerDark(ctrl,name){
var px=new OptionListProxy(ctrl);
px.GetUiVal=InitControl_sldTonerDark_GetUiVal;
px.SetUiVal=InitControl_sldTonerDark_SetUiVal;
px.ReloadOptions=InitControl_sldTonerDark_ReloadOptions;
px.GetUiValFromKey=InitControl_sldTonerDark_GetUiValFromKey;
px.fKeyId="";
px.keyId="";
px.AttachFeature(PDS_TonerDark);
px.HookEvent(px.GetUiObjId(),"onChange",px.OnUiValChange);
var feat=eval(PDS_TonerDark);
ctrl.setRange(feat.Min.getValue(),feat.Max.getValue());
px.Init();
px=new FeatureGrpProxy(ctrl,[{id:"cust",path:PDS_PQCustom}
,{id:"td",path:PDS_TonerDark}
,{id:"color",path:PDS_ColorSaver}]);
px.ChangeHandler=sldTonerDark_ChangeHandler;
px.Init();}
function sldTonerDark_ChangeHandler(ctrl,grp,vals){
var isVisible=
vals.td.nameId.getValue()!="PrinterSetting"
&& vals.color.nameId.getValue()!="On";
var isEnabled=isVisible && vals.cust;
ctrl.isEnabled=isEnabled;
ctrl.isVisible=isVisible;}
function InitControl_sldTonerDark_GetUiVal(uiObj){
return uiObj.getPos();}
function InitControl_sldTonerDark_SetUiVal(uiObj,uiVal){
if(uiVal!==undefined){
uiObj.setPos(uiVal);}}
function InitControl_sldTonerDark_ReloadOptions(uiObj,collection){}
function InitControl_sldTonerDark_GetUiValFromKey(key){
var uiVal;
var feat=this.HostObj(this.featId);
if((key>=feat.Min.getValue())&&(key<=feat.Max.getValue())){
uiVal=key;}
return uiVal;}
function InitControl_pbMoreColor(ctrl,name){
hookEnabMoreColor(ctrl);
ctrl.AddEventHandler("onClick", ShowMoreColor);}
function ShowMoreColor(){
showFrame("dlgMoreColor" );}
function InitControl_sColorSaverUsePrt(ctrl,name){
var px=new FeatureGrpProxy(ctrl,[{id:"cust",path:PDS_PQCustom}
,{id:"color",path:PDS_ColorSaver}]);
px.ChangeHandler=InitControl_sColorSaverUsePrt_ChangeHandler;
px.Init();}
function InitControl_sColorSaverUsePrt_ChangeHandler(ctrl,grp,vals){
var isVisible=!vals.cust;
ctrl.isVisible=isVisible;
ctrl.isEnabled=false;
var lbl="";
if(isVisible){
lbl=vals.color.resId.getValue();}
ctrl.setLabel(lbl);}
function InitControl_cbColorSaver(ctrl,name){
var px=new ListBoxProxy(ctrl);
px.AttachFeature(PDS_ColorSaverPCL);
px.Init();
px=new FeatureGrpProxy(ctrl,[{id:"cust",path:PDS_PQCustom}]);
px.ChangeHandler=cbColorSaver_ChangeHandler;
px.Init();}
function cbColorSaver_ChangeHandler(ctrl,grp,val){
var isVisible=val.cust;
var isEnabled=(isVisible);
ctrl.isEnabled=isEnabled;
ctrl.isVisible=isVisible;}
function hookEnabMoreColor(ctrl){
var px=new FeatureGrpProxy(ctrl,[{id:"bw",path:PDS_PrintBW}]);
px.ChangeHandler=enabMoreColor;
px.Init();}
function enabMoreColor(ctrl,grp,val){
var isEnabled=!(val.bw);
ctrl.isEnabled=isEnabled;
ctrl.isVisible=true;}
function InitControl_pbMorePQ(ctrl,name){
ctrl.AddEventHandler("onClick", ShowMorePQ);
var px=new FeatureGrpProxy(ctrl,[{id:"fax",path:PDS_Fax}]);
px.ChangeHandler=pbMorePQ_ChangeHandler;
px.Init();}
function pbMorePQ_ChangeHandler(ctrl,grp,value){
ctrl.isEnabled=!value.fax;}
function ShowMorePQ(){
showFrame("dlgMorePQ" );}
@END
@DocProps
function InitControl_pbColorCorrection(ctrl,name){
ctrl.AddEventHandler("onClick",ShowColorCorr);
hookEnabMoreColor(ctrl);}
function InitControl_sColorCorrDsc(ctrl,name){
hookEnabMoreColor(ctrl);}
function ShowColorCorr(){
showFrame("dlgColorCorr");}
function InitControl_pbColorBal(ctrl,name){
ctrl.AddEventHandler("onClick",showColorBal);}
function showColorBal(){
showFrame("dlgColorBalance");}
function hookEnabAdvColor(ctrl){
var px=new FeatureGrpProxy(ctrl,[{id:"mode",path:PDS_GraphicMode}]);
px.ChangeHandler=enabAdvColor;
px.Init();}
function enabAdvColor(ctrl,grp,value){
ctrl.isEnabled=value.mode.getValue()!=2;}
function InitControl_pbAdvColor(ctrl,name){
ctrl.AddEventHandler("onClick",showAdvColor);
hookEnabAdvColor(ctrl);}
function InitControl_sColorMgmt(ctrl,name){
hookEnabAdvColor(ctrl);}
function showAdvColor(){
showFrame("dlgAdvColor");}
function InitControl_pbHelpAdvColor(ctrl,name){
ctrl.AddEventHandler("onClick",HelpAdvColor);}
function HelpAdvColor(evt){
showHelp(evt,"Context",0);}
@END
@DocProps
function InitControl_cbColorCorr(ctrl,name){
var px=new ListBoxProxy(ctrl);
px.AttachFeature(PDS_ColorCorrection);
px.Init();}
function enabColorCor(ctrl,grp,value){
ctrl.isEnabled=value.cor.nameId.getValue()=="Manual";}
function hookCorEnab(ctrl){
px=new FeatureGrpProxy(ctrl,[{id:"cor",path:PDS_ColorCorrection}]);
px.ChangeHandler=enabColorCor;
px.Init();}
function InitControl_sRGBImages(ctrl){
hookCorEnab(ctrl);}
function InitControl_cbRGBImages(ctrl,name){
var px=new ListBoxProxy(ctrl);
px.AttachFeature(PDS_RGBImages);
px.Init();
hookCorEnab(ctrl);}
function InitControl_sRGBText(ctrl){
hookCorEnab(ctrl);}
function InitControl_cbRGBText(ctrl,name){
var px=new ListBoxProxy(ctrl);
px.AttachFeature(PDS_RGBText);
px.Init();
hookCorEnab(ctrl);}
function InitControl_sRGBGraphics(ctrl){
hookCorEnab(ctrl);}
function InitControl_cbRGBGraphics(ctrl,name){
var px=new ListBoxProxy(ctrl);
px.AttachFeature(PDS_RGBGraphics);
px.Init();
hookCorEnab(ctrl);}
function InitControl_pbHelpColorCorr(ctrl,name){
ctrl.AddEventHandler("onClick",HelpColorCorr);}
function HelpColorCorr(evt){
showHelp(evt,"Context",0);}
@END
@DocProps
function InitControl_cbColorBalance(ctrl,name){
var px=new ListBoxProxy(ctrl);
px.AttachFeature(PDS_ColorBalanceMode);
px.Init();}
function enabColorBal(ctrl,grp,value){
ctrl.isEnabled=value.bal.nameId.getValue()=="Manual";}
function hookBalEnab(ctrl){
var px=new FeatureGrpProxy(ctrl,[{id:"bal",path:PDS_ColorBalanceMode}]);
px.ChangeHandler=enabColorBal;
px.Init();}
function InitControl_sBalCyanLbl(ctrl,name){
hookBalEnab(ctrl);}
function InitControl_sldBalCyan(ctrl,name){
var f=eval(PDS_CyanBalance);
ctrl.setRange(f.Min.getValue(), f.Max.getValue());
var px=new SliderProxy(ctrl);
px.AttachFeature(PDS_CyanBalance);
px.Init();
hookBalEnab(ctrl);}
function InitControl_sCBalCMin(ctrl,name){
var px=new LabelProxy(ctrl);
px.AttachFeature(PDS_CyanBalance_Min);
px.Init();
hookBalEnab(ctrl);}
function InitControl_sCBalCMid(ctrl,name){
var f=eval(PDS_CyanBalance);
var mid=(f.Min.getValue()+f.Max.getValue())/ 2;
ctrl.setLabel(""+mid);
hookBalEnab(ctrl);}
function InitControl_sCBalCMax(ctrl,name){
var px=new LabelProxy(ctrl);
px.AttachFeature(PDS_CyanBalance_Max);
px.Init();
hookBalEnab(ctrl);}
function InitControl_sBalMagentaLbl(ctrl,name){
hookBalEnab(ctrl);}
function InitControl_sldBalMagenta(ctrl,name){
var f=eval(PDS_MagentaBalance);
ctrl.setRange(f.Min.getValue(), f.Max.getValue());
var px=new SliderProxy(ctrl);
px.AttachFeature(PDS_MagentaBalance);
px.Init();
hookBalEnab(ctrl);}
function InitControl_sCBalMMin(ctrl,name){
var px=new LabelProxy(ctrl);
px.AttachFeature(PDS_MagentaBalance_Min);
px.Init();
hookBalEnab(ctrl);}
function InitControl_sCBalMMid(ctrl,name){
var f=eval(PDS_MagentaBalance);
var mid=(f.Min.getValue()+f.Max.getValue())/ 2;
ctrl.setLabel(""+mid);
hookBalEnab(ctrl);}
function InitControl_sCBalMMax(ctrl,name){
var px=new LabelProxy(ctrl);
px.AttachFeature(PDS_MagentaBalance_Max);
px.Init();
hookBalEnab(ctrl);}
function InitControl_sBalYellowLbl(ctrl,name){
hookBalEnab(ctrl);}
function InitControl_sldBalYellow(ctrl,name){
var f=eval(PDS_YellowBalance);
ctrl.setRange(f.Min.getValue(), f.Max.getValue());
var px=new SliderProxy(ctrl);
px.AttachFeature(PDS_YellowBalance);
px.Init();
hookBalEnab(ctrl);}
function InitControl_sCBalYMin(ctrl,name){
var px=new LabelProxy(ctrl);
px.AttachFeature(PDS_YellowBalance_Min);
px.Init();
hookBalEnab(ctrl);}
function InitControl_sCBalYMid(ctrl,name){
var f=eval(PDS_YellowBalance);
var mid=(f.Min.getValue()+f.Max.getValue())/ 2;
ctrl.setLabel(""+mid);
hookBalEnab(ctrl);}
function InitControl_sCBalYMax(ctrl,name){
var px=new LabelProxy(ctrl);
px.AttachFeature(PDS_YellowBalance_Max);
px.Init();
hookBalEnab(ctrl);}
function InitControl_sBalBlackLbl(ctrl,name){
hookBalEnab(ctrl);}
function InitControl_sldBalBlack(ctrl,name){
var f=eval(PDS_BlackBalance);
ctrl.setRange(f.Min.getValue(), f.Max.getValue());
var px=new SliderProxy(ctrl);
px.AttachFeature(PDS_BlackBalance);
px.Init();
hookBalEnab(ctrl);}
function InitControl_sCBalBMin(ctrl,name){
var px=new LabelProxy(ctrl);
px.AttachFeature(PDS_BlackBalance_Min);
px.Init();
hookBalEnab(ctrl);}
function InitControl_sCBalBMid(ctrl,name){
var f=eval(PDS_BlackBalance);
var mid=(f.Min.getValue()+f.Max.getValue())/ 2;
ctrl.setLabel(""+mid);
hookBalEnab(ctrl);}
function InitControl_sCBalBMax(ctrl,name){
var px=new LabelProxy(ctrl);
px.AttachFeature(PDS_BlackBalance_Max);
px.Init();
hookBalEnab(ctrl);}
function InitControl_pbHelpColorBalance(ctrl,name){
ctrl.AddEventHandler("onClick",HelpColorBalance);}
function HelpColorBalance(evt){
showHelp(evt,"Context",0);}
@END
@DocProps
function InitControl_pbHelpColorMgmt(ctrl,name){
ctrl.AddEventHandler("onClick",HelpColorMgmt);}
function HelpColorMgmt(evt){
showHelp(evt,"Context",0);}
@END
@DocProps
function InitControl_pbWmark(ctrl,name){
ctrl.AddEventHandler("onClick", ShowWMark);}
function EnableDisableWMark(ctrl,grp,value){
if(value.fax){
	 ctrl.isEnabled=(!value.faxpopup);}else{
	 ctrl.isEnabled=true;}}
function ShowWMark(src,context,name){
showFrame("dlgWmark" );}
function InitControl_pbOvrly(ctrl,name){
ctrl.AddEventHandler("onClick", ShowOverlay);}
function ShowOverlay(src,context,name){
showFrame("dlgOverlay" );}
function InitControl_pbHold(ctrl,name){
ctrl.AddEventHandler("onClick", ShowHold);}
function ShowHold(src,context,name){
showFrame("dlgHold" );}
function InitControl_chkTrack(ctrl,name){
var px=new ButtonProxy(ctrl);
px.AttachFeature(PDS_AcctTrak);
px.Init();
ctrl.AddEventHandler("onClick", ShowTrackEnabled);}
function ShowTrackEnabled(src,context,name){
if(src.isChecked){
if(!eval(PDS_AcctTrak_NoShoMsg).getValue())
showFrame("dlgTrackEnabled" );}}
function InitControl_pbStatus(ctrl,name){
if(statusWindow(1)&& eval(PDS_Admin).getValue()&& !(getDriverAttributes(1))){
ctrl.AddEventHandler("onClick", ShowStatus);}else{
ctrl.isEnabled=false;}}
function ShowStatus(src,context,name){
showFrame("dlgStatus" );}
function InitControl_pbMoreOther(ctrl,name){
ctrl.AddEventHandler("onClick", ShowMoreOpt);}
function ShowMoreOpt(src,context,name){
showFrame("dlgMoreOpt" );}
@END
@DocProps
function InitControl_sMPQBMin(ctrl,name){
var feat=eval(PDS_Brightness);
var val=feat.Min.getValue();
ctrl.setLabel(""+val);}
function InitControl_sMPQBMid(ctrl,name){
var feat=eval(PDS_Brightness);
var val=feat.Mid.getValue();
ctrl.setLabel(""+val);}
function InitControl_sMPQBMax(ctrl,name){
var feat=eval(PDS_Brightness);
var val=feat.Max.getValue();
ctrl.setLabel(""+val);}
function InitControl_sldBrightness(ctrl,name){
var feat=eval(PDS_Brightness);
ctrl.setRange(feat.Min.getValue(),feat.Max.getValue());
var px=new SliderProxy(ctrl);
px.AttachFeature(PDS_Brightness);
px.Init();
px=new FeatureGrpProxy(ctrl,[{id:"gc",path:PDS_GrayCorrection}]);
px.ChangeHandler=enabGrayCorr;
px.Init();}
function enabGrayCorr(ctrl,grp,value){
var f=eval(PDS_DrvType);
var m=f.getValue();
if(m!=64){
ctrl.isEnabled=value.gc.nameId.getValue()=="Manual";}else{
ctrl.isEnabled=false;
	}
}	
function enabRGBCorr(ctrl,grp,value){
ctrl.isEnabled=value.rgb.nameId.getValue()!="PrinterSetting";}
function InitControl_sMPQCMin(ctrl,name){
var feat=eval(PDS_Contrast);
var val=feat.Min.getValue();
ctrl.setLabel(""+val);}
function InitControl_sMPQCMax(ctrl,name){
var feat=eval(PDS_Contrast);
var val=feat.Max.getValue();
ctrl.setLabel(""+val);}
function InitControl_sldContrast(ctrl,name){
var feat=eval(PDS_Contrast);
ctrl.setRange(feat.Min.getValue(),feat.Max.getValue());
var px=new SliderProxy(ctrl);
px.AttachFeature(PDS_Contrast);
px.Init();
px=new FeatureGrpProxy(ctrl,[{id:"gc",path:PDS_GrayCorrection}]);
px.ChangeHandler=enabGrayCorr;
px.Init();}
function InitControl_sMPQSMin(ctrl,name){
var feat=eval(PDS_Saturation);
var val=feat.Min.getValue();
ctrl.setLabel(""+val);}
function InitControl_sMPQSMax(ctrl,name){
var feat=eval(PDS_Saturation);
var val=feat.Max.getValue();
ctrl.setLabel(""+val);}
function InitControl_sldSaturation(ctrl,name){
var feat=eval(PDS_Saturation);
ctrl.setRange(feat.Min.getValue(),feat.Max.getValue());
var px=new SliderProxy(ctrl);
px.AttachFeature(PDS_Saturation);
var f=eval(PDS_PrintBW);
var m=f.getValue();
if(m==true)
	{
ctrl.isEnabled=false;
		px.Init();
	}else{
ctrl.isEnabled=true;
px.Init();
px=new FeatureGrpProxy(ctrl,[{id:"rgb",path:PDS_RGBCorrection},{id:"bw",path:PDS_PrintBW}]);
px.ChangeHandler=enabRGBCorr;
px.Init();}}
function InitControl_pbSaturationXQ(ctrl,name){
if(hasPermission()){
var px=new ConstraintButtonContProxy(ctrl);
px.IsConstrained=pbSaturationXQ_IsConstrained;
px.GetContextId=pbSaturationXQ_GetContextId;
var ap=new VariablePathProxy();
ap.fKeyId=null;
ap.AttachFeature(PDS_PrintBW);
px.AttachComponent(ap,"blwh");
px.Init();}}
function pbSaturationXQ_IsConstrained(compId,compVal){
return((eval(PDS_PrintBW).getValue()==true));}
function pbSaturationXQ_GetContextId(compId,compVal){
return 9999;}
function InitControl_cbRGBCorrection(ctrl,name){
var px=new ListBoxProxy(ctrl);
px.AttachFeature(PDS_RGBCorrection);
px.Init();}
function InitControl_cbGrayCorrection(ctrl,name){
var px=new ListBoxProxy(ctrl);
	var f=eval(PDS_DrvType);
var m=f.getValue();
px.AttachFeature(PDS_GrayCorrection);	
if(m==64)
		ctrl.isEnabled=false;
px.Init();}
function InitControl_cbEnhanceFineLines(ctrl,name){
var px=new ListBoxProxy(ctrl);
px.AttachFeature(PDS_FineLines);
px.Init();}
function InitControl_rbDitherAutoSelect(ctrl,name){
var px=new OptionButtonProxy(ctrl);
px.onKey="AutoSelect";
px.AttachFeature(PDS_Dithering);
px.Init();
Init_DitherEnableState(ctrl);}
function InitControl_rbDitherSuperCell(ctrl,name){
var px=new OptionButtonProxy(ctrl);
px.onKey="SuperCell";
px.AttachFeature(PDS_Dithering);
px.Init();
Init_DitherEnableState(ctrl);}
function InitControl_rbDither6x6(ctrl,name){
var px=new OptionButtonProxy(ctrl);
px.onKey="Dither6x6";
px.AttachFeature(PDS_Dithering);
px.Init();
Init_DitherEnableState(ctrl);}
function InitControl_rbDither8x8(ctrl,name){
var px=new OptionButtonProxy(ctrl);
px.onKey="Dither8x8";
px.AttachFeature(PDS_Dithering);
px.Init();
Init_DitherEnableState(ctrl);}
function Init_DitherEnableState(ctrl){
var px=new FeatureGrpProxy(ctrl,[{id:"mode",path:PDS_GraphicMode}]);
px.ChangeHandler=enab_sDither;
px.Init();}
function enab_sDither(ctrl,grp,val){}
function InitControl_cbSmallFontEnhancer(ctrl,name){
var px=new ListBoxProxy(ctrl);
px.AttachFeature(PDS_PixelBoost);
px.Init();}
function InitControl_pbMQHelp(ctrl,name){
ctrl.AddEventHandler("onClick",MQHelp);}
function MQHelp(evt){
showHelp(evt,"Context",0);}
@END
@DocProps
function onLoad_dlgHold(frame){}
function InitControl_rbConfiden(ctrl,name){
var px=new OptionButtonProxy(ctrl);
px.onKey="Confidential";
px.offKey="Off";
px.AttachFeature(PDS_PrintHold);
px.Init();}
function InitControl_rbVerify(ctrl,name){
var px=new OptionButtonProxy(ctrl);
px.onKey="Verify";
px.offKey="Off";
px.AttachFeature(PDS_PrintHold);
px.Init();}
function InitControl_rbReserve(ctrl,name){
var px=new OptionButtonProxy(ctrl);
px.onKey="Reserve";
px.offKey="Off";
px.AttachFeature(PDS_PrintHold);
px.Init();}
function InitControl_rbRepeat(ctrl,name){
var px=new OptionButtonProxy(ctrl);
px.onKey="Repeat";
px.offKey="Off";
px.AttachFeature(PDS_PrintHold);
px.Init();}
function showNoHold(ctrl,grp,value){
ctrl.isVisible=value.hold.getValue()<1;}
function hookHoldShow(ctrl,hdlr){
var px=new FeatureGrpProxy(ctrl,[{id:"hold",path:PDS_PrintHold}]);
px.ChangeHandler=hdlr;
px.Init()}
function InitControl_sConf(ctrl,name){
hookHoldShow(ctrl,showNoHold);}
function InitControl_sVerify(ctrl,name){
hookHoldShow(ctrl,showNoHold);}
function InitControl_sReserve(ctrl,name){
hookHoldShow(ctrl,showNoHold);}
function InitControl_sRepeat(ctrl,name){
hookHoldShow(ctrl,showNoHold);}
function showConf(ctrl,grp,value){
ctrl.isVisible=value.hold.getValue()==1;}
function InitControl_ebHoldPin(ctrl,name){
ctrl.setTextLimit(eval(PDS_PrintHold_PIN_MaxLen).getValue());
var px=new EditBoxContProxy(ctrl);
var pRE=eval(PDS_PrintHold).Pin.PinRE;
if(pRE){
px.validateRE=new RegExp(pRE.getValue());
px.HandleInvalidValue=px.Numeric$HandleInvalidValue;
px.invalidMsgBox="mbBadPIN";
ctrl.label=getUiLabel("!sHoldPin");
px._OnValidate=px.OnValidate;
px.OnValidate=FilterValidatePIN;}
var ap=px.AttachFeature(PDS_PrintHold_PIN);
ap.fKeyId=null;
px.Init();
hookHoldShow(ctrl,showConf);}
function FilterValidatePIN(src){
var rc=1;
if(eval(PDS_PrintHold).getValue().getValue()==1)
rc=this._OnValidate(src);
return rc;}
function showAny(ctrl,grp,value){
ctrl.isVisible=value.hold.getValue()>0;}
function InitControl_ebHoldUser(ctrl,name){
ctrl.setTextLimit(eval(PDS_PrintHold_User_MaxLen).getValue());
var px=new EditBoxContProxy(ctrl);
var nRE=eval(PDS_PrintHold).UserName.NameRE;
if(nRE){
px.validateRE=new RegExp(nRE.getValue());
px.HandleInvalidValue=px.Numeric$HandleInvalidValue;
px.invalidMsgBox="mbInvalidEditVal";
ctrl.label=getUiLabel("!sHoldUser");}
var ap=px.AttachFeature(PDS_PrintHold_User);
ap.fKeyId=null;
px.Init();
HookValidationEvents(px,px.GetUiObjId(),ebHoldUser_FeatValidate,"feat");
hookHoldShow(ctrl,showAny);}
function ebHoldUser_FeatValidate(src){
var rc=1;
var f=eval(PDS_PrintHold);
var val=f.getValue().getValue();
if(val>0){
var mb="";
var usr=f.UserName.getValue();
var usrNoLT=stripLT(usr);
if(usrNoLT!=usr){
usr=usrNoLT;
var trans=new Transaction(src);
f.UserName.setValue(usr);
trans.evaluate();
trans.commit();}
if(usr.length<f.UserName.MinLen.getValue()){
mb="mbNoUser";}
if(mb.length>0){
rc=-1;
msgBox=getMessageBox(mb);
msgBox.addParm(getPrinterInfo(2));
msgBox.show(GetContainingFrame(src));
this.HostObj(this.GetUiObjId()).isFocus=true;}}
return rc;}
function InitControl_chkKDD(ctrl,name){
var px=new ButtonProxy(ctrl);
px.AttachFeature(PDS_KeepDups);
px.Init();
hookHoldShow(ctrl,showAny);}
function InitControl_pbHHelp(ctrl,name){
ctrl.AddEventHandler("onClick",HHelp);}
function HHelp(evt){
showHelp(evt,"Context",0);}
@END
@DocProps
function InitControl_chkStatAft(ctrl,name){
var px=new ButtonProxy(ctrl);
px.AttachFeature(PDS_ShowPrtrStatus);
px.Init();}
function InitControl_pbStatusNow(ctrl,name){
ctrl.AddEventHandler("onClick",showStatusNow);}
function showStatusNow(){
var f=eval(PDS_ShowPrtrStatus);
var stOn=f.getValue();
if(!stOn)
f.setValue(true);
statusWindow(2);
if(!stOn)
f.setValue(false);}
@END
@DocProps
function InitControl_pbFonts(ctrl,name){
ctrl.AddEventHandler("onClick", shoFonts);}
function shoFonts(){
showFrame("dlgFonts" );}
function InitControl_pbPCL(ctrl,name){
ctrl.AddEventHandler("onClick", shoPCL);}
function shoPCL(){
showFrame("dlgPCL" );}
function InitControl_rbDriver(ctrl,name){
var px=new OptionButtonProxy(ctrl);
px.onKey="OFF";
px.AttachFeature(PDS_PrinterLimit);
px.Init();}
function InitControl_rbPhysical(ctrl,name){
var px=new OptionButtonProxy(ctrl);
px.onKey="ON";
px.AttachFeature(PDS_PrinterLimit);
px.Init();}
function InitControl_pbMOHelp(ctrl,name){
ctrl.AddEventHandler("onClick",MOHelp);}
function MOHelp(evt){
showHelp(evt,"Context",0);}
@END
@DocProps
function InitControl_rbAsBitmaps(ctrl,name){
var px=new OptionButtonProxy(ctrl);
px.onKey="Bitmap";
px.AttachFeature(PDS_Font_TT_Download);
px.Init();}
function InitControl_rbAsOutlines(ctrl,name){
var px=new OptionButtonProxy(ctrl);
px.onKey="Outline";
px.AttachFeature(PDS_Font_TT_Download);
px.Init();}
function InitControl_rbPrintAsGraphics(ctrl,name){
var px=new OptionButtonProxy(ctrl);
px.onKey="Graphics";
px.AttachFeature(PDS_Font_TT_Download);
px.Init();}
function InitControl_rbAsGraphics(ctrl,name){
var px=new OptionButtonProxy(ctrl);
px.onKey="Graphics";
px.AttachFeature(PDS_Font_TT_Download);
px.Init();}
function InitControl_chkSubstitute(ctrl,name){
var px=new ButtonProxy(ctrl);
px.AttachFeature(PDS_Font_TT_SubPrinter);
px.Init();}
function InitControl_chkUsePrinter(ctrl,name){
var px=new ButtonProxy(ctrl);
px.AttachFeature(PDS_Font_TT_PrtrWidths);
px.Init();
px=new FeatureGrpProxy(ctrl,[{id:"sub",path:PDS_Font_TT_SubPrinter}]);
px.ChangeHandler=enabUsePrt;
px.Init();}
function enabUsePrt(ctrl,grp,val){
ctrl.isEnabled=val.sub;}
function InitControl_chkTellApp(ctrl,name){
var px=new ButtonProxy(ctrl);
px.AttachFeature(PDS_Font_PF_TellApp);
px.Init();}
function hookEnabCharSets(ctrl){
var px=new FeatureGrpProxy(ctrl,[{id:"tell",path:PDS_Font_PF_TellApp}]);
px.ChangeHandler=enabCharSets;
px.Init();}
function enabCharSets(ctrl,grp,val){
ctrl.isEnabled=val.tell;}
function InitControl_sCharSets(ctrl){
hookEnabCharSets(ctrl);}
function InitControl_chkWestern(ctrl,name){
var px=new ButtonProxy(ctrl);
px.AttachFeature(PDS_Font_PF_W1);
px.Init();
hookEnabCharSets(ctrl);}
function InitControl_chkEuropean(ctrl,name){
var px=new ButtonProxy(ctrl);
px.AttachFeature(PDS_Font_PF_WE);
px.Init();
hookEnabCharSets(ctrl);}
function InitControl_chkCyrillic(ctrl,name){
var px=new ButtonProxy(ctrl);
px.AttachFeature(PDS_Font_PF_WR);
px.Init();
hookEnabCharSets(ctrl);}
function InitControl_chkGreek(ctrl,name){
var px=new ButtonProxy(ctrl);
px.AttachFeature(PDS_Font_PF_WG);
px.Init();
hookEnabCharSets(ctrl);}
function InitControl_chkTurkish(ctrl,name){
var px=new ButtonProxy(ctrl);
px.AttachFeature(PDS_Font_PF_WT);
px.Init();
hookEnabCharSets(ctrl);}
function InitControl_chkBaltic(ctrl,name){
var px=new ButtonProxy(ctrl);
px.AttachFeature(PDS_Font_PF_WL);
px.Init();
hookEnabCharSets(ctrl);}
function InitControl_pbFontsHelp(ctrl,name){
ctrl.AddEventHandler("onClick",FontsHelp);}
function FontsHelp(evt){
showHelp(evt,"Context",0);}
@END
@DocProps
function setActiveProfile(prof,src){
var proc=eval(PDS_LoadProfile);
var feat=eval(PDS_Profiles);
var trans=new Transaction(src);
proc.Profile.setValue(prof);
feat.setValue(prof);
proc.execute();
trans.evaluate();
InitPhantomFeatures(src);
trans.commit();}
function onLoad_dlgLoadDelCustomSettings(frame){
frame.AddEventHandler("onQueryTerminate",exitLoadDel);}
function exitLoadDel(frame,context,name){
if((context.data==1)
&&((context.result===undefined)||(context.result==0))){
var prof=eval(PDS_LoadDelProfItem).getValue();
if(prof!==undefined){
setActiveProfile(prof,frame);}}}
function InitControl_lbChooseCustomSettings(ctrl,name){
var px=new ListBoxProxy(ctrl);
px.textId="resId";
px.GetIconFromOptObj=lbPro_GetIcon;
px.InitItem=lbPro_InitItem;
px.CreateItemProxy=lbProOptions_NOP;
px.IsItemListed=lbProOptions_IsItemListed;
px.Init(PDS_LoadDelProfItem,
PDS_Profiles);}
function lbPro_GetIcon(collObj){
var icon;
if(collObj.ptype.getValue()=="admin"){
icon="admin";}
return icon;}
function lbPro_InitItem(uiItem,collObj){
var org=collObj.ptype.getValue();
if(org=="admin"){
uiItem.color=255;}else
if(org=="user"){
uiItem.color=16711680;}}
function lbProOptions_NOP(){
return undefined;}
function lbProOptions_IsItemListed(collObj){
var isListed=true;
var pType=collObj.ptype.getValue();
if((pType=="factory" ) ||
(pType=="installed" )){
isListed=false;}
return isListed;}
function InitControl_pbRemoveCustomSettings(ctrl,name){
var proxy=new ObjectProxy();
proxy.onUpdate=pbRemoveCustomSettings_onUpdate;
proxy.Attach(ctrl,"uiObj");
proxy.HookEvent("uiObj","onClick",cnfrmDelPro);
var fObj=eval(PDS_LoadDelProfItem);
if(fObj){
proxy.Attach(fObj,"feat");
proxy.HookEvent("feat","onChange",proxy.onUpdate);}
var fObj=eval(PDS_Profiles);
if(fObj){
proxy.Attach(fObj,"coll");
proxy.HookEvent("coll","onCollectionUpdate",proxy.onUpdate);}
var fObj=eval(PDS_Admin);
if(fObj){
proxy.Attach(fObj,"admin");}
proxy.onUpdate(null,null,null);}
function pbRemoveCustomSettings_onUpdate(src,context,name){
var isEnab=false;
var feat=this.HostObj("feat");
var coll=this.HostObj("coll");
var admin=this.HostObj("admin");
if(feat && coll && coll.count && admin){
var item=feat.getValue();
if(item){
var org=item.ptype.getValue();
if((org=="user") ||
((org=="admin")&&(admin.getValue()==true))){
isEnab=true;}}}
this.HostObj("uiObj").isEnabled=isEnab;}
function cnfrmDelPro(ctrl,context,name){
var mb=getMessageBox("mbCnfrmDelSet");
mb.addParm(getPrinterInfo(2));
var prof=eval(PDS_LoadDelProfItem).getValue();
mb.addParm(prof.resId.getValue());
var choice=mb.show(GetContainingFrame(ctrl));
if(choice=="Ok"){
var proc=eval(PDS_DelProfile);
var trans=new Transaction(ctrl);
proc.Profile.setValue(prof);
proc.execute();
trans.evaluate();
trans.commit();}}
function InitControl_pbLoadDelSettingsHelp(ctrl,name){
ctrl.AddEventHandler("onClick",LoadDelSettingsHelp);}
function LoadDelSettingsHelp(evt){
showHelp(evt,"Context",0);}
@END
@DocProps PrintProps
function onLoad_dlgConfigURL(frame){
frame.AddEventHandler("onQueryTerminate",exitConfigURL);}
function exitConfigURL(src,context,name){
if((context.data==1)
&&((context.result===undefined)||(context.result==0))){
var bUrl=eval(PDS_PrtrURL).getValue();
var web=newObject();
web.setConfigFile(bUrl);
web.destroy();}}
function InitControl_ebPrinterIP(ctrl,name){
ctrl.setTextLimit(255);
var px=new EditBoxContProxy(ctrl);
var ap=px.AttachFeature(PDS_WebIP);
ap.fKeyId=null;
px.Init();}
function InitControl_ebPrinterURL(ctrl,name){
ctrl.setTextLimit(255);
var web=newObject();
var u=web.getConfigFile(1);
web.destroy();
var f=eval(PDS_PrtrURL);
var trans=new Transaction(ctrl);
f.setValue(u);
trans.evaluate();
trans.commit();
var px=new EditBoxContProxy(ctrl);
var ap=px.AttachFeature(PDS_PrtrURL);
ap.fKeyId=null;
px.Init();}
function InitControl_pbBrowseURL(ctrl,name){
ctrl.AddEventHandler("onClick",getFile);}
function getFile(ctrl,context,x){
var web=newObject();
var pUrl=web.getConfigFile(2);
if(pUrl.length>0){
var f=eval(PDS_PrtrURL);
var trans=new Transaction(ctrl);
f.setValue(pUrl);
trans.evaluate();
trans.commit();}
web.destroy();}
function InitControl_pbConfigURLHelp(ctrl,name){
ctrl.AddEventHandler("onClick",ConfigURLHelp);}
function ConfigURLHelp(evt){
showHelp(evt,"Context",0);}
@END
@DocProps PrintProps
function onLoad_dlgWmark(frame,name){
frame.AddEventHandler("onTerminate", onTermdlgWmark);}
function onTermdlgWmark(src,context,name){
if((context.data==2)
&&((context.result===undefined)||(context.result==0))){
var trans=new Transaction(src);
var wmopt=eval(PDS_UpdWatermarkOpt);
wmopt.execute();
trans.evaluate();
trans.commit();}}
function InitControl_rbWmAll(ctrl,name){
var px=new OptionButtonProxy(ctrl);
px.onKey="AllPages";
px.offKey="None";
px.AttachFeature(PDS_Watermark);
px.Init();}
function InitControl_rbWmFirst(ctrl,name){
var px=new OptionButtonProxy(ctrl);
px.onKey="FirstOther";
px.offKey="None";
px.AttachFeature(PDS_Watermark);
px.Init();}
function InitControl_rbWmOddEvn(ctrl,name){
var px=new OptionButtonProxy(ctrl);
px.onKey="OddEven";
px.offKey="None";
px.AttachFeature(PDS_Watermark);
px.Init();}
function enab_watermark(uiObj,values){
if((values.fx)&&(values.FaxPopup)){
	uiObj.isEnabled=false;}}
function InitControl_sWmDesc(ctrl,name){
var px=new FeatureGrpProxy(ctrl,[{id:"wm",path:PDS_Watermark}]);
px.ChangeHandler=showNone;
px.Init()}
function InitControl_sWmSel(ctrl,name){
hookWm1(ctrl);}
function showNone(ctrl,grp,value){
ctrl.isVisible=value.wm.nameId.getValue()=="None";}
function showWm1(ctrl,grp,value){
ctrl.isVisible=value.wm.nameId.getValue()!="None";}
function hookWm1(ctrl){
var px=new FeatureGrpProxy(ctrl,[{id:"wm",path:PDS_Watermark}]);
px.ChangeHandler=showWm1;
px.Init()}
function showWm1(ctrl,grp,value){
ctrl.isVisible=value.wm.nameId.getValue()!="None";}
function hookWm2(ctrl){
var px=new FeatureGrpProxy(ctrl,[{id:"wm",path:PDS_Watermark}]);
px.ChangeHandler=showWm2;
px.Init()}
function showWm2(ctrl,grp,value){
var wm=value.wm.nameId.getValue();
ctrl.isVisible=wm!="None" && wm!="AllPages";}
function InitControl_sWm1(ctrl,name){
var px=new FeatureGrpProxy(ctrl,[{id:"wm",path:PDS_Watermark}]);
px.ChangeHandler=showWm1Hdg;
px.Init()}
function showWm1Hdg(ctrl,grp,value){
var wm=value.wm.nameId.getValue();
if(wm=="None" )
ctrl.isVisible=false;else{
var lbl="!allPages";
if(wm=="FirstOther" )
lbl="!firstPage";else
if(wm=="OddEven" )
lbl="!oddPages";
ctrl.setLabel(lbl);
ctrl.isVisible=true;}}
function InitControl_lbWm1(ctrl,name){
init_lbWm(ctrl,name, PDS_Watermark1);
hookWm1(ctrl);}
function InitControl_sWm2(ctrl,name){
var px=new FeatureGrpProxy(ctrl,[{id:"wm",path:PDS_Watermark}]);
px.ChangeHandler=showWm2Hdg;
px.Init()}
function showWm2Hdg(ctrl,grp,value){
var wm=value.wm.nameId.getValue();
if(wm=="None" || wm=="AllPages" )
ctrl.isVisible=false;else{
var lbl="!otherPages";
if(wm=="OddEven" )
lbl="!evenPages";
ctrl.setLabel(lbl);
ctrl.isVisible=true;}}
function InitControl_lbWm2(ctrl,name){
init_lbWm(ctrl,name, PDS_Watermark2);
hookWm2(ctrl);}
function init_lbWm(ctrl,name, fPath){
var px=new ListBoxProxy(ctrl);
px.textId="wmId";
px.GetIconFromOptObj=lbWm_GetIconFromOptObj;
px.InitItem=lbWm_InitItem;
px.AttachFeature(fPath);
px.Init();}
function InitControl_pbWmNew(ctrl,name){
ctrl.AddEventHandler("onClick", showNewWmark);
hookWm1(ctrl);}
function showNewWmark(src,context,name){
var ewm=eval(PDS_EditWatermark);
var trans=new Transaction();
ewm.setValue(eval(PDS_AddWatermark));
trans.evaluate();
trans.commit();
showFrame("dlgEWmark");}
function InitControl_pbWmEdit(ctrl,name){
init_pbWm_New(ctrl,name);
hookWm1(ctrl);}
function hookWmEdRmvEnab(ctrl){
var px=new ContainerProxy(ctrl);
var ap=new VariablePathProxy();
ap.fKeyId="orgin";
ap.AttachFeature(PDS_Watermark1);
px.AttachComponent(ap,"org");
var ap=new VariablePathProxy();
ap.fKeyId=null;
ap.AttachFeature(PDS_Admin);
px.AttachComponent(ap,"admin");
px.SetUiVal=pbWmEdRmvEnab;
px.Init();}
function init_pbWm_New(ctrl,name){
ctrl.AddEventHandler("onClick", showEditWmark);
hookWmEdRmvEnab(ctrl);}
function lbWm_GetIconFromOptObj(collObj){
var icon;
var org=collObj.orgin.getValue();
if(org=="admin"){
icon="admin";}
return icon;}
function lbWm_InitItem(uiItem,collObj){
var orgin=collObj.orgin.getValue();
if(orgin=="admin"){
uiItem.color=255;
}else
if(orgin=="user"){
uiItem.color=16711680;}}
function showEditWmark(src,context,name){
var ewm=eval(PDS_EditWatermark);
var sel=eval(PDS_Watermark1+".getValue()");
var trans=new Transaction();
ewm.setValue(sel);
trans.evaluate();
trans.commit();
showFrame("dlgEWmark");}
function InitControl_pbWmRemove(ctrl,name){
hookWmEdRmvEnab(ctrl);
hookWm1(ctrl);
ctrl.AddEventHandler("onClick",onpbWmRemove);}
function onpbWmRemove(src,context,name){
var wm=eval(PDS_Watermark1+".getValue()");
rmvWMark(wm,src);}
function rmvWMark(wm,ctrl){
var mb=getMessageBox("mbWmCnfrmDel");
mb.addParm(getPrinterInfo(2));
mb.addParm(wm.wmId.getValue());
if(mb.show(GetContainingFrame(ctrl))=="Ok" ){
var rwm=eval(PDS_RemoveWatermark);
var trans=new Transaction(ctrl);
rwm.Watermark.setValue(wm);
rwm.execute();
trans.evaluate();
trans.commit();}}
function pbWmEdRmvEnab(uiObj,values){
var isEnabled=true;
if(values.org=="builtin" ||(values.org=="admin" && !values.admin)){
isEnabled=false;}
uiObj.isEnabled=isEnabled;}
function InitControl_sWmPlace(ctrl,name){
hookWm1(ctrl);}
function InitControl_rbWmUnder(ctrl,name){
init_rbWm_Under(ctrl,name);
hookWm1(ctrl);}
function init_rbWm_Under(ctrl,name){
var px=new OptionButtonProxy(ctrl);
px.onKey="under";
px.AttachFeature(PDS_Watermark_Placement);
px.Init();}
function InitControl_rbAWmOver(ctrl,name){
init_rbWm_Over(ctrl,name);
hookWm1(ctrl);}
function InitControl_rbWmOver(ctrl,name){
init_rbWm_Over(ctrl,name);
hookWm1(ctrl);}
function init_rbWm_Over(ctrl,name){
var px=new OptionButtonProxy(ctrl);
px.onKey="over";
px.AttachFeature(PDS_Watermark_Placement);
px.Init();}
function InitControl_pbmWm1(ctrl,name){
init_pbmWm(ctrl,name, PDS_Watermark1);
hookWm1(ctrl);}
function InitControl_pbmWm2(ctrl,name){
init_pbmWm(ctrl,name, PDS_Watermark2);
hookWm2(ctrl);}
function init_pbmWm(ctrl,name,fPath){
var px=new SelectItemAttrProxy(ctrl);
px.SetAttr=SetPictureWatermarkLabel;
px.AttachFeature(fPath);
var px=new ContainerProxy(ctrl);
var ap=new VariablePathProxy();
ap.fKeyId=null;
ap.AttachFeature([fPath,"resId"]);
px.AttachComponent(ap,"val");
var ap=new VariablePathProxy();
ap.fKeyId=null;
ap.AttachFeature([fPath,"Dynamic"]);
px.AttachComponent(ap,"dyna");
var ap=new VariablePathProxy();
ap.fKeyId=null;
ap.fKeyPath="DynamicVariables";
ap.AttachFeature(fPath);
px.AttachComponent(ap,"coll");
px.SetUiVal=SetPictureWatermarkLabel;
px.Init();
var px=new SelectItemAttrProxy(ctrl);
px.SetAttr=SetPictureWatermarkAngle;
px.attrId="Angle";
px.AttachFeature(fPath);
var px=new FeatureGrpProxy(ctrl,[{id:"size",path:PDS_PaperSize}]);
px.ChangeHandler=pbm_PaperSize_ChangeHandler;
px.Init();
var px=new ContainerProxy(ctrl);
var ap=px.AttachFeature([fPath,"X"]);
ap.fKeyId=null;
px.SetUiVal=pbm_SetWmPosX;
px.Init();
var px=new ContainerProxy(ctrl);
var ap=px.AttachFeature([fPath,"Y"]);
ap.fKeyId=null;
px.SetUiVal=pbm_SetWmPosY;
px.Init();
var px=new ContainerProxy(ctrl);
var ap=px.AttachFeature([fPath,"Font.Size"]);
ap.fKeyId=null;
px.SetUiVal=pbm_SetWmPtSize;
px.Init();
var px=new ContainerProxy(ctrl);
var ap=px.AttachFeature([fPath,"Font"]);
ap.fKeyId="resId";
px.SetUiVal=pbm_SetWmFaceName;
px.Init();
var px=new ContainerProxy(ctrl);
var ap=px.AttachFeature([fPath,"Color"]);
ap.fKeyId="COLORREF";
px.SetUiVal=pbm_SetWmColor;
px.Init();
var px=new ContainerProxy(ctrl);
var ap=px.AttachFeature([fPath,"Intensity"]);
ap.fKeyId=null;
px.SetUiVal=pbm_SetWmIntensity;
px.Init();
var px=new ContainerProxy(ctrl);
var ap=px.AttachFeature([fPath,"Font.Underline"]);
ap.fKeyId=null;
px.SetUiVal=pbm_SetWmUnderline;
px.Init();
var px=new ContainerProxy(ctrl);
var ap=px.AttachFeature([fPath,"Font.Bold"]);
ap.fKeyId=null;
px.SetUiVal=pbm_SetWmBold;
px.Init();
var px=new ContainerProxy(ctrl);
var ap=px.AttachFeature([fPath,"Font.Italic"]);
ap.fKeyId=null;
px.SetUiVal=pbm_SetWmItalic;
px.Init();
var px=new ContainerProxy(ctrl);
var ap=px.AttachFeature([fPath,"Font.Outline"]);
ap.fKeyId=null;
px.SetUiVal=pbm_SetWmOutline;
px.Init();
var px=new ContainerProxy(ctrl);
var ap=px.AttachFeature([fPath,"Font.Strikeout"]);
ap.fKeyId=null;
px.SetUiVal=pbm_SetWmStrikeout;
px.Init();
var px=new ContainerProxy(ctrl);
var ap=px.AttachFeature([fPath,"X.Reference"]);
ap.fKeyId=null;
px.SetUiVal=pbm_SetWmXReference;
px.Init();
var px=new ContainerProxy(ctrl);
var ap=px.AttachFeature([fPath,"Y.Reference"]);
ap.fKeyId=null;
px.SetUiVal=pbm_SetWmYReference;
px.Init();}
function pbm_SetWmPosX(uiObj,values){
uiObj.setWatermark(2,values.val);}
function pbm_SetWmPosY(uiObj,values){
uiObj.setWatermark(3,values.val);}
function pbm_SetWmPtSize(uiObj,values){
uiObj.setWatermarkFont(2, values.val);}
function pbm_SetWmFaceName(uiObj,values){
uiObj.setWatermarkFont(1, values.val);}
function pbm_SetWmColor(uiObj,values){
uiObj.setWatermarkFont(20, values.val);}
function pbm_SetWmIntensity(uiObj,values){
uiObj.setWatermarkFont(21, values.val);}
function pbm_SetWmUnderline(uiObj,values){
var val=values.val.nameId.getValue();
uiObj.setWatermarkFont(10,(val=="on"));}
function pbm_SetWmBold(uiObj,values){
var val=values.val.nameId.getValue();
uiObj.setWatermarkFont(11,(val=="on"));}
function pbm_SetWmItalic(uiObj,values){
var val=values.val.nameId.getValue();
uiObj.setWatermarkFont(12,(val=="on"));}
function pbm_SetWmOutline(uiObj,values){
var val=values.val.nameId.getValue();
uiObj.setWatermarkFont(13,(val=="on"));}
function pbm_SetWmStrikeout(uiObj,values){
var val=values.val.nameId.getValue();
uiObj.setWatermarkFont(14,(val=="on"));}
function pbm_SetWmXReference(uiObj,values){
var val=values.val.nameId.getValue();
var uiVal;
switch(val){
case "left":
uiVal=0;
break;
case "right":
uiVal=2;
break;
default:
uiVal=1;
break;}
uiObj.setPosition(0,uiVal);}
function pbm_SetWmYReference(uiObj,values){
var val=values.val.nameId.getValue();
var uiVal;
switch(val){
case "top":
uiVal=0;
break;
case "bottom":
uiVal=2;
break;
default:
uiVal=1;
break;}
uiObj.setPosition(1,uiVal);}
function SetPictureWatermarkPosX(uiObj,value){
uiObj.setWatermark(2,value);}
function SetPictureWatermarkPosY(uiObj,value){
uiObj.setWatermark(3,value);}
function pbm_PaperSize_ChangeHandler(ctrl,featureGrp,values){
var xPhy=values["size"].xPhy.getValue();
var yPhy=values["size"].yPhy.getValue();
ctrl.setPaper(1, xPhy, yPhy);}
function InitControl_pbWmHelp(ctrl,name){
ctrl.AddEventHandler("onClick",WmHelp);}
function WmHelp(evt){
showHelp(evt,"Context",0);}
@END
@DocProps PrintProps
function onLoad_dlgEWmark(frame,name){
var orgName="";
var ewm=eval(PDS_EditWatermark).getValue();
var sel=eval(PDS_AddWatermark);
var trans=new Transaction(frame);
if(ewm==sel){
sel.wmId.setValue("");
sel.resId.setValue("");
sel.Angle.setValue(0);
sel.Units.setValue(eval(PDS_Templates+".Watermark.Units.Default").getValue());
sel.X.setValue(0);
sel.Y.setValue(0);
sel.X.Reference.setValue(eval(PDS_Templates+".Watermark.X.Reference.Default").getValue());
sel.Y.Reference.setValue(eval(PDS_Templates+".Watermark.Y.Reference.Default").getValue());
sel.Font.setValue(eval(PDS_AddWatermark+".DefFont").getValue());			
sel.Font.Size.setValue(72);
sel.Dynamic.setValue(eval(PDS_Templates+".Watermark.Dynamic.Default").getValue());
sel.Color.setValue(eval(PDS_Templates+".Watermark.Color.Default").getValue());
sel.Intensity.setValue(50);
sel.Font.Bold.setValue(eval(PDS_Templates+".WatermarkFont.Bold.Default").getValue());
sel.Font.Italic.setValue(eval(PDS_Templates+".WatermarkFont.Italic.Default").getValue());
sel.Font.Underline.setValue(eval(PDS_Templates+".WatermarkFont.Underline.Default").getValue());
sel.Font.Outline.setValue(eval(PDS_Templates+".WatermarkFont.Outline.Default").getValue());
sel.Font.Strikeout.setValue(eval(PDS_Templates+".WatermarkFont.Strikeout.Default").getValue());
frame.AddEventHandler("onQueryTerminate", onTermNewWmark);}else{
var orgName=ewm.wmId.getValue();}
eval(PDS_Phantom+".WmEditName").setValue(orgName);
trans.evaluate();
trans.commit();}
function onTermNewWmark(src,context,name){
if((context.data==1)
&&((context.result===undefined)||(context.result==0))){
var fn=eval(PDS_AddWatermark);
var trans=new Transaction(src);
fn.execute();
trans.evaluate();
trans.commit();}}
function InitControl_ebEWmName(ctrl,name){
var wmDfn=eval(PDS_Watermark);
ctrl.setTextLimit(wmDfn.MaxNameLen.getValue());
var px=new EditBoxContProxy(ctrl);
var nRE=wmDfn.NameRE;
if(nRE){
px.validateRE=new RegExp(nRE.getValue());
px.HandleInvalidValue=px.Numeric$HandleInvalidValue;
px.invalidMsgBox="mbInvalidEditVal";
ctrl.label=getUiLabel("!sEWmName");}
var ap=px.AttachFeature(PDS_Phantom+".WmEditName");
ap.fKeyId=null;
px.Init();
HookValidationEvents(px,px.GetUiObjId(),ebEWmName_FeatValidate,"feat");}
function ebEWmName_FeatValidate(src){
var rc=1;
var err;
var wm=eval(PDS_EditWatermark).getValue();
var wmDfn=eval(PDS_Watermark);
var name=deblank(eval(PDS_Phantom+".WmEditName").getValue());
if(name.length<wmDfn.MinNameLen.getValue()){
err={msg:"mbNoWmName"};}else{
var orgName=wm.wmId.getValue();
if(name!=orgName){
var fn=eval(PDS_ChkWmarkName);
var trans=new Transaction(src);
fn.wmId.setValue(name);
fn.Watermark.setValue(wm);
var rc=fn.execute();
trans.evaluate();
trans.commit();
if(rc){
err={msg:"mbNameExists",parm2:name};}}}
if(!err){
var trans=new Transaction(src);
wm.wmId.setValue(name);
trans.evaluate();
trans.commit();
}else{
var mb=getMessageBox(err.msg);
mb.addParm(getPrinterInfo(2));
if(err.parm2)
mb.addParm(err.parm2);
mb.show(GetContainingFrame(src));
this.HostObj(this.GetUiObjId()).isFocus=true;
rc=-1;}
return rc;}
function InitControl_ebEWmText(ctrl,name){
ctrl.setTextLimit(eval(PDS_Watermark).MaxValLen.getValue());
var px=new EditBoxContProxy(ctrl);
var ap=new VariablePathProxy();
ap.fKeyId=null;
ap.AttachFeature([PDS_EditWatermark,"resId"]);
px.AttachComponent(ap,"val");
var vRE=eval(PDS_Watermark).ValueRE;
if(vRE){
px.validateRE=new RegExp(vRE.getValue());
px.HandleInvalidValue=px.Numeric$HandleInvalidValue;
px.invalidMsgBox="mbInvalidEditVal";
ctrl.label=getUiLabel("!sEWmTxt");}
px.Init();
HookValidationEvents(px,px.GetUiObjId(),ebEWmText_FeatValidate,"feat");}
function ebEWmText_FeatValidate(src){
var rc=1;
var wm=eval(PDS_EditWatermark).getValue();
var wmDfn=eval(PDS_Watermark);
var rawTxt=wm.resId.getValue();
var txt=stripLT(rawTxt);
if(rawTxt!=txt){
var trans=new Transaction(src);
wm.resId.setValue(txt);
trans.evaluate();
trans.commit();}
if(txt.length<wmDfn.MinValLen.getValue()){
var mb=getMessageBox("mbNoWmText");
mb.addParm(getPrinterInfo(2));
mb.show(GetContainingFrame(src));
this.HostObj(this.GetUiObjId()).isFocus=true;
rc=-1;}
var ewm=eval(PDS_EditWatermark).getValue();
var sel=eval(PDS_AddWatermark);
if(ewm!=sel){
	var wm1=eval(PDS_Watermark1);
	var trans	=new Transaction(src);
	wm1.setValue(wm);
	trans.evaluate();
	trans.commit();}
return rc;}
function InitControl_cbEWmFont(ctrl,name){
var px=new ListBoxProxy(ctrl);
px.AttachFeature([PDS_EditWatermark,"Font"]);
px.Init();}
function InitControl_ebEWmSize(ctrl,name){
var feat=eval(PDS_EditWatermark+".getValue().Font.Size");
var min=feat.Min.getValue();
var max=feat.Max.getValue();
ctrl.setValueTable(min+"."+max);
var px=new EditBoxContProxy(ctrl);
px.HandleInvalidValue=px.Numeric$HandleInvalidValue;
px.invalidMsgBox="mbInvalidEditVal";
ctrl.label=getUiLabel("!sEWmSize");
px.isNumeric=true;
var ap=px.AttachFeature([PDS_EditWatermark,"Font.Size"]);
ap.fKeyId=null;
px.Init();}
function InitControl_pbEWmMoreFont(ctrl,name){
ctrl.AddEventHandler("onClick", showEditWmarkMoreFont);}
function showEditWmarkMoreFont(src,context,name){
showFrame("dlgEWmMoreFont" );}
function InitControl_chkDynaWmark(ctrl,name){
var px=new OptionButtonProxy(ctrl);
px.onKey="on";
px.offKey="off";
px.AttachFeature([PDS_EditWatermark,"Dynamic"]);
px.Init();}
function InitControl_pbDynaWatermark(ctrl,name){
ctrl.AddEventHandler("onClick", showDynaWmark);
var px=new ContainerProxy(ctrl);
var ap=new VariablePathProxy();
ap.fKeyId=null;
ap.AttachFeature([PDS_EditWatermark,"Dynamic"]);
px.AttachComponent(ap,"dyna");
px.SetUiVal=enab_pbDynaWatermark;
px.Init();}
function enab_pbDynaWatermark(uiObj,values){
var isEnabled=false;
if((values.dyna)&&(values.dyna.name=="on")){
isEnabled=true;}
uiObj.isEnabled=isEnabled;}
function showDynaWmark(src,context,name){
showFrame("dlgDynaWmark" );}
function InitControl_cbHorizPos(ctrl,name){
var px=new ListBoxProxy(ctrl);
px.AttachFeature([PDS_EditWatermark,"X.Reference"]);
px.Init();}
function InitControl_cbVertPos(ctrl,name){
var px=new ListBoxProxy(ctrl);
px.AttachFeature([PDS_EditWatermark,"Y.Reference"]);
px.Init();}
function init_ebEWmPos(ctrl,name, label, coord){
var px=new VariablePathProxy(ctrl);
px.SetUiVal=ebEWmPos_SetRange;
px.AttachFeature([PDS_EditWatermark,"Units"]);
px.Init();
var px=new EditBoxContProxy(ctrl);
px.HandleInvalidValue=px.Numeric$HandleInvalidValue;
px.invalidMsgBox="mbInvalidEditVal";
ctrl.label=getUiLabel(label);
px.isNumeric=true;
var ap=new VariablePathProxy();
ap.fKeyId=null;
ap.AttachFeature([PDS_EditWatermark,coord]);
px.AttachComponent(ap,"pos");
var ap=new VariablePathProxy();
ap.AttachFeature([PDS_EditWatermark,"Units"]);
px.AttachComponent(ap,"units");
var ap=new VariablePathProxy();
ap.fKeyId=null;
ap.AttachFeature(PDS_MasterUnits);
px.AttachComponent(ap,"mUnits");
px.Convert=ebEWm_Convert;
px.Init();}
function ebEWmPos_SetRange(uiObj,units){
if(units=="inch"){
uiObj.setValueTable("-90.90.10");
}else{
uiObj.setValueTable("-229.229");}}
function InitControl_ebEWmX(ctrl,name){
init_ebEWmPos(ctrl,name, "!sEWmX", "X");}
function InitControl_ebEWmY(ctrl,name){
init_ebEWmPos(ctrl,name, "!sEWmY", "Y");}
function ebEWm_Convert(direction,inVal){
var outVal;
if(direction=="c2f"){
var unitsPerInch=this.GetComponent("mUnits").GetCompValue();
var units=this.GetComponent("units").GetCompValue();
if(units=="inch"){
outVal=inVal*unitsPerInch/1.0;
}else{
outVal=inVal*unitsPerInch/25.4;}
outVal={pos : Math.round(outVal)};
}else{
if(inVal!==undefined){
if(inVal.units=="inch"){
outVal=inVal.pos*10/inVal.mUnits;
outVal=Math.round(outVal)/10;
}else{
outVal=inVal.pos*254/inVal.mUnits;
outVal=Math.round(outVal/10);}}}
return outVal;}
function init_sbWmPos(ctrl,name, coord){
var pageSize=10;
ctrl.setRange(0-50,50+pageSize-1,pageSize);
var bp=new ScrollContProxy(ctrl);
var ap=new VariablePathProxy();
ap.fKeyId=null;
ap.AttachFeature([PDS_EditWatermark,coord]);
bp.AttachComponent(ap,"val");
var ap=new VariablePathProxy();
ap.fKeyId=null;
ap.AttachFeature(PDS_MasterUnits);
bp.AttachComponent(ap,"mUnits");
bp.Convert=sbWmPos_Convert;
bp.Init();}
function sbWmPos_Convert(direction,inVal){
var outVal;
if(direction=="c2f"){
if(inVal!==undefined){
var unitsPerInch=this.GetComponent("mUnits").GetCompValue();
var size=18 * unitsPerInch;
outVal={val : size*inVal/100};}
}else{
if(inVal!==undefined){
var size=18 * inVal.mUnits;
outVal=inVal.val*100/size;}}
return outVal;}
function InitControl_sbWmVPos(ctrl,name){
init_sbWmPos(ctrl,name, "Y");}
function InitControl_sbWmHPos(ctrl,name){
init_sbWmPos(ctrl,name, "X");}
function InitControl_rbEWmInch(ctrl,name){
var px=new OptionButtonProxy(ctrl);
px.onKey="inch";
px.AttachFeature([PDS_EditWatermark,"Units"]);
px.Init();}
function InitControl_rbEWmMm(ctrl,name){
var px=new OptionButtonProxy(ctrl);
px.onKey="metric";
px.AttachFeature([PDS_EditWatermark,"Units"]);
px.Init();}
function InitControl_ebEWmAngle(ctrl,name){
ctrl.setValueTable("0.359");
var px=new EditBoxContProxy(ctrl);
px.HandleInvalidValue=px.Numeric$HandleInvalidValue;
px.invalidMsgBox="mbInvalidEditVal";
ctrl.label=getUiLabel("!sEWmAngl");
px.isNumeric=true;
var ap=px.AttachFeature([PDS_EditWatermark,"Angle"]);
ap.fKeyId=null;
px.Init();}
function InitControl_pbmEWmMove(ctrl,name){
var px=new SelectItemAttrProxy(ctrl);
px.SetAttr=SetPictureWatermarkLabel;
px.AttachFeature(PDS_EditWatermark);
var px=new ContainerProxy(ctrl);
var ap=new VariablePathProxy();
ap.fKeyId=null;
ap.AttachFeature([PDS_EditWatermark,"resId"]);
px.AttachComponent(ap,"val");
var ap=new VariablePathProxy();
ap.fKeyId=null;
ap.AttachFeature([PDS_EditWatermark,"Dynamic"]);
px.AttachComponent(ap,"dyna");
var ap=new VariablePathProxy();
ap.fKeyId=null;
ap.fKeyPath="DynamicVariables";
ap.AttachFeature(PDS_EditWatermark);
px.AttachComponent(ap,"coll");
px.SetUiVal=SetPictureWatermarkLabel;
px.Init();
var px=new SelectItemAttrProxy(ctrl);
px.SetAttr=SetPictureWatermarkAngle;
px.attrId="Angle";
px.AttachFeature(PDS_EditWatermark);
var px=new FeatureGrpProxy(ctrl,[{id:"size",path:PDS_PaperSize}]);
px.ChangeHandler=pbm_PaperSize_ChangeHandler;
px.Init();
var px=new SelectItemAttrProxy(ctrl);
px.SetAttr=SetPictureWatermarkPosX;
px.attrId="X";
px.AttachFeature(PDS_EditWatermark);
var px=new SelectItemAttrProxy(ctrl);
px.SetAttr=SetPictureWatermarkPosY;
px.attrId="Y";
px.AttachFeature(PDS_EditWatermark);
var px=new ContainerProxy(ctrl);
var ap=px.AttachFeature([PDS_EditWatermark,"Font.Size"]);
ap.fKeyId=null;
px.SetUiVal=pbm_SetWmPtSize;
px.Init();
var px=new ContainerProxy(ctrl);
var ap=px.AttachFeature([PDS_EditWatermark,"Font"]);
ap.fKeyId="resId";
px.SetUiVal=pbm_SetWmFaceName;
px.Init();
var px=new ContainerProxy(ctrl);
var ap=px.AttachFeature([PDS_EditWatermark,"Color"]);
ap.fKeyId="COLORREF";
px.SetUiVal=pbm_SetWmColor;
px.Init();
var px=new ContainerProxy(ctrl);
var ap=px.AttachFeature([PDS_EditWatermark,"Intensity"]);
ap.fKeyId=null;
px.SetUiVal=pbm_SetWmIntensity;
px.Init();
var px=new ContainerProxy(ctrl);
var ap=px.AttachFeature([PDS_EditWatermark,"Font.Underline"]);
ap.fKeyId=null;
px.SetUiVal=pbm_SetWmUnderline;
px.Init();
var px=new ContainerProxy(ctrl);
var ap=px.AttachFeature([PDS_EditWatermark,"Font.Bold"]);
ap.fKeyId=null;
px.SetUiVal=pbm_SetWmBold;
px.Init();
var px=new ContainerProxy(ctrl);
var ap=px.AttachFeature([PDS_EditWatermark,"Font.Italic"]);
ap.fKeyId=null;
px.SetUiVal=pbm_SetWmItalic;
px.Init();
var px=new ContainerProxy(ctrl);
var ap=px.AttachFeature([PDS_EditWatermark,"Font.Outline"]);
ap.fKeyId=null;
px.SetUiVal=pbm_SetWmOutline;
px.Init();
var px=new ContainerProxy(ctrl);
var ap=px.AttachFeature([PDS_EditWatermark,"Font.Strikeout"]);
ap.fKeyId=null;
px.SetUiVal=pbm_SetWmStrikeout;
px.Init();
var px=new ContainerProxy(ctrl);
var ap=px.AttachFeature([PDS_EditWatermark,"X.Reference"]);
ap.fKeyId=null;
px.SetUiVal=pbm_SetWmXReference;
px.Init();
var px=new ContainerProxy(ctrl);
var ap=px.AttachFeature([PDS_EditWatermark,"Y.Reference"]);
ap.fKeyId=null;
px.SetUiVal=pbm_SetWmYReference;
px.Init();}
function InitControl_pbEWmHelp(ctrl,name){
ctrl.AddEventHandler("onClick",eWmHelp);}
function eWmHelp(evt){
showHelp(evt,"Context",0);}
@END
@DocProps PrintProps
function onLoad_dlgEWmMoreFont(frame,name){
var orgName="";
var ewm=eval(PDS_EditWatermark).getValue();
var sel=eval(PDS_AddWatermark);
var trans=new Transaction(frame);
if(ewm==sel){
	sel.Font.Underline.setValue(eval(PDS_Templates+".WatermarkFont.Underline.off"));
	sel.Font.Bold.setValue(eval(PDS_Templates+".WatermarkFont.Bold.off"));
	sel.Font.Italic.setValue(eval(PDS_Templates+".WatermarkFont.Italic.off"));	
	sel.Font.Outline.setValue(eval(PDS_Templates+".WatermarkFont.Outline.off"));
	sel.Font.Strikeout.setValue(eval(PDS_Templates+".WatermarkFont.Strikeout.off"));
	sel.Color.setValue(eval(PDS_Templates+".Watermark.Color.Default").getValue());}
trans.evaluate();
trans.commit();}
function InitControl_cbEWmMfColor(ctrl,name){
var px=new ListBoxProxy(ctrl);
px.AttachFeature([PDS_EditWatermark,"Color"]);
px.Init();}
function InitControl_cbEWmMfScript(ctrl,name){
var px=new ListBoxProxy(ctrl);
px.AttachFeature([PDS_EditWatermark,"Font.CharSet"],
[PDS_EditWatermark,"Font","CharSet"]);
px.Init();}
function InitControl_ebEWmMfIntensity(ctrl,name){
var feat=eval(PDS_EditWatermark+".getValue().Intensity");
var min=feat.Min.getValue();
var max=feat.Max.getValue();
ctrl.setValueTable("10,20,30,40,50,60,70,80,90,100");
var px=new EditBoxContProxy(ctrl);
px.HandleInvalidValue=px.Numeric$HandleInvalidValue;
px.invalidMsgBox="mbInvalidEditVal";
ctrl.label=getUiLabel("!sEWmMfIntensity");
px.isNumeric=true;
var ap=px.AttachFeature([PDS_EditWatermark,"Intensity"]);
ap.fKeyId=null;
px.Init();}
function InitControl_chkEWmMfUnderline(ctrl,name){
var px=new OptionButtonProxy(ctrl);
px.onKey="on";
px.offKey="off";
px.AttachFeature([PDS_EditWatermark,"Font.Underline"],
[PDS_EditWatermark,"Font","Underline"]);
px.Init();}
function InitControl_chkEWmMfBold(ctrl,name){
var px=new OptionButtonProxy(ctrl);
px.onKey="on";
px.offKey="off";
px.AttachFeature([PDS_EditWatermark,"Font.Bold"],
[PDS_EditWatermark,"Font","Bold"]);
px.Init();}
function InitControl_chkEWmMfItalic(ctrl,name){
var px=new OptionButtonProxy(ctrl);
px.onKey="on";
px.offKey="off";
px.AttachFeature([PDS_EditWatermark,"Font.Italic"],
[PDS_EditWatermark,"Font","Italic"]);
px.Init();}
function InitControl_chkEWmMfOutline(ctrl,name){
var px=new OptionButtonProxy(ctrl);
px.onKey="on";
px.offKey="off";
px.AttachFeature([PDS_EditWatermark,"Font.Outline"],
[PDS_EditWatermark,"Font","Outline"]);
px.Init();}
function InitControl_chkEWmMfStrikeout(ctrl,name){
var px=new OptionButtonProxy(ctrl);
px.onKey="on";
px.offKey="off";
px.AttachFeature([PDS_EditWatermark,"Font.Strikeout"],
[PDS_EditWatermark,"Font","Strikeout"]);
px.Init();}
@END
@DocProps PrintProps
function InitControl_lbWmarkVars(ctrl,name){
var px=new ListBoxProxy(ctrl);
px.AttachFeature([PDS_EditWatermark,"DynamicVariables"]);
px.Init();}
function InitControl_pbWmDynaVarAdd(ctrl,name){
ctrl.AddEventHandler("onClick", addWmDynaVar);}
function addWmDynaVar(src,context,name){
var wm=eval(PDS_EditWatermark).getValue();
var itm=wm.DynamicVariables.getValue();
if(itm){
var label=itm.varLabel.getValue();
var feat=wm.resId;
var text=feat.getValue();
if(label==="%")
text+="%"+label;else
text+="%"+label+"%";
if(text.length<257){
var trans=new Transaction(src);
feat.setValue(text);
trans.evaluate();
trans.commit();}}}
@END
@DocProps PrintProps
function onLoad_dlgNoPrtIP(frame,name){
frame.RemoveEventHandler("onTerminate",OnTerminateFrame);
frame.AddEventHandler("onTerminate",OnTerm_dlgNoPrtIP);}
function OnTerm_dlgNoPrtIP(src,context,name){
if(src.trans){
src.trans.evaluate();
src.trans.commit();}}
function InitControl_pbConfigURL(ctrl,name){
ctrl.AddEventHandler("onClick",ShoConfigUrls);}
function InitControl_pbNoPrtIPHelp(ctrl,name){
ctrl.AddEventHandler("onClick",NoPrtIPHelp);}
function NoPrtIPHelp(evt){
showHelp(evt,"Context",0);}
@END
@DocProps PrintProps
var DEVICE_MEMORY=6
var DEVICE_IPADDRESS=7
var DEVICE_DUPLEX=8
var OPTION_FONTCART=1
var OPTION_FLASH=2
var OPTION_DISK=3
var OPTION_FAX=4
var ITEM_COUNT=0
var ITEM_INSTALLED=1
var ITEM_CAPACITY=2
var ITEM_AVAIL=3
var ITEM_PRINTERNAME=4
var ITEM_USERNAME=5
var ITEM_NPAID=6
var ITEM_FORMAT=7
var ITEM_FEEDTYPE=8
var ITEM_PAPERSIZE=9
var ITEM_PAPERTYPE=10
var ITEM_OUTPUTPOSITIONS=11
var ITEM_FACEUP=12
var ITEM_OUTPUTSEPARATION=13
var ITEM_SECURITY=14
var ITEM_BURSTING=15
var ITEM_COLLATION=16
var ITEM_FACEDOWN=17
var ITEM_STITCHING=18
var ITEM_BINDING=19
var ITEM_PUNCHING=20
var ITEM_ADDITIONFINISHING=21
var ITEM_PAPERSTANDARDINPUT=24
var isFaxInstalled=null ;
function updateUserNames(fPath,map,trans){
var feat=eval(fPath);
for(var en=new Enumerator(feat);
!en.atEnd();
en.moveNext()){
var item=en.item();
if(item.npaId!==undefined){
var npaId=item.npaId.getValue();
if((map!==undefined)&&(map[npaId]!==undefined)){
item.resId.setValue(map[npaId]);
}else{
if(item.resId.Default){
item.resId.setValue(item.resId.Default.getValue());}}}}}
function IsInstalledOptionsChanged(src){
var bidilist=new Array;
var err=-1;
var dataObject=npaObject();
if(dataObject){
err=dataObject.initBidiData();
if(err==0){
var io=eval(PDS_InstallableOptions);
var count=dataObject.getInputChars(0,ITEM_COUNT);
for(var idx=1; idx<=count; idx++){
var name=dataObject.getInputChars(idx, ITEM_PRINTERNAME);
var cap=dataObject.getInputChars(idx, ITEM_CAPACITY);
var optionId="" + name;
if(name!="MP Tray"){
optionId+="_"+ cap;}
if((name.substring(0,6)!=="Manual") &&
(name.substring(0,6)!=="Tray 1")){
bidilist[bidilist.length]=optionId;}}
var map=undefined;		
var count=dataObject.getOutputChars(0,ITEM_COUNT);
for(var idx=1; idx<=count; idx++){
var optionId=dataObject.getOutputChars(idx, ITEM_PRINTERNAME);
if((optionId!=="Standard Bin")&&
(optionId.indexOf("Loc2")==-1)&&
(optionId.indexOf("Loc3")==-1)&&
(optionId.indexOf("Loc4")==-1)&&
(optionId.indexOf("Loc5")==-1)){
bidilist[bidilist.length]=optionId;}}
if(dataObject.getOptionChars(OPTION_FLASH,ITEM_INSTALLED)){
bidilist[bidilist.length]="Flash";}
if(dataObject.getOptionChars(OPTION_DISK,ITEM_INSTALLED)){
bidilist[bidilist.length]="HardDisk";}
if(dataObject.getDeviceChars(DEVICE_DUPLEX)){
bidilist[bidilist.length]="Duplexer";}
var installedlist=new Array;
var count=io.installed;
for(var idx=1; idx<=count; idx++){
var item=io.getInstalled(idx);
if(item &&(item.optionId.getValue()!=="BasePrinter"))
installedlist[installedlist.length]=item.optionId.getValue();}
if(installedlist.length===bidilist.length){
var matchcount=0;
for(var i=0; i<bidilist.length; i++){
for(var j=0; j<installedlist.length; j++){
var pos_bidi=bidilist[i].indexOf(":");
if(pos_bidi>0){
var pos_install=installedlist[j].indexOf(":");
if(pos_install>0){
var bidibin=bidilist[i].slice(pos_bidi+1);
var installedbin=installedlist[j].slice(pos_install+1);
if(bidibin==installedbin){
matchcount++;
break;}}}
if(bidilist[i]===installedlist[j]){
matchcount++;
break;}}}
if(matchcount!==bidilist.length)
return true;}else
return true;
		
		
		}
dataObject.destroy();}
return false;}
function updateFromPrinter(src){
var err=-1;
var dataObject=npaObject();
if(dataObject){
err=dataObject.initBidiData();
if(err==0){
var io=eval(PDS_InstallableOptions);
var trans=new Transaction(src);
if(IsInstalledOptionsChanged(src)){
io.clear();
trans.evaluate();
var count=dataObject.getInputChars(0,ITEM_COUNT);
for(var idx=1; idx<=count; idx++){
var name=dataObject.getInputChars(idx, ITEM_PRINTERNAME);
var cap=dataObject.getInputChars(idx, ITEM_CAPACITY);
var optionId="" + name;
if(name!="MP Tray"){
optionId+="_"+ cap;}
			 io.install(optionId);}
var map=undefined;
var count=dataObject.getOutputChars(0,ITEM_COUNT);
			var bin2Finisher=false;
			var bin1Finisher=false;
for(var idx=1; idx<=count; idx++){
var optionId=dataObject.getOutputChars(idx, ITEM_PRINTERNAME);
io.install(optionId);
			}
if(dataObject.getOptionChars(OPTION_FLASH,ITEM_INSTALLED)){
io.install("Flash");}
if(dataObject.getOptionChars(OPTION_DISK,ITEM_INSTALLED)){
io.install("HardDisk");}
if(dataObject.getDeviceChars(DEVICE_DUPLEX)){
io.install("Duplexer");}
var inMem=dataObject.getDeviceChars(DEVICE_MEMORY);
var ft=eval(PDS_InstalledMem);
if((inMem)&&(ft!==undefined)){
var t;
for(var iter=new Enumerator(ft); !iter.atEnd(); iter.moveNext()){
t=iter.item();
if(t.getValue()==inMem){
ft.setValue(t);
break;}}}}
var map=undefined;
var count=dataObject.getOutputChars(0,ITEM_COUNT);
for(var idx=1; idx<=count; idx++){
var userName=dataObject.getOutputChars(idx, ITEM_USERNAME);
if(userName){
var npaId=dataObject.getOutputChars(idx, ITEM_NPAID);
if(map===undefined){
map=new Object();}
map[npaId]=userName;}}
updateUserNames(PDS_PaperDest,map,trans);
var map=undefined;
var count=dataObject.getMediaType(0,ITEM_COUNT);
for(var idx=1; idx<=count; idx++){
var userName=dataObject.getMediaType(idx, ITEM_USERNAME);
if(userName){
var npaId=dataObject.getMediaType(idx, ITEM_NPAID);
if(map===undefined){
map=new Object();}
map[npaId]=userName;}}
updateUserNames(PDS_PaperType,map,trans);
trans.evaluate();
trans.commit();}
dataObject.destroy();}
return err;}
function OnActiveAutoAskPrtr(src,context,name){
var isAvail=false;
var bAvail=false;
var retBidi=1;
var admin=eval(PDS_Admin).getValue();
var bBidiEnable=1;
if(admin){
var dataObject1=npaObject();
if(dataObject1){
retBidi=dataObject1.initBidiData(1);
bBidiEnable=getDriverAttributes(1);
if(retBidi==0 && bBidiEnable==0)
bAvail=true;
if(((retBidi==0)||(retBidi==6))&& bBidiEnable==0)
isAvail=true;}
dataObject1.destroy();}
if(admin){
var auto=eval(PDS_AutoBiDiUpdate);
if(auto!==undefined && auto.getValue()){
if(bAvail==true)
	{
var err=askPrinter(src,null,null);}}}
var feat=eval(PDS_BiDiAvailable);
if(feat.getValue()!=isAvail){
var trans=new Transaction(src);
feat.setValue(isAvail);
trans.evaluate();
trans.commit();}}
@END
@DocProps
function askPrinter(src,context,name){
var err=updateFromPrinter(src);
return err;}
@END
@PrintProps
function askPrinter(src,context,name){
var err=updateFromPrinter(src);
if(err==1){
var mb=getMessageBox("mbPrtrCommErr");
mb.addParm(getPrinterInfo(2));
mb.show(GetContainingFrame(src));}
return err;}
function initStdEnaPrtrProp(ctrl,name){
var isEnabled=true;
if(eval(PDS_Admin).getValue()==false){
isEnabled=false;}
ctrl.isEnabled=isEnabled;}
function init_enab_askPrtr(ctrl,name){
var px=new FeatureGrpProxy(ctrl,[{id:"admin",path:PDS_Admin}
,{id:"bidi",path:PDS_BiDiAvailable}]);
px.ChangeHandler=enab_askPrtr;
px.Init();}
function enab_askPrtr(ctrl,grp,values){
ctrl.isEnabled=(values.admin && values.bidi);}
function init_enab_askPrtrXQ(ctrl,name){
var px=new FeatureGrpProxy(ctrl,[{id:"admin",path:PDS_Admin}
,{id:"bidi",path:PDS_BiDiAvailable}]);
px.ChangeHandler=enab_askPrtrXQ;
px.Init();}
function enab_askPrtrXQ(ctrl,grp,values){
var isEnabled=!(values.admin && values.bidi);
ctrl.isEnabled=isEnabled;
ctrl.isVisible=isEnabled;}
function InitControl_pbAskPrinterXQ(ctrl,name){
init_enab_askPrtrXQ(ctrl,name);
ctrl.AddEventHandler("onClick", getPbAskXQContext);}
function getPbAskXQContext(src,context,name){
context.result=3008;}
function InitControl_pbAskPrinter(ctrl,name){
init_enab_askPrtr(ctrl,name);
ctrl.AddEventHandler("onClick", askPrinter);}
function InitControl_pbChkAskPrinterXQ(ctrl,name){
init_enab_askPrtrXQ(ctrl,name);
ctrl.AddEventHandler("onClick", getChkAskXQContext);}
function getChkAskXQContext(src,context,name){
context.result=3008;}
function InitControl_chkAskPrinter(ctrl,name){
init_enab_askPrtr(ctrl,name);
var panel=ctrl.parent;
panel.AddEventHandler("onSetActive",OnActiveAutoAskPrtr);
var px=new ButtonProxy(ctrl);
px.AttachFeature(PDS_AutoBiDiUpdate);
px.Init();}
function InitControl_ebMemory(ctrl,name){
initStdEnaPrtrProp(ctrl,name);
var valTable="";
var feat=eval(PDS_InstalledMem);
for(var iter=new Enumerator(feat); !iter.atEnd(); iter.moveNext()){
var opt=iter.item();
valTable=valTable+","+ opt.getValue();}
ctrl.setValueTable(valTable.substr(1));
var px=new EditBoxContProxy(ctrl);
px.HandleInvalidValue=px.Numeric$HandleInvalidValue;
px.FixUpUiValue=px.NumericSet$FixUpUiValue;
px.invalidMsgBox="mbInvalidEditVal";
ctrl.label=getUiLabel("!sMemory");
px.isNumeric=true;
var ap=new OptionListProxy();
ap.fKeyId="";
ap.keyId="";
ap.AttachFeature(PDS_InstalledMem);
px.AttachComponent(ap,"val");
px.Init();}
function InitControl_chkPgProtect(ctrl,name){
initStdEnaPrtrProp(ctrl,name);
var px=new ButtonProxy(ctrl);
px.AttachFeature(PDS_PgProtect);
px.Init();}
function InitControl_pbmPrinter(ctrl,name){
init_pbmPrtr(ctrl,name);}
function InitControl_pbFactory(ctrl,name){
if(eval(PDS_Admin).getValue()==false){
ctrl.isEnabled=false;
return;}
ctrl.AddEventHandler("onClick", setInstOptToFactory);}
function setInstOptToFactory(src,context,name){
var io=eval(PDS_InstallableOptions);
var trans=new Transaction(src);
io.clear();
trans.evaluate();
for(var en=new Enumerator(io);
!en.atEnd();
en.moveNext()){
var item=en.item();
if(item && item.FactorySetting){
var fs=item.FactorySetting.getValue();
if(fs && fs.optionId){
var optId=fs.optionId.getValue();
if(optId){
io.install(optId);}}}}
var ft=eval(PDS_InstalledMem);
if((ft!==undefined)&&(ft.FactorySetting!==undefined)){
var mem=ft.FactorySetting.getValue();
var t;
for(var iter=new Enumerator(ft); !iter.atEnd(); iter.moveNext()){
t=iter.item();
if(t.getValue()==mem){
ft.setValue(t);
break;}}}
var ft=eval(PDS_AutoBiDiUpdate);
if((ft!==undefined)&&(ft.FactorySetting!==undefined)){
var val=ft.FactorySetting.getValue();
ft.setValue(val);}
var ft=eval(PDS_PrtrCollate);
if((ft!==undefined)&&(ft.FactorySetting!==undefined)){
var val=ft.FactorySetting.getValue();
ft.setValue(val);}
var ft=eval(PDS_PgProtect);
if((ft!==undefined)&&(ft.FactorySetting!==undefined)){
var val=ft.FactorySetting.getValue();
ft.setValue(val);}
updateUserNames(PDS_PaperDest,undefined,trans);
updateUserNames(PDS_PaperType,undefined,trans);
trans.evaluate();
trans.commit();}
function InitControl_lbOptions(ctrl,name){
initStdEnaPrtrProp(ctrl,name);
var px=new ListBoxProxy(ctrl);
px.CreateItemProxy=lbOptions_NOP;
px.ValidateFeatVal=lbOptions_ValidateFeatVal;
px.CurrentFeatValInvalid=lbOptions_CurrentFeatValInvalid;
px.PopulateList=lbOptions_PopulateList;
px.fKeyId=null;
px.keyId="resId";
px.GetFeatValueFromKey=lbOptions_GetFeatValueFromKey;
px.AttachFeature(PDS_InstallableItem, PDS_InstallableOptions);
px.Init();}
function lbOptions_GetFeatValueFromKey(key){
return key;}
function lbOptions_NOP(){
return undefined;}
function lbOptions_PopulateList(uiObj,collection){
var optMap=new Object();
var count=collection.available;
for(var idx=1; idx<=count; idx++){
var item=collection.getAvailable(idx);
if(item && item.optionId){
var optId=item.optionId.getValue();
var text=this.GetTextFromOptObj(item);
var key=this.GetKeyFromOptObj(item);
if(optId && text && key){
optMap[text]=key;}}}
for(var text in optMap){
var uiItemObj=uiObj.addItem(optMap[text],text);}}
function lbOptions_ValidateFeatVal(featVal,collection){
var valid=true;
if(featVal){
valid=false
var count=collection.available;
for(var idx=1; idx<=count; idx++){
var item=collection.getAvailable(idx);
if(item){
var key=this.GetKeyFromOptObj(item);
if(featVal==key){
valid=true;
break;}}}}
return valid;}
function lbOptions_CurrentFeatValInvalid(feature,collection){
this.SetFeature(feature,"");}
function InitControl_pbAddOpt(ctrl,name){
if(eval(PDS_Admin).getValue()==false){
ctrl.isEnabled=false;
return;}
var px=new FeatureGrpProxy(ctrl,[{id:"opt",path:PDS_InstallableItem}]);
px.ChangeHandler=installableOptionWatcher;
px.Init();
ctrl.AddEventHandler("onClick", addSelectedOption);}
function installableOptionWatcher(ctrl,grp,values){
var isEnabled=false;
if(values.opt){
isEnabled=true;}
ctrl.isEnabled=isEnabled;}
function addSelectedOption(src,context,name){
var installableOpt=eval(PDS_InstallableItem);
var val=installableOpt.getValue();
var count=new Array;
if(val){
addAllDependableOption(src,context,name,val,count);}}
function addAllDependableOption(src,context,name,val,count){
var optionIds=getInstallableOptIdsForKey(val);
if(optionIds && optionIds.length){
count[count.length]=val;
	var io=eval(PDS_InstallableOptions);
	var item=io.getOption(optionIds);
if(item && item.isInstallDependable)
	 var option=item.isInstallDependable.getValue();
	if(option)
	{
	 var insitem=eval(PDS_InstallableOptions+"." + option+"."+ "Options" + "."+ "Installed");
	 if(insitem && insitem.resId)		
	 var optionId=insitem.resId.getValue();
var ArraySize=count.length-1;
var matchBool=false;
while(ArraySize>=0){
if(count[ArraySize]==optionId){
matchBool=true;
break;}
--ArraySize;}
if(!matchBool)
	 addAllDependableOption(src,context,name,optionId,count);
	}
var optId=optionIds[0];
var count=optionIds.length;
if(count>1){
var targetOptIdx;
var installedOpt=eval(PDS_InstalledItem);
var targetOptId=installedOpt.getValue();
if(targetOptId){
var item=io.getOption(targetOptId);
if(item && item.optionIndex){
var itmOptIdx=item.optionIndex.getValue();
if(itmOptIdx){
targetOptIdx=itmOptIdx;}}}
var optIdx;
var item=io.getOption(optId);
if(item && item.optionIndex){
optIdx=item.optionIndex.getValue();}
for(var idx=2; idx<=count; idx++){
item=io.getOption(optionIds[idx-1]);
if(item && item.optionIndex){
var itmOptIdx=item.optionIndex.getValue();
if(itmOptIdx){
if(((optIdx<itmOptIdx)&&((targetOptIdx===undefined)||(itmOptIdx<=targetOptIdx)))||
((targetOptIdx!==undefined)&&(itmOptIdx>targetOptIdx)&&
((optIdx>itmOptIdx)||(optIdx<=targetOptIdx)))){
optIdx=itmOptIdx;
optId=optionIds[idx-1];}}}}}
var trans=new Transaction(src);
io.install(optId);
trans.evaluate();
trans.commit();}}
function getInstallableOptIdsForKey(key){
var optionIds=new Array;
var collection=eval(PDS_InstallableOptions);
var count=collection.available;
for(var idx=1; idx<=count; idx++){
var item=collection.getAvailable(idx);
if(item && item.optionId){
var text=item.resId.getValue();
		 if(text==key){
var optId=item.optionId.getValue();
if(optId){
optionIds[optionIds.length]=optId;}}
		}}
return optionIds;}
function InitControl_pbRemoveOpt(ctrl,name){
if(eval(PDS_Admin).getValue()==false){
ctrl.isEnabled=false;
return;}
var px=new FeatureGrpProxy(ctrl,[{id:"opt",path:PDS_InstalledItem}]);
px.ChangeHandler=installedOptionWatcher;
px.Init();
ctrl.AddEventHandler("onClick", removeSelectedOption);}
function installedOptionWatcher(ctrl,grp,values){
var isEnabled=false;
if(values.opt){
var io=eval(PDS_InstallableOptions);
var item=io.getOption(values.opt);
if(item && item.isUninstallable && item.isUninstallable.getValue()){
isEnabled=true;}}
ctrl.isEnabled=isEnabled;}
function removeSelectedOption(src,context,name){
var installedOpt=eval(PDS_InstalledItem);
var val=installedOpt.getValue();
var count=new Array;
if(val){
removeAllDependableOption(src,context,name,val,count);}}
function removeAllDependableOption(src,context,name,optionIds,count){
if(optionIds)
	{
count[count.length]=optionIds;
	 var io=eval(PDS_InstallableOptions);
	 var item=io.getOption(optionIds);
if(item && item.isInstallDependable)
	 var option=item.isUninstallDependable.getValue();
	 if(option)
	{
		 var insitem=eval(PDS_InstallableOptions+"." + option+"."+ "Options" + "."+ "Installed");
		 if(insitem && insitem.resId)		
var optionId=insitem.optionId.getValue();
var ArraySize=count.length-1;
var matchBool=false;
while(ArraySize>=0){
if(count[ArraySize]==optionId){
matchBool=true;
break;}
--ArraySize;}
if(!matchBool)
	 removeAllDependableOption(src,context,name,optionId,count);
	}
var trans=new Transaction(src);
var io=eval(PDS_InstallableOptions);
io.uninstall(optionIds);
trans.evaluate();
trans.commit();}}
function InitControl_lbInstalled(ctrl,name){
initStdEnaPrtrProp(ctrl,name);
var px=new ListBoxProxy(ctrl);
px.CreateItemProxy=lbInstalled_NOP;
px.ValidateFeatVal=lbInstalled_ValidateFeatVal;
px.CurrentFeatValInvalid=lbInstalled_CurrentFeatValInvalid;
px.PopulateList=lbInstalled_PopulateList;
px.fKeyId=null;
px.keyId="";
px.keyPath="optionId";
px.GetFeatValueFromKey=lbInstalled_GetFeatValueFromKey;
px.GetKeyFromFeatValue=lbInstalled_GetKeyFromFeatValue;
px.AttachFeature(PDS_InstalledItem, PDS_InstallableOptions);
px.Init();}
function lbInstalled_GetFeatValueFromKey(key){
return key;}
function lbInstalled_GetKeyFromFeatValue(featVal){
return featVal;}
function lbInstalled_NOP(){
return undefined;}
function lbInstalled_PopulateList(uiObj,collection){
var count=collection.installed;
for(var idx=1; idx<=count; idx++){
var item=collection.getInstalled(idx);
if(item){
var key="";
if(item.optionId){
key=this.GetKeyFromOptObj(item);}
if(key==""){
key=item.nameId.getValue();}
var text=this.GetTextFromOptObj(item);
if(key && text){
var uiItemObj=uiObj.addItem(key,text);}}}}
function lbInstalled_ValidateFeatVal(featVal,collection){
var valid=true;
if(featVal){
valid=false;
var selItem=collection.getOption(featVal);
if(selItem){
var count=collection.installed;
for(var idx=1; idx<=count; idx++){
var item=collection.getInstalled(idx);
if(item==selItem){
valid=true;
break;}}}}
return valid;}
function lbInstalled_CurrentFeatValInvalid(feature,collection){
this.SetFeature(feature,"");}
function InitControl_cbPrtrCollate(ctrl,name){
initStdEnaPrtrProp(ctrl,name);
var px=new ListBoxProxy(ctrl);
px.AttachFeature(PDS_PrtrCollate);
px.Init();}
@END
@PrintProps
function InitControl_lbWatermark(ctrl,name){
initStdEnaPrtrProp(ctrl,name);
var prx=new ListBoxProxy(ctrl);
prx.textId="wmId";
prx.GetIconFromOptObj=lbWm_GetIconFromOptObj;
prx.InitItem=lbWm_InitItem;
prx.AttachFeature(PDS_WatermarkSel);
prx.IsItemListed=lbWatermark_IsItemListed;
prx.Init();}
function lbWatermark_IsItemListed(collObj){
var isListed=true;
if(collObj.nameId.getValue()=="wmnone"){
isListed=false;}
return isListed;}
function InitControl_pbNewWatermark(ctrl,name){
if(eval(PDS_Admin).getValue()==false){
ctrl.isEnabled=false;
return;}
ctrl.AddEventHandler("onClick",showNewWatermark);}
function showNewWatermark(src,context,name){
var ewm=eval(PDS_EditWatermark);
var sel=eval(PDS_AddWatermark);
var trans=new Transaction();
ewm.setValue(sel);
trans.evaluate();
trans.commit();
var rc=showFrame("dlgEWmark");}
function InitControl_pbEditWatermark(ctrl,name){
if(eval(PDS_Admin).getValue()==false){
ctrl.isEnabled=false;
return;}
var proxy=new ContainerProxy(ctrl);
var ap=new VariablePathProxy();
ap.fKeyId="orgin";
ap.AttachFeature(PDS_WatermarkSel);
proxy.AttachComponent(ap,"org");
var ap=new VariablePathProxy();
ap.fKeyId=null;
ap.AttachFeature(PDS_Admin);
proxy.AttachComponent(ap,"admin");
proxy.SetUiVal=pbEditWatermark_Enab;
proxy.Init();
ctrl.AddEventHandler("onClick",showEditWatermark);}
function showEditWatermark(src,context,name){
var ewm=eval(PDS_EditWatermark);
var sel=eval(PDS_WatermarkSel+".getValue()");
var trans=new Transaction();
ewm.setValue(sel);
trans.evaluate();
trans.commit();
var rc=showFrame("dlgEWmark");}
function pbEditWatermark_Enab(uiObj,values){
var isEnabled=true;
if(values.org=="builtin" ||(values.org=="admin" && !values.admin)){
isEnabled=false;}
uiObj.isEnabled=isEnabled;}
function InitControl_pbRemoveWatermark(ctrl,name){
if(eval(PDS_Admin).getValue()==false){
ctrl.isEnabled=false;
return;}
var px=new ContainerProxy(ctrl);
var ap=new VariablePathProxy();
ap.fKeyId="orgin";
ap.AttachFeature(PDS_WatermarkSel);
px.AttachComponent(ap,"org");
var ap=new VariablePathProxy();
ap.fKeyId=null;
ap.AttachFeature(PDS_Admin);
px.AttachComponent(ap,"admin");
px.SetUiVal=pbRemoveWatermark_Enab;
px.Init();
ctrl.AddEventHandler("onClick",onpbRemoveWm);}
function onpbRemoveWm(src,context,name){
var wm=eval(PDS_WatermarkSel+".getValue()");
rmvWMark(wm,src);}
function pbRemoveWatermark_Enab(uiObj,values){
var isEnabled=true;
if(values.org=="builtin" ||((values.org=="admin") && !values.admin)){
isEnabled=false;}
uiObj.isEnabled=isEnabled;}
@END
@PrintProps
function init_enaExistingPaper(ctrl,name, fPath){
if(eval(PDS_Admin).getValue()==false){
ctrl.isEnabled=false;
}else{
var proxy=new ObjectProxy();
var fObj=eval(fPath);
if(fObj){
proxy.Attach(ctrl,"uiObj");
proxy.Attach(fObj,"feat");
proxy.onUpdate=enabOnListUpdate;
proxy.HookEvent("feat","onCollectionUpdate",proxy.onUpdate);
proxy.onUpdate(proxy.HostObj("feat"),null,null);}}}
function InitControl_cbExistingSizes(ctrl,name){
init_enaExistingPaper(ctrl,name, PDS_UserPaperSize);
var proxy=new ListBoxProxy(ctrl);
proxy.AttachFeature(PDS_SelUserPaper,
PDS_UserPaperSize);
proxy.Init();}
function enabOnListUpdate(src,context,name){
this.HostObj("uiObj").isEnabled=(src.count ? true : false);}
function InitControl_pbNewPaperSize(ctrl,name){
init_pbNewPaper(ctrl,name, PDS_UserPaperSize,showNewCustomPaperSize);}
function init_pbNewPaper(ctrl,name, path,func){
var proxy=new ObjectProxy();
proxy.onUpdate=pbNewPaper_onUpdate;
proxy.Attach(ctrl,"uiObj");
var fObj=eval(path);
if(fObj){
proxy.Attach(fObj,"coll");
proxy.HookEvent("coll","onCollectionUpdate",proxy.onUpdate);}
var fObj=eval(PDS_Admin);
if(fObj){
proxy.Attach(fObj,"admin");}
proxy.onUpdate(null,null,null);
proxy.HookEvent("uiObj","onClick",func);}
function pbNewPaper_onUpdate(src,context,name){
var isEnab=false;
var coll=this.HostObj("coll");
var admin=this.HostObj("admin");
if(admin && admin.getValue()&& coll && coll.Max){
if(coll.Max.getValue()>coll.count){
isEnab=true;}}
this.HostObj("uiObj").isEnabled=isEnab;}
function showNewCustomPaperSize(src,context,name){
var edt=eval(PDS_EditUserPaper);
var sel=eval(PDS_AddUserPaper);
var trans=new Transaction();
sel.resId.setValue("");
var val=sel.maxX.getValue();
sel.xPhy.setValue(val);
var val=sel.maxY.getValue();
sel.yPhy.setValue(val);
edt.setValue(sel);
trans.evaluate();
trans.commit();
var rc=showFrame("dlgCustomPaperSize");}
function InitControl_pbEditPaperSize(ctrl,name){
if(eval(PDS_Admin).getValue()==false){
ctrl.isEnabled=false;
return;}
var proxy=new FeatureGrpProxy(ctrl,[{id:"sel",path:PDS_SelUserPaper}]);
proxy.ChangeHandler=enab_pbCustomPaperSize;
proxy.Init();
ctrl.AddEventHandler("onClick",showEditCustomPaperSize);}
function showEditCustomPaperSize(src,context,name){
var edt=eval(PDS_EditUserPaper);
var sel=eval(PDS_SelUserPaper+".getValue()");
var trans=new Transaction();
edt.setValue(sel);
trans.evaluate();
trans.commit();
var rc=showFrame("dlgCustomPaperSize");}
function InitControl_pbRemovePaperSize(ctrl,name){
if(eval(PDS_Admin).getValue()==false){
ctrl.isEnabled=false;
return;}
var proxy=new FeatureGrpProxy(ctrl,[{id:"sel",path:PDS_SelUserPaper}]);
proxy.ChangeHandler=enab_pbCustomPaperSize;
proxy.Init();
ctrl.AddEventHandler("onClick",onpbRemovePaperSize);}
function enab_pbCustomPaperSize(ctrl,src,values){
if(values.sel){
ctrl.isEnabled=true;
}else{
ctrl.isEnabled=false;}}
function onpbRemovePaperSize(src,context,name){
var size=eval(PDS_SelUserPaper+".getValue()");
var rps=eval(PDS_RemoveUserPaper);
var trans=new Transaction(src);
rps.UserPaper.setValue(size);
rps.execute();
trans.evaluate();
trans.commit();}
function InitControl_cbExistingForms(ctrl,name){
init_enaExistingPaper(ctrl,name, PDS_CustomFormSize);
var proxy=new ListBoxProxy(ctrl);
proxy.AttachFeature(PDS_SelCustomForm,
PDS_CustomFormSize);
proxy.Init();}
function InitControl_pbNewForm(ctrl,name){
init_pbNewPaper(ctrl,name, PDS_CustomFormSize,showNewCustomForm);}
function showNewCustomForm(src,context,name){
var edt=eval(PDS_EditCustomForm);
var sel=eval(PDS_AddCustomForm);
var trans=new Transaction();
sel.resId.setValue("");
edt.setValue(sel);
trans.evaluate();
trans.commit();
var rc=showFrame("dlgCustomForm");}
function InitControl_pbEditForm(ctrl,name){
if(eval(PDS_Admin).getValue()==false){
ctrl.isEnabled=false;
return;}
var proxy=new FeatureGrpProxy(ctrl,[{id:"sel",path:PDS_SelCustomForm}]);
proxy.ChangeHandler=enab_pbCustomForm;
proxy.Init();
ctrl.AddEventHandler("onClick",showEditCustomForm);}
function showEditCustomForm(src,context,name){
var edt=eval(PDS_EditCustomForm);
var sel=eval(PDS_SelCustomForm+".getValue()");
var trans=new Transaction();
edt.setValue(sel);
trans.evaluate();
trans.commit();
var rc=showFrame("dlgCustomForm");}
function InitControl_pbRemoveForm(ctrl,name){
if(eval(PDS_Admin).getValue()==false){
ctrl.isEnabled=false;
return;}
var proxy=new FeatureGrpProxy(ctrl,[{id:"sel",path:PDS_SelCustomForm}]);
proxy.ChangeHandler=enab_pbCustomForm;
proxy.Init();
ctrl.AddEventHandler("onClick",onpbRemoveCustomForm);}
function onpbRemoveCustomForm(src,context,name){
var sel=eval(PDS_SelCustomForm+".getValue()");
var proc=eval(PDS_RemoveCustomForm);
var trans=new Transaction(src);
proc.CustomForm.setValue(sel);
proc.execute();
trans.evaluate();
trans.commit();}
function enab_pbCustomForm(ctrl,src,values){
if(values.sel){
ctrl.isEnabled=true;}else{
ctrl.isEnabled=false;}}
function InitControl_soutAssocSize(ctrl,name){
var proxy=new ContainerProxy(ctrl);
var ap=new VariablePathProxy();
ap.AllowEmptyNode=true;
ap.fKeyId="resId";
ap.AttachFeature([PDS_SelCustomForm,"FormPaperSize"]);
proxy.AttachComponent(ap,"val");
proxy.SetUiVal=soutAssoc_Set;
proxy.Init();}
function soutAssoc_Set(uiObj,values){
var label=values.val;
if(!label){
label="!none_$!"}
uiObj.setLabel(label);}
function InitControl_soutAssocType(ctrl,name){
var proxy=new ContainerProxy(ctrl);
var ap=new VariablePathProxy();
ap.AllowEmptyNode=true;
ap.fKeyId="resId";
ap.AttachFeature([PDS_SelCustomForm,"FormPaperType"]);
proxy.AttachComponent(ap,"val");
proxy.SetUiVal=soutAssoc_Set;
proxy.Init();}
function InitControl_soutAssocWatermark(ctrl,name){
var proxy=new ContainerProxy(ctrl);
var ap=new VariablePathProxy();
ap.AllowEmptyNode=true;
ap.fKeyId="resId";
ap.AttachFeature([PDS_SelCustomForm,"FormWatermark.Watermark"]);
proxy.AttachComponent(ap,"val");
proxy.SetUiVal=soutAssoc_Set;
proxy.Init();}
@END
@PrintProps
function InitControl_pbDownloadFont(ctrl,name){
if(eval(PDS_Admin).getValue()==false){
ctrl.isEnabled=false;
return;}
ctrl.AddEventHandler("onClick",showDownloadFont);}
function showDownloadFont(src,context,name){
var font=newObject();
var io=eval(PDS_InstallableOptions);
var flash=0;
var disk=0;
var EM_PCL=5;
var emultype=EM_PCL;
if(io.Flash!==undefined){
if(io.Flash.getValue().nameId.getValue()!="NotInstalled"){
flash=1;}}
if(io.HardDisk!==undefined){
if(io.HardDisk.getValue().nameId.getValue()!="NotInstalled"){
disk=1;}}
var rc=font.downloadfont(GetContainingFrame(src), flash, disk, emultype);
font.destroy();}
function InitControl_pbUpdateFont(ctrl,name){
if(eval(PDS_Admin).getValue()==false){
ctrl.isEnabled=false;
return;}
ctrl.AddEventHandler("onClick",showUpdateFont);}
function showUpdateFont(src,context,name){
var font=newObject();
var io=eval(PDS_InstallableOptions);
var flash=0;
var disk=0;
var EM_PCL=5;
var emultype=EM_PCL;
if(io.Flash!==undefined){
if(io.Flash.getValue().nameId.getValue()!="NotInstalled"){
flash=1;}}
if(io.HardDisk!==undefined){
if(io.HardDisk.getValue().nameId.getValue()!="NotInstalled"){
disk=1;}}
var rc=font.updatefont(GetContainingFrame(src), flash, disk, emultype);
font.destroy();}
function InitControl_ebMaxSize(ctrl,name){
var feat=eval(PDS_MaxFontSize);
var min=feat.Min.getValue();
var max=feat.Max.getValue();
ctrl.setValueTable(min+"."+max);
var px=new EditBoxContProxy(ctrl);
px.HandleInvalidValue=px.Numeric$HandleInvalidValue;
px.invalidMsgBox="mbInvalidEditVal";
ctrl.label=getUiLabel("!sMaxSize");
px.isNumeric=true;
var ap=px.AttachFeature(PDS_MaxFontSize);
ap.fKeyId=null;
px.Init();}
function InitControl_ebMinSize(ctrl,name){
var feat=eval(PDS_MinFontSize);
var min=feat.Min.getValue();
var max=feat.Max.getValue();
ctrl.setValueTable(min+"."+max);
var px=new EditBoxContProxy(ctrl);
px.HandleInvalidValue=px.Numeric$HandleInvalidValue;
px.invalidMsgBox="mbInvalidEditVal";
ctrl.label=getUiLabel("!sMinSize");
px.isNumeric=true;
var ap=px.AttachFeature(PDS_MinFontSize);
ap.fKeyId=null;
px.Init();}
function InitControl_lbTrueType(ctrl,name){
var sf=eval(PDS_FontSub);
if(sf && sf.count && sf.item(1)&& sf.item(1).count){
var px=new ListBoxProxy(ctrl);
px.IsRefreshReqd=lbTrueType_IsRefreshReqd;
px.keyId="resId";
px.fKeyId="resId";
px.AttachFeature(PDS_SelFontSub,
PDS_FontSub);
px.Init();
}else{
ctrl.isEnabled=false;}}
function lbTrueType_IsRefreshReqd(src,context,name, feature,collection){
var rc=(context.added!=0)||(context.deleted!=0);
return rc;}
function InitControl_sPrinterFont(ctrl,name){
var sf=eval(PDS_FontSub);
if(sf && sf.count && sf.item(1)&& sf.item(1).count){
initStdEnaPrtrProp(ctrl,name);
}else{
ctrl.isEnabled=false;}}
function InitControl_lbPrinterFont(ctrl,name){
var sf=eval(PDS_FontSub);
if(sf && sf.count && sf.item(1)&& sf.item(1).count){
initStdEnaPrtrProp(ctrl,name);
var px=new ListBoxProxy(ctrl);
px.AllowEmptyNode=true;
px.AttachFeature([PDS_SelFontSub,""],
PDS_FontSub+".item(1)");
px.Init();
}else{
ctrl.isEnabled=false;}}
function InitControl_pbFontSubDflt(ctrl,name){
if(eval(PDS_Admin).getValue()==false){
ctrl.isEnabled=false;
return;}
ctrl.AddEventHandler("onClick",dfltFontSub);}
function dfltFontSub(src,context,name){
var proc=eval(PDS_DefaultFontSub);
var trans=new Transaction(src);
proc.execute();
trans.evaluate();
trans.commit();}
@END
@DocProps
function InitControl_bmCompany(ctrl,name){
ctrl.AddEventHandler("onClick",linkHome);}
function InitControl_papSummary(ctrl,name){
var px=new FeatureGrpProxy(ctrl,[{id:"size",path:PDS_PaperSize}]);
px.ChangeHandler=papSummary_PaperSize;
px.Init();
var px=new FeatureGrpProxy(ctrl,[{id:"copies",path:PDS_Copies}
]);
px.ChangeHandler=setSumCopies;
px.Init();
var f=eval(PDS_ModelLow);
var m=f.getValue();
if(m==false){
px=new FeatureGrpProxy(ctrl,[{id:"dplx",path:PDS_Duplex}
,{id:"dOpt",path:PDS_InstallableOptions+".Duplexer"}
,{id:"orient",path:PDS_Orientation}]);
px.ChangeHandler=setSumDuplex;
px.Init();}else{
px=new FeatureGrpProxy(ctrl,[{id:"dplx",path:PDS_Duplex}
,{id:"orient",path:PDS_Orientation}]);
px.ChangeHandler=setSumDuplex;
px.Init();}
px=new FeatureGrpProxy(ctrl, [{id:"orient",path:PDS_Orientation}]);
px.ChangeHandler=setSumOrient;
px.Init();
px=new FeatureGrpProxy(ctrl,[{id:"book",path:PDS_Booklet}
								,{id:"post",path:PDS_Poster}
								,{id:"pSize",path:PDS_Poster_Size}
]);
px.ChangeHandler=setSumStyle;
px.Init();
px=new FeatureGrpProxy(ctrl,[{id:"rot",path:PDS_Rotate180}]);
px.ChangeHandler=setSumRotate;
px.Init();
px=new FeatureGrpProxy(ctrl,[{id:"nup",path:PDS_Nup}]);
px.ChangeHandler=setSumNup;
px.Init();
px=new FeatureGrpProxy(ctrl,[{id:"bord",path:PDS_Nup_Borders}]);
px.ChangeHandler=setSumNupBorders;
px.Init();
px=new SelectItemAttrProxy(ctrl);
px.SetAttr=SetPictureWatermarkLabel;
px.AttachFeature(PDS_Watermark1);
var px=new ContainerProxy(ctrl);
var ap=new VariablePathProxy();
ap.fKeyId=null;
ap.AttachFeature([PDS_Watermark1,"resId"]);
px.AttachComponent(ap,"val");
var ap=new VariablePathProxy();
ap.fKeyId=null;
ap.AttachFeature([PDS_Watermark1,"Dynamic"]);
px.AttachComponent(ap,"dyna");
var ap=new VariablePathProxy();
ap.fKeyId=null;
ap.fKeyPath="DynamicVariables";
ap.AttachFeature(PDS_Watermark1);
px.AttachComponent(ap,"coll");
px.SetUiVal=SetPictureWatermarkLabel;
px.Init();
px=new SelectItemAttrProxy(ctrl);
px.SetAttr=SetPictureWatermarkAngle;
px.attrId="Angle";
px.AttachFeature(PDS_Watermark1);
var px=new SelectItemAttrProxy(ctrl);
px.SetAttr=SetPictureWatermarkPosX;
px.attrId="X";
px.AttachFeature(PDS_Watermark1);
var px=new SelectItemAttrProxy(ctrl);
px.SetAttr=SetPictureWatermarkPosY;
px.attrId="Y";
px.AttachFeature(PDS_Watermark1);
var px=new ContainerProxy(ctrl);
var ap=px.AttachFeature([PDS_Watermark1,"Font.Size"]);
ap.fKeyId=null;
px.SetUiVal=pbm_SetWmPtSize;
px.Init();
var px=new ContainerProxy(ctrl);
var ap=px.AttachFeature([PDS_Watermark1,"Font"]);
ap.fKeyId="resId";
px.SetUiVal=pbm_SetWmFaceName;
px.Init();
var px=new ContainerProxy(ctrl);
var ap=px.AttachFeature([PDS_Watermark1,"Color"]);
ap.fKeyId="COLORREF";
px.SetUiVal=pbm_SetWmColor;
px.Init();
var px=new ContainerProxy(ctrl);
var ap=px.AttachFeature([PDS_Watermark1,"Intensity"]);
ap.fKeyId=null;
px.SetUiVal=pbm_SetWmIntensity;
px.Init();
var px=new ContainerProxy(ctrl);
var ap=px.AttachFeature([PDS_Watermark1,"Font.Underline"]);
ap.fKeyId=null;
px.SetUiVal=pbm_SetWmUnderline;
px.Init();
var px=new ContainerProxy(ctrl);
var ap=px.AttachFeature([PDS_Watermark1,"Font.Bold"]);
ap.fKeyId=null;
px.SetUiVal=pbm_SetWmBold;
px.Init();
var px=new ContainerProxy(ctrl);
var ap=px.AttachFeature([PDS_Watermark1,"Font.Italic"]);
ap.fKeyId=null;
px.SetUiVal=pbm_SetWmItalic;
px.Init();
var px=new ContainerProxy(ctrl);
var ap=px.AttachFeature([PDS_Watermark1,"Font.Outline"]);
ap.fKeyId=null;
px.SetUiVal=pbm_SetWmOutline;
px.Init();
var px=new ContainerProxy(ctrl);
var ap=px.AttachFeature([PDS_Watermark1,"Font.Strikeout"]);
ap.fKeyId=null;
px.SetUiVal=pbm_SetWmStrikeout;
px.Init();
var px=new ContainerProxy(ctrl);
var ap=px.AttachFeature([PDS_Watermark1,"X.Reference"]);
ap.fKeyId=null;
px.SetUiVal=pbm_SetWmXReference;
px.Init();
var px=new ContainerProxy(ctrl);
var ap=px.AttachFeature([PDS_Watermark1,"Y.Reference"]);
ap.fKeyId=null;
px.SetUiVal=pbm_SetWmYReference;
px.Init();}
function papSummary_PaperSize(ctrl,grp,values){
var unitsPerInch=eval(PDS_MasterUnits+".getValue()");
ctrl.setLabel(values.size.resId.getValue());
var val=(values.size.mtype.getValue()=="envelope") ? 1 : 0;
ctrl.setPaper(3, val);
pbm_PaperSize_ChangeHandler(ctrl,grp,values);}
function setSumCopies(ctrl,grp,values){
ctrl.setCopies(
values.copies);}
function setSumDuplex(ctrl,grp,vals){
var dplx=0;
var f=eval(PDS_ModelLow);
var m=f.getValue();
if(m==false){
if(vals.dOpt.nameId.getValue()=="Installed" ){
var orient=vals.orient.getValue();
switch(vals.dplx.getValue()){
case 2:
dplx=orient==1 ? 2 : 1;
break;
case 3:
dplx=orient==1 ? 1 : 2;
break;}}}else{
var orient=vals.orient.getValue();
switch(vals.dplx.getValue()){
case 2:
dplx=orient==1 ? 2 : 1;
break;
case 3:
dplx=orient==1 ? 1 : 2;
break;}}
ctrl.setFinisher(1,dplx);}
function setSumOrient(ctrl,src,value){
ctrl.setOrient(1,value.orient.getValue()==2);}
function setSumStyle(ctrl,src,values){
if(values.book)
ctrl.setStyle(1,1);else
if(values.post){
ctrl.setStyle(1,2);
var pSize=values.pSize.getValue();
ctrl.setStyle(2,pSize);}else
ctrl.setStyle(1,0);}
function setSumRotate(ctrl,src,value){
ctrl.setOrient(2,value.rot);}
function setSumNup(ctrl,src,value){
ctrl.setNup(1,value.nup.getValue());}
function setSumNupBorders(ctrl,src,value){
ctrl.setNup(2,value.bord);}
function setSumNupLayout(ctrl,src,value){}
function InitControl_sSumTypeL(ctrl,name){
ctrl.AddEventHandler("onClick", hotLink);}
function InitControl_sSumType(ctrl,name){
ctrl.allowHotkey=false;
var px=new SelectItemAttrProxy(ctrl);
px.SetAttr=InitControl_sSumType.SetLabel;
px.AttachFeature(PDS_PaperType);}
function InitControl_sSumType.SetLabel(uiObj,value){
uiObj.setLabel(value);}
function InitControl_sMISL(ctrl,name){
	ctrl.AddEventHandler("onClick", hotLink);
	var px=new FeatureGrpProxy(ctrl,[{id:"MISFrontCover",path:PDS_chkMIFrontCover},{id:"MISFirstPage",path:PDS_chkMIFirstPage},{id:"MISLastPage",path:PDS_chkMILastPage},{id:"MISBackCover",path:PDS_chkMIBackCover}]);
	px.ChangeHandler=ShowHideMIS;
	px.Init();}
function ShowHideMIS(ctrl,grp,value){
	if(value.MISFrontCover || value.MISFirstPage || value.MISLastPage || value.MISBackCover)
		ctrl.isVisible=true;
	else
		ctrl.isVisible=false;}
function InitControl_sSumCopiesL(ctrl,name){
ctrl.AddEventHandler("onClick", hotLink);}
function InitControl_sSumCopies(ctrl,name){
var px=new LabelProxy(ctrl);
px.AttachFeature(PDS_Copies);
px.Init();}
function InitControl_sSumCollateL(ctrl,name){
ctrl.AddEventHandler("onClick", hotLink);}
function InitControl_sSumCollate(ctrl,name){
var px=new FeatureGrpProxy(ctrl,[{id:"col",path:PDS_Collate}
]);
px.ChangeHandler=setCollateLbl;
px.Init();}
function setCollateLbl(ctrl,featureGrp,value){
var lbl="!Off_$!";
if(value.col)
lbl="!On_$!";
ctrl.setLabel(lbl);}
function InitControl_sSumPqL(ctrl,name){
ctrl.AddEventHandler("onClick", hotLinkPQ);}
function InitControl_sSumPq(ctrl,name){
var group=new Array;
var feat;
if(((feat=eval(PDS_TonerDark))!==undefined)){
group[group.length]={id:"td",path:PDS_TonerDark};}
if((feat=eval(PDS_Resolution))!==undefined){
group[group.length]={id:"res",path:PDS_Resolution};}
if((feat=eval(PDS_FineLines))!==undefined){
group[group.length]={id:"fl",path:PDS_FineLines};}
	if((feat=eval(PDS_RGBImages))!==undefined){
group[group.length]={id:"rgbim",path:PDS_RGBImages};}
	if((feat=eval(PDS_RGBText))!==undefined){
group[group.length]={id:"rgbtt",path:PDS_RGBText};}
	if((feat=eval(PDS_RGBGraphics))!==undefined){
group[group.length]={id:"rgbgp",path:PDS_RGBGraphics};}
if((feat=eval(PDS_ColorSaver))!==undefined){
group[group.length]={id:"cs",path:PDS_ColorSaver};}
	if((feat=eval(PDS_ColorCorrection))!==undefined){
group[group.length]={id:"cc",path:PDS_ColorCorrection};}
if((feat=eval(PDS_PictureGradePCL))!==undefined){
group[group.length]={id:"pg",path:PDS_PictureGradePCL};}
if((feat=eval(PDS_PQCustom))!==undefined){
group[group.length]={id:"cust",path:PDS_PQCustom};}
var px=new FeatureGrpProxy(ctrl,group);
px.ChangeHandler=sSumPq_ChangeHandler;
px.Init();}
function sSumPq_ChangeHandler(ctrl,grp,values){
var mVals=new Object();
if(values.td){
mVals.td=values.td.nameId.getValue();}
if(values.res){
mVals.res=values.res.nameId.getValue();}
if(values.fl){
mVals.fl=values.fl.nameId.getValue();}
if(values.cs){
mVals.cs=values.cs.nameId.getValue();}
	if(values.cc){
mVals.cc=values.cc.nameId.getValue();}
	if(values.rgbim){
mVals.rgbim=values.rgbim.nameId.getValue();}
if(values.rgbtt){
mVals.rgbtt=values.rgbtt.nameId.getValue();}
if(values.rgbgp){
mVals.rgbgp=values.rgbgp.nameId.getValue();}
if(values.pg){
mVals.pg=values.pg.nameId.getValue();}
if(values.cust!==undefined){
mVals.cust=values.cust;}
var mItem=PQ_map_Match(mVals);
if(mItem!==undefined){
var lbl=mItem.label;
var feat=eval(PDS_PQLabel);
feat.setValue(lbl);
ctrl.setLabel(mItem.label);}}
function InitControl_sSumColor(ctrl,name){
ctrl.AddEventHandler("onClick", hotLink);
var px=new FeatureGrpProxy(ctrl,[{id:"bw",path:PDS_PrintBW}]);
px.ChangeHandler=setSumBW;
px.Init();}
function InitControl_sSumColorMono(ctrl,name){
var px=new FeatureGrpProxy(ctrl,[{id:"bw",path:PDS_PrintBW}]);
ctrl.isVisible=true;
px.Init();}
function setSumBW(ctrl,src,val){
ctrl.setLabel(val.bw ? "!blackWhite" : "!Color_$!" );
ctrl.isVisible=true;}
function InitControl_sSumHold(ctrl,name){
var px=new FeatureGrpProxy(ctrl,[{id:"hold",path:PDS_PrintHold}
]);
px.ChangeHandler=selHoldLbl;
px.Init();
ctrl.AddEventHandler("onClick", hotLink);}
function selHoldLbl(ctrl,grp,val){
var lbl="";
switch(val.hold.getValue()){
case 1:
lbl="!pHoldConf";
break;
case 2:
lbl="!pHoldVerify";
break;
case 3:
lbl="!pHoldReserve";
break;
case 4:
lbl="!pHoldRepeat";
break;}
ctrl.setLabel(lbl);
ctrl.isVisible=(lbl.length>0);}
function shoWmarkLnk(ctrl,grp,vals){
var isVis=true;
if(vals.wm.nameId.getValue()=="None"
||(vals.wm1.nameId.getValue()=="wmnone"
&& vals.wm2.nameId.getValue()=="wmnone"))
isVis=false;
ctrl.isVisible=isVis;}
function InitControl_sSumWmark(ctrl,name){
ctrl.AddEventHandler("onClick", hotLink);
var px=new FeatureGrpProxy(ctrl,[{id:"wm",path:PDS_Watermark}
,{id:"wm1",path:PDS_Watermark1}
,{id:"wm2",path:PDS_Watermark2}]);
px.ChangeHandler=shoWmarkLnk;
px.Init();}
function InitControl_pbmSummary(ctrl,name){
	OnActiveAutoAskPrtr(ctrl,null,null);
init_pbmPrtr(ctrl,name);
var px=new FeatureGrpProxy(ctrl,[{id:"src",path:PDS_PaperSource}]);
px.ChangeHandler=pbmSummary_PaperSource;
px.Init();
var px=new FeatureGrpProxy(ctrl,[{id:"src",path:PDS_PaperDest}]);
px.ChangeHandler=pbmSummary_PaperDest;
px.Init();}
function pbmSummary_PaperSource(ctrl,grp,values){
var selId=0;
if(values.src && values.src.selPicId){
selId=values.src.selPicId.getValue();}
ctrl.selSource(selId);}
function pbmSummary_PaperDest(ctrl,grp,values){
var selId=0;
if(values.src && values.src.selPicId){
selId=values.src.selPicId.getValue();}
ctrl.selDestination(selId);}
@END
@DocProps PrintProps
function init_pbmPrtr(ctrl,name){
var px=new FeatureGrpProxy(ctrl,[{id:"npa_val",path:PDS_NPAValue}]);
px.ChangeHandler=pbmSummary_GetNPAValue;
px.Init();
ctrl.setOption("1","tray1","3");
var io=eval(PDS_InstallableOptions);
for(var en=new Enumerator(io);
!en.atEnd();
en.moveNext()){
var pictures=en.item().pictures;
if((pictures!==undefined)&&(pictures.type=="Collection")){
for(var enPic=new Enumerator(pictures);
!enPic.atEnd();
enPic.moveNext()){
var px=new ObjectProxy();
px.onUpdate=pbmPrtr_onUpdatePic;
px.Attach(ctrl,"uiObj");
px.Attach(enPic.item(),"pic");
px.HookEvent("pic","onChange",px.onUpdate);
px.onUpdate(px.HostObj("pic"),null,null);}
}else{
var optName=en.item().name;
var optPath=PDS_InstallableOptions+"."+ optName;
var px=new FeatureGrpProxy(ctrl,[{id:optName,path:optPath}]);
px.ChangeHandler=pbmPrtrUpdate;
px.Init();}}}
function pbmSummary_GetModelValue(ctrl,grp,values){
	var modeltype=0;
	if(values.model==true)
	{
	 modeltype=1;
	}
	else
	{
		modeltype=2;
	}
	ctrl.setModel(modeltype);}
function pbmSummary_GetNPAValue(ctrl,grp,values){
var npaid=0
if(values && values.npa_val){
	npaid=values.npa_val;}
ctrl.setModel(npaid);}
function pbmPrtr_onUpdatePic(src,context,name){
var ctrl=this.HostObj("uiObj");
var picSpec=src.picture.getValue();
var isSet=src.getValue();
var pictures=picSpec.split(":");
for(var i=0; i<pictures.length; i++){
var parms=pictures[i].split(",");
if(isSet){
ctrl.setOption(parms[0],parms[1],parms[2]);
}else{
ctrl.resetOption(parms[0],parms[1],parms[2]);}}}
function pbmPrtrUpdate(ctrl,grp,values){
for(var optName in values){
var option=values[optName];
if(option.picture){
var picSpec=option.picture.getValue();
if(picSpec){
var pictures=picSpec.split(":");
for(var i=0; i<pictures.length; i++){
var parms=pictures[i].split(",");
if((parms[3]===undefined)||(parms[3]!="reset")){
ctrl.setOption(parms[0],parms[1],parms[2]);
}else{
ctrl.resetOption(parms[0],parms[1],parms[2]);}}}}}}
@END
@DocProps PrintProps
function ensureFrame(fName){
if(frames.Find(fName)==null)
showFrame(fName);}
function focusLink(link){
var wg=link;
var pos=link.indexOf(".");
if(pos>0){
var fr=link.substr(0, pos);
if(fr.length>0)
ensureFrame(fr);
wg=link.substr(pos+1);}
if(wg.length>0){
wg=controls.Find(wg);
if(wg)
wg.isFocus=true;}}
function handleHotLink(linkData){
var pos=linkData.indexOf(",");
focusLink(pos>=0 ? linkData.substr(0,pos): linkData);
if(pos>=0)
urlLink(linkData.substr(pos+1));}
function hasPermission(){
return eval(PDS_Permission).getValue();}
function hotLink(src,context,name){
handleHotLink(context.label);}
function hotLinkPQ(src,context,name){
handleHotLink(context.label);}
function urlLink(url){}
function SetPictureWatermarkAngle(uiObj,value){
uiObj.setWatermarkFont(3, value);}
function SetPictureWatermarkLabel(uiObj,value){
uiObj.setWatermark(1,(value!="!none_$!")? value: "");}
function SetPictureWatermarkLabel(uiObj,values){
var text="";
if(values){	
	 if(values.dyna || values.coll)
	{			
		if(values.val)
			text=values.val
	}
	 else
		text=values;}
if((values.dyna)&&(values.dyna.name=="on") &&(values.coll)){
var elements=text.split("%");
var state=0;
var dynaStr="";
var dynaItm="";
for(var i=0; i<elements.length; i++){
switch(state){
case 0:
dynaStr+=dynaItm+elements[i];
state=1;
break;
case 1:
if(elements[i]==""){
dynaItm="%";
}else{
dynaItm="";
var label=elements[i].toLowerCase();
for(var en=new Enumerator(values.coll);
!en.atEnd();
en.moveNext()){
var item=en.item();
if(item && item.varLabel){
var itmLabel=item.varLabel.getValue();
if(label==itmLabel.toLowerCase()){
dynaStr+=item.getValue();
break;}}}}
state=0;
break;}}
text=dynaStr;}
uiObj.setWatermark(1,(text!="!none_$!")? text: "");}
function tstRE(re,str){
var tRe=new RegExp(re);
return tRe.test(str);}
function stripLT(inStr){
var outStr=inStr.replace(/^ */,"");
outStr=outStr.replace(/ *$/,"");
return outStr;}
function deblank(inStr){
var outStr=stripLT(inStr);
outStr=outStr.replace(/\s{2,}/g," ");
return outStr;}
function getUiLabel(resId){
var lbl=getTranslation(resId);
if(lbl)
lbl=lbl.replace(/[&:]/g,"");else
lbl="";
return lbl;}
@END
@DocProps
function InitControl_pbPosterXQ(ctrl,name){
if(hasPermission()){
var px=new ConstraintButtonContProxy(ctrl);
px.IsConstrained=pbPoster_IsConstrained;
px.GetContextId=pbPoster_GetContextId;
var ap=new ConstraintFeatureProxy();
ap.AttachFeature(PDS_Constraints+".Poster.isConstrained");
px.AttachComponent(ap,"cons");
px.Init();}}
function InitControl_ilPoster(ctrl,name){
var px=new FeatureGrpProxy(ctrl,[{id:"size",path:PDS_Poster_Size}
,{id:"crop",path:PDS_Poster_CropMarks}]);
px.ChangeHandler=selPosterImg;
px.Init();}
function selPosterImg(ctrl,grps,values){
var img=values["size"].getValue()- 2;
if(values["crop"])
img+=3;
ctrl.selectImage(img);}
function InitControl_rb2x2(ctrl,name){
var px=new OptionButtonProxy(ctrl);
px.onKey="_2x2";
px.AttachFeature(PDS_Poster_Size);
px.Init();}
function InitControl_rb3x3(ctrl,name){
var px=new OptionButtonProxy(ctrl);
px.onKey="_3x3";
px.AttachFeature(PDS_Poster_Size);
px.Init();}
function InitControl_rb4x4(ctrl,name){
var px=new OptionButtonProxy(ctrl);
px.onKey="_4x4";
px.AttachFeature(PDS_Poster_Size);
px.Init();}
function InitControl_chkCrop(ctrl,name){
var px=new ButtonProxy(ctrl);
px.AttachFeature(PDS_Poster_CropMarks);
px.Init();}
function InitControl_sldOvrlap(ctrl,name){
var feat=eval(PDS_Poster_Overlap);
var maxOvr=feat.Max.getValue();
var ticFreq=maxOvr / 10;
ctrl.setRange(feat.Min.getValue(),maxOvr,ticFreq);
var px=new SliderProxy(ctrl);
px.AttachFeature(PDS_Poster_Overlap);
px.Init();}
function InitControl_pbMPLHelp(ctrl,name){
ctrl.AddEventHandler("onClick",MPLHelp);}
function MPLHelp(evt){
showHelp(evt,"Context",1);}
@END
@DocProps
function cnstrnBP(ctrl,src,val){
if((ctrl.name=="rbBookletLayout"))
ctrl.isEnabled=!(val.cons ||(getPrinterInfo(1)=="FILE:" ));
else if((ctrl.name=="pbBookletSettings"))
ctrl.isEnabled=!(val.cons || !val.book ||(getPrinterInfo(1)=="FILE:" ));
else if(ctrl.name=="pbPosterSettings"){
	 ctrl.isEnabled=!(val.cons || !val.post);}else
ctrl.isEnabled=!val.cons;}
function NOP(){}
function constrainBook(ctrl){
var px=new FeatureGrpProxy(ctrl,[{id:"cons",path:PDS_Constraints+".Booklet.isConstrained"}
,{id:"bFinish",path:PDS_InstallableOptions+".BookletFinisher"}
									 ,{id:"book",path:PDS_Booklet}
]);
px.ChangeHandler=cnstrnBP;
px.Init();}
function InitControl_pbBookletXQ(ctrl,name){
if(hasPermission()){
var px=new ConstraintButtonContProxy(ctrl);
px.IsConstrained=pbBookletXQ_IsConstrained;
px.GetContextId=pbBookletXQ_GetContextId;
var f=eval(PDS_ModelLow);
var m=f.getValue();
if(m==false){
var ap=new VariablePathProxy();
ap.AttachFeature(PDS_InstallableOptions+".Duplexer");
px.AttachComponent(ap,"dplx");}
	else
	{
	}
var ap=new ConstraintFeatureProxy();
ap.AttachFeature(PDS_Constraints+".Booklet.isConstrained");
px.AttachComponent(ap,"cons");
	px.Init();}}
function pbBookletXQ_IsConstrained(compId,compVal){
var isCons=false;
var f=eval(PDS_ModelLow);
var m=f.getValue();
if(m==false){
	 switch(compId)
	{
		 case "dplx":
		{
			 isCons=(compVal=="NotInstalled");
			 break;
		}
		 default:
		{
			 this._IsConstrained_=this.constructor.prototype.IsConstrained;
			 isCons=this._IsConstrained_(compId,compVal);
			 delete this._IsConstrained_;
		}
	}}else{
		switch(compId)
		{
		 case "dplx":
		{
			 isCons=(compVal=="NotInstalled");
			 break;
		}
		 default:
		{
			this._IsConstrained_=this.constructor.prototype.IsConstrained;
			isCons=this._IsConstrained_(compId,compVal);
			delete this._IsConstrained_;
		}
		}}
return isCons;}
function pbBookletXQ_GetContextId(compId,compVal){
var id;
switch(compId){
case "dplx":
id=1102;
break;
default:{
this._GetContextId_=this.constructor.prototype.GetContextId;
id=this._GetContextId_(compId,compVal);
delete this._GetContextId_;}}
return id;}
function constrainPost(ctrl){
var px=new FeatureGrpProxy(ctrl,[{id:"cons",path:PDS_Constraints+".Poster.isConstrained"}
,{id:"post",path:PDS_Poster}]);
px.ChangeHandler=cnstrnBP;
px.Init();}
function InitControl_pbPosterXQ(ctrl,name){
if(hasPermission()){
var px=new ConstraintButtonContProxy(ctrl);
px.IsConstrained=pbPoster_IsConstrained;
px.GetContextId=pbPoster_GetContextId;
var ap=new ConstraintFeatureProxy();
ap.AttachFeature(PDS_Constraints+".Poster.isConstrained");
px.AttachComponent(ap,"cons");
px.Init();}}
function pbPoster_IsConstrained(compId,compVal){
var isCons=false;
switch(compId){
default:{
this._IsConstrained_=this.constructor.prototype.IsConstrained;
isCons=this._IsConstrained_(compId,compVal);
delete this._IsConstrained_;}}
return isCons;}
function pbPoster_GetContextId(compId,compVal){
var id;
switch(compId){
default:{
this._GetContextId_=this.constructor.prototype.GetContextId;
id=this._GetContextId_(compId,compVal);
delete this._GetContextId_;}}
return id;}
function InitControl_ibPoster(ctrl,name){
constrainPost(ctrl);}
function InitControl_chkMirror(ctrl,name){
var px=new ButtonProxy(ctrl);
px.AttachFeature(PDS_Mirror);
px.Init();}
function InitControl_ebScale(ctrl,name){
var feat=eval(PDS_Scale);
var min=feat.Min.getValue();
var max=feat.Max.getValue();
ctrl.setValueTable(min+"."+max);
var px=new EditBoxContProxy(ctrl);
px.HandleInvalidValue=px.Numeric$HandleInvalidValue;
px.invalidMsgBox="mbInvalidEditVal";
ctrl.label=getUiLabel("!sScale");
px.isNumeric=true;
var ap=px.AttachFeature(PDS_Scale);
ap.fKeyId=null;
px.Init();}
function InitControl_rbBasicLayout(ctrl,name){
var px=new ButtonProxy(ctrl);
px.onKey="BasicLayout";
px.AttachFeature(PDS_BasicLayout);
px.Init();}
function InitControl_rbBookletLayout(ctrl,name){
var px=new ButtonProxy(ctrl);
px.onKey="Booklet";
px.AttachFeature(PDS_Booklet);
constrainBook(ctrl);
px.Init();}
function InitControl_rbPosterLayout(ctrl,name){
var px=new ButtonProxy(ctrl);
px.onKey="Poster";
px.AttachFeature(PDS_Poster);
constrainPost(ctrl);
px.Init();}
function InitControl_pbBookletSettings(ctrl,name){
ctrl.AddEventHandler("onClick", ShowMoreBooklet);
	constrainBook(ctrl);}
function InitControl_pbPosterSettings(ctrl,name){
ctrl.AddEventHandler("onClick", ShowMorePoster);
constrainPost(ctrl);}
function ShowMoreBooklet(src,context,name){
showFrame("dlgMoreBooklet4" );}
function ShowMorePoster(src,context,name){
showFrame("dlgMorePoster1" );}
function InitControl_pbMPLHelp(ctrl,name){
ctrl.AddEventHandler("onClick",MPLHelp);}
function MPLHelp(evt){
showHelp(evt,"Context",1);}
@END
@DocProps
function enabBookletCoverCtls(ctrl){
	var px=new FeatureGrpProxy(ctrl,[{id:"nocover",path:PDS_BookletNoCover}]);
	px.ChangeHandler=enabCoverCtls;
	px.Init();}
function enabCoverCtls(ctrl,src,vals){
	 ctrl.isEnabled=vals.nocover;}
function enabBookletNoFoldCtls(ctrl){
	var px=new FeatureGrpProxy(ctrl,[{id:"cons",path:PDS_Constraints+".BookletFold.NoFold.isConstrained"}
									 ,{id:"bFinish",path:PDS_InstallableOptions+".BookletFinisher"}
									 ]);
	px.ChangeHandler=enabNoFoldCtls;
px.Init();}
function enabNoFoldCtls(ctrl,src,vals)
{	
	ctrl.isEnabled=!(vals.bFinish.nameId.getValue()=="NotInstalled");}
function enabBookletFoldCtls(ctrl){
	var px=new FeatureGrpProxy(ctrl,[{id:"cons",path:PDS_Constraints+".BookletFold.Fold.isConstrained"}
									 ,{id:"bFinish",path:PDS_InstallableOptions+".BookletFinisher"}
									 ]);
	px.ChangeHandler=enabFoldCtls;
px.Init();}
function enabFoldCtls(ctrl,src,vals)
{	
	ctrl.isEnabled=(!(vals.bFinish.nameId.getValue()=="NotInstalled") && !(vals.cons));}
function enabBookletStapleCtls(ctrl){
	var px=new FeatureGrpProxy(ctrl,[{id:"cons",path:PDS_Constraints+".BookletFold.Staple.isConstrained"}
									 ,{id:"bFinish",path:PDS_InstallableOptions+".BookletFinisher"}
									 ]);
	px.ChangeHandler=enabStapleCtls;
px.Init();}
function enabStapleCtls(ctrl,src,vals)
{	
	ctrl.isEnabled=(!(vals.bFinish.nameId.getValue()=="NotInstalled") && !(vals.cons));}
function InitControl_rbNoFoldStaple(ctrl,name){
var px=new OptionButtonProxy(ctrl);
px.SetUiEnable=undefined;
px.onKey="NoFold";
px.AttachFeature(PDS_FinisherBooklet);
enabBookletNoFoldCtls(ctrl);
px.Init();}
function InitControl_rbBookletFold(ctrl,name){
var px=new OptionButtonProxy(ctrl);
px.SetUiEnable=undefined;
px.onKey="BookletFold";
px.AttachFeature(PDS_FinisherBooklet);
px.Init();
enabBookletFoldCtls(ctrl);}
function InitControl_rbBookletStapleFold(ctrl,name){
var px=new OptionButtonProxy(ctrl);
px.SetUiEnable=undefined;
px.onKey="FoldStaple";
px.AttachFeature(PDS_FinisherBooklet);
px.Init();
enabBookletStapleCtls(ctrl);}
function InitControl_ilToBookletFold(ctrl,name){
	var px=new FeatureGrpProxy(ctrl,[{id:"book",path:PDS_FinisherBooklet}
							
								,
								{id:"cover",path:PDS_BookletNoCover}
								
								]);
		px.ChangeHandler=BookletFoldImg;
		px.Init();}
function BookletFoldImg(ctrl,src,vals){
var img=0;	
	 if(vals.book.nameId.getValue()=="NoFold")
	{
		
		 img+=1;
	}
	 if(vals.book.nameId.getValue()=="BookletFold")
	{
		 if(vals.cover)
		 img+=2;
		 else
		 img+=3;
	}
	 if(vals.book.nameId.getValue()=="FoldStaple")
	{
	 if(vals.cover)
			img+=5;
		 else
			img+=4;
	}	
ctrl.selectImage(img);}
function enabPunchCtls(ctrl,grp,value){
if(value.pnch.nameId.getValue()=="Off")
ctrl.isEnabled=false;}
function InitControl_sBookletCover(ctrl,name){
var px=new FeatureGrpProxy(ctrl,[{id:"book",path:PDS_FinisherBooklet}]);
px.Init();}
function InitControl_chkCreateCover(ctrl,name){
var px=new ButtonProxy(ctrl);
px.AttachFeature(PDS_BookletNoCover);
px.Init();}
function InitControl_chkFrontFrontCover(ctrl,name){
var px=new ButtonProxy(ctrl);
px.AttachFeature(PDS_BookletFFrontCover);
px.Init();
enabBookletCoverCtls(ctrl);}
function toglFF(src,context,name){
var f=eval(PDS_BookletFFrontCover);
var newFF=!f.getValue();
var trans=new Transaction(src);
f.setValue(newFF);
trans.evaluate();
trans.commit();
controls("chkFrontFrontCover").isFocus=true;}
function InitControl_chkBackFrontCover(ctrl,name){
var px=new ButtonProxy(ctrl);
px.AttachFeature(PDS_BookletBFrontCover);
px.Init();
enabBookletCoverCtls(ctrl);}
function toglBF(src,context,name){
var f=eval(PDS_BookletBFrontCover);
var newFF=!f.getValue();
var trans=new Transaction(src);
f.setValue(newFF);
trans.evaluate();
trans.commit();
controls("chkBackFrontCover").isFocus=true;}
function InitControl_chkFrontBackCover(ctrl,name){
var px=new ButtonProxy(ctrl);
px.AttachFeature(PDS_BookletFBackCover);
px.Init();
enabBookletCoverCtls(ctrl);}
function toglFB(src,context,name){
var f=eval(PDS_BookletFBackCover);
var newFF=!f.getValue();
var trans=new Transaction(src);
f.setValue(newFF);
trans.evaluate();
trans.commit();
controls("chkFrontBackCover").isFocus=true;}
function InitControl_chkBackBackCover(ctrl,name){
var px=new ButtonProxy(ctrl);
px.AttachFeature(PDS_BookletBBackCover);
px.Init();
enabBookletCoverCtls(ctrl);}
function toglBB(src,context,name){
var f=eval(PDS_BookletBBackCover);
var newFF=!f.getValue();
var trans=new Transaction(src);
f.setValue(newFF);
trans.evaluate();
trans.commit();
controls("chkBackBackCover").isFocus=true;}
function InitControl_ilFFrontCover(ctrl,name){
var imgPx=new FeatureGrpProxy(ctrl,[{id:"orient",path:PDS_Orientation}]);
imgPx.ChangeHandler=FFrontCoverImg;
enabBookletCoverCtls(ctrl);
imgPx.Init();
ctrl.AddEventHandler("onClick",toglFF);}
function FFrontCoverImg(ctrl,src,values){
ctrl.selectImage(1);}
function InitControl_ilBFrontCover(ctrl,name){
var imgPx=new FeatureGrpProxy(ctrl,[{id:"orient",path:PDS_Orientation}]);
imgPx.ChangeHandler=BFrontCoverImg;
enabBookletCoverCtls(ctrl);
ctrl.AddEventHandler("onClick",toglBF);
imgPx.Init();}
function BFrontCoverImg(ctrl,src,values){
ctrl.selectImage(2);}
function InitControl_ilFBackCover(ctrl,name){
var imgPx=new FeatureGrpProxy(ctrl,[{id:"orient",path:PDS_Orientation}]);
imgPx.ChangeHandler=FBackCoverImg;
enabBookletCoverCtls(ctrl);
ctrl.AddEventHandler("onClick",toglFB);
imgPx.Init();}
function FBackCoverImg(ctrl,src,values){
ctrl.selectImage(3);}
function InitControl_ilBBackCover(ctrl,name){
var imgPx=new FeatureGrpProxy(ctrl,[{id:"orient",path:PDS_Orientation}]);
imgPx.ChangeHandler=BBackCoverImg;
enabBookletCoverCtls(ctrl);
ctrl.AddEventHandler("onClick",toglBB);
imgPx.Init();}
function BBackCoverImg(ctrl,src,values){
ctrl.selectImage(4);}
function InitControl_sCoverPaperType(ctrl,name){
var px=new FeatureGrpProxy(ctrl,[{id:"book",path:PDS_FinisherBooklet}]);
px.Init();
hookEnabMoreBookCtls(ctrl);}
function InitControl_sCoverPaperSource(ctrl,name){
var px=new FeatureGrpProxy(ctrl,[{id:"book",path:PDS_FinisherBooklet}]);
px.Init();
hookEnabMoreBookCtls(ctrl);}
function InitControl_cbCoverPType(ctrl,name){
var px=new ListBoxProxy(ctrl);
px.AttachFeature(PDS_BookletPaperType);
px.Init();
hookEnabMoreBookCtls(ctrl);}
function InitControl_cbCoverPSource(ctrl,name){
var px=new ListBoxProxy(ctrl);
px.AttachFeature(PDS_BookletPaperSource);
px.Init();
hookEnabMoreBookCtls(ctrl);}
function enabMoreBookCtls(ctrl,grp,value){
enabCoverCtls(ctrl, grp, value);}
function hookEnabMoreBookCtls(ctrl){
var px=new FeatureGrpProxy(ctrl,[{id:"nocover",path:PDS_BookletNoCover}
]);
px.ChangeHandler=enabMoreBookCtls;
px.Init();}
function InitControl_pbBookletFoldXQ(ctrl,name){
if(hasPermission()){
			var px=new ConstraintButtonContProxy(ctrl);
			px.IsConstrained=pbBookletFoldXQ_IsConstrained;
			px.GetContextId=pbBookletFoldXQ_GetContextId;
		
			
		
			ap=new VariablePathProxy();
			ap.fKeyId=null;
			ap.AttachFeature(PDS_InstallableOptions+".BookletFinisher");
			px.AttachComponent(ap,"bookfinish");
var ap=new ConstraintFeatureProxy();
ap.AttachFeature(PDS_Constraints+".BookletFold.Fold.isConstrained");
px.AttachComponent(ap,"bookfold");
var ap=new ConstraintFeatureProxy();
ap.AttachFeature(PDS_Constraints+".BookletFold.Staple.isConstrained");
px.AttachComponent(ap,"bookstaple");
	px.Init();}}
function pbBookletFoldXQ_GetContextId(compId,compVal){
var id;
	if(compId=="bookfinish" )
		return 1522;else{
this._GetContextId_=this.constructor.prototype.GetContextId;
id=this._GetContextId_(compId,compVal);
delete this._GetContextId_;
return id;}}
function pbBookletFoldXQ_IsConstrained(compId,compVal){
if(compId=="bookfinish" )
return !isAdvFinisherAvailable();else{
this._IsConstrained_=this.constructor.prototype.IsConstrained;
	 isCons=this._IsConstrained_(compId,compVal);
	 delete this._IsConstrained_;
return isCons;}}
function InitControl_pbBookletMaintainXQ(ctrl){
	if(hasPermission()){
			var px=new ConstraintButtonContProxy(ctrl);
			px.IsConstrained=pbBookletMaintainXQ_IsConstrained;
			px.GetContextId=pbBookletMaintainXQ_GetContextId;
		
			
		
			ap=new VariablePathProxy();
			ap.fKeyId=null;
			ap.AttachFeature(PDS_PaperSize);
			px.AttachComponent(ap,"papsize");
	px.Init();}}
function pbBookletMaintainXQ_GetContextId(compId,compVal){	
		return 1525;}
function pbBookletMaintainXQ_IsConstrained(compId,compVal){
var isEnable=false;
var isEnableFitToPage=false;
var isCons=false;
if((eval(PDS_FitToPageSize).getValue().nameId.getValue()=="LETTER")){
isEnableFitToPage=true;}
if(!isEnableFitToPage){
if(eval(PDS_PaperSize).getValue().nameId.getValue()=="LETTER"){
if(eval(PDS_FitToPageSize).getValue().nameId.getValue()=="UseSameSize")
isEnableFitToPage=true;else
isEnableFitToPage=false;}}
if((eval(PDS_FitToPageSize).getValue().nameId.getValue()=="A4")){
isEnableFitToPage=true;}
if(!isEnableFitToPage){
if(eval(PDS_PaperSize).getValue().nameId.getValue()=="A4"){
if(eval(PDS_FitToPageSize).getValue().nameId.getValue()=="UseSameSize")
isEnableFitToPage=true;else
isEnableFitToPage=false;}}
isCons=!(isEnableFitToPage || isEnable);
return(isCons);}
function isAdvFinisherAvailable(){
	return(eval(PDS_InstallableOptions+".BookletFinisher").getValue().nameId.getValue()!="NotInstalled");}
function hookMaintainLetterA4(ctrl){
var isEnable=false;
var isEnableFitToPage=false;
if((eval(PDS_FitToPageSize).getValue().nameId.getValue()=="LETTER")){
isEnableFitToPage=true;}
if(!isEnableFitToPage){
if(eval(PDS_PaperSize).getValue().nameId.getValue()=="LETTER"){
if(eval(PDS_FitToPageSize).getValue().nameId.getValue()=="UseSameSize")
isEnableFitToPage=true;else
isEnableFitToPage=false;}}
if((eval(PDS_FitToPageSize).getValue().nameId.getValue()=="A4")){
isEnableFitToPage=true;}
if(!isEnableFitToPage){
if(eval(PDS_PaperSize).getValue().nameId.getValue()=="A4"){
if(eval(PDS_FitToPageSize).getValue().nameId.getValue()=="UseSameSize")
isEnableFitToPage=true;else
isEnableFitToPage=false;}}
ctrl.isEnabled=isEnableFitToPage || isEnable;}
function InitControl_chkMaintainLetterA4(ctrl,name){
var px=new ButtonProxy(ctrl);
px.AttachFeature(PDS_BookletMaintainLetterA4);
hookMaintainLetterA4(ctrl);
px.Init();}
function InitControl_ilLetterA4(ctrl,name){
	ctrl.AddEventHandler("onClick",toglLtrA4);}
function toglLtrA4(src,context,name){
	var f=eval(PDS_BookletMaintainLetterA4);
	var LtrA4=!f.getValue();
	var trans=new Transaction(src);
	f.setValue(LtrA4);
	trans.evaluate();
	trans.commit();	}
function InitControl_pbMFHelp(ctrl,name){
ctrl.AddEventHandler("onClick",MFHelp);}
function MFHelp(evt){
showHelp(evt,"Context",0);}
@END
@DocProps
function init_enaExistingPaper(ctrl,name, fPath){
var proxy=new ObjectProxy();
var fObj=eval(fPath);
if(fObj){
proxy.Attach(ctrl,"uiObj");
proxy.Attach(fObj,"feat");
proxy.onUpdate=enabOnListUpdate;
proxy.HookEvent("feat","onCollectionUpdate",proxy.onUpdate);
proxy.onUpdate(proxy.HostObj("feat"),null,null);}}
function InitControl_lbExistingSizes(ctrl,name){
	if(eval(PDS_Admin).getValue()==true)
	{
		init_enaExistingPaper(ctrl,name, PDS_AdminUserPaperSize);
	}
	else
	{
		init_enaExistingPaper(ctrl,name, PDS_UserPaperSize);
	}
	var proxy=new ListBoxProxy(ctrl);
	if(eval(PDS_Admin).getValue()==true)
	{
		proxy.AttachFeature(PDS_SelUserPaper,PDS_AdminUserPaperSize);
	}
	else
		proxy.AttachFeature(PDS_SelUserPaper,PDS_UserPaperSize);
	proxy.Init();}
function enabOnListUpdate(src,context,name){
this.HostObj("uiObj").isEnabled=(src.count ? true : false);}
function InitControl_pbNewPaperSize(ctrl,name){
	if(eval(PDS_Admin).getValue()==true)
	{
		init_pbNewPaper(ctrl,name, PDS_AdminUserPaperSize,showNewCustomPaperSize);
	}
	else
	{
		init_pbNewPaper(ctrl,name, PDS_UserPaperSize,showNewCustomPaperSize);
	}}
function init_pbNewPaper(ctrl,name, path,func){
var proxy=new ObjectProxy();
proxy.onUpdate=pbNewPaper_onUpdate;
proxy.Attach(ctrl,"uiObj");
var fObj=eval(path);
if(fObj){
proxy.Attach(fObj,"coll");
proxy.HookEvent("coll","onCollectionUpdate",proxy.onUpdate);}
var fObj=eval(PDS_Admin);
if(fObj){
proxy.Attach(fObj,"admin");}
proxy.onUpdate(null,null,null);
proxy.HookEvent("uiObj","onClick",func);}
function pbNewPaper_onUpdate(src,context,name){
var isEnab=true;
var coll=this.HostObj("coll");
var admin=this.HostObj("admin");
if(admin && admin.getValue()&& coll && coll.Max){
if(coll.Max.getValue()>coll.count){
isEnab=true;}}
this.HostObj("uiObj").isEnabled=isEnab;}
function showNewCustomPaperSize(src,context,name){
var edt=eval(PDS_EditUserPaper);
var sel=eval(PDS_AddUserPaper);
var trans=new Transaction();
sel.resId.setValue("");
var val=sel.maxX.getValue();
sel.xPhy.setValue(val);
var val=sel.maxY.getValue();
sel.yPhy.setValue(val);
edt.setValue(sel);
trans.evaluate();
trans.commit();
var rc=showFrame("dlgCustomPaperSize");}
function InitControl_pbEditPaperSize(ctrl,name){
var proxy=new FeatureGrpProxy(ctrl,[{id:"sel",path:PDS_SelUserPaper}]);
proxy.ChangeHandler=enab_pbCustomPaperSize;
proxy.Init();
ctrl.AddEventHandler("onClick",showEditCustomPaperSize);}
function showEditCustomPaperSize(src,context,name){
var edt=eval(PDS_EditUserPaper);
var sel=eval(PDS_SelUserPaper+".getValue()");
var trans=new Transaction();
edt.setValue(sel);
trans.evaluate();
trans.commit();
var rc=showFrame("dlgCustomPaperSize");}
function InitControl_pbRemovePaperSize(ctrl,name){
var proxy=new FeatureGrpProxy(ctrl,[{id:"sel",path:PDS_SelUserPaper}]);
proxy.ChangeHandler=enab_pbCustomPaperSize;
proxy.Init();
ctrl.AddEventHandler("onClick",onpbRemovePaperSize);}
function enab_pbCustomPaperSize(ctrl,src,values)
{				
	var ctrl1=controls("lbExistingSizes");
	ctrl.isEnabled=ctrl1.isEnabled;}
function onpbRemovePaperSize(src,context,name){
var size=eval(PDS_SelUserPaper+".getValue()");
	var msgbox=getMessageBox("mbUserPapCnfrmDel");
	msgbox.addParm(getPrinterInfo(2));
	msgbox.addParm(size.resId.getValue());
	if(msgbox.show(GetContainingFrame(src))=="Ok" )
	{
		var rps=eval(PDS_RemoveUserPaper);
		var trans=new Transaction(src);
		rps.UserPaper.setValue(size);
		rps.execute();
		trans.evaluate();
		trans.commit();
	}}
@END
@DocProps PrintProps
function onLoad_dlgCustomPaperSize(frame,name){
var edt=eval(PDS_EditUserPaper);
var sel=eval(PDS_AddUserPaper);
if(edt.getValue()==sel){
frame.AddEventHandler("onQueryTerminate", onTermNewUsrPap);}else{
frame.setLabel("!editCustPapSz" );
frame.AddEventHandler("onQueryTerminate", onTermEditUsrPap);
	var edt=eval(PDS_EditUserPaper);
	var feat=edt.getValue();
	feat.isEdited.setValue(true);}}
function onTermNewUsrPap(src,context,name){
if(context.data==1
&&((context.result===undefined)||(context.result==0))){
var trans=new Transaction(src);
var feat=eval(PDS_AddUserPaper);
feat.execute();
trans.evaluate();
trans.commit();}}
function onTermEditUsrPap(src,context,name){
if(context.data==1
&&((context.result===undefined)||(context.result==0))){
var trans=new Transaction(src);
var feat=eval(PDS_EditUserPaper1);
feat.execute();
trans.evaluate();
trans.commit();}}
function ValidateUsrPap(src){
var err;
var edt=eval(PDS_EditUserPaper);
var feat=edt.getValue();
var rawName=feat.resId.getValue();
var name=stripLT(rawName);
if(name.length>0){
if(name!=rawName){
var trans=new Transaction(src);
feat.resId.setValue(name);
trans.evaluate();
trans.commit();}
var collection=eval(PDS_AllServerPapers);
for(var enumObjects=new Enumerator(collection);
!enumObjects.atEnd();
enumObjects.moveNext()){
var collObject=enumObjects.item();
var colObjName=collObject.resId.getValue();
if(colObjName.charAt(0)=="!"){
colObjName=getTranslation(colObjName);}
if(feat!=collObject
&& colObjName.toLowerCase()==name.toLowerCase()){
err={msg:"mbPszNameDup",ctrl:"ebPaperSize"};
break;}}}else{
err={msg:"mbPszName",ctrl:"ebPaperSize"};}
return err;}
function InitControl_ebPaperSize(ctrl,name){
ctrl.setTextLimit(31);
var px=new EditBoxContProxy(ctrl);
var ap=px.AttachFeature([PDS_EditUserPaper,"resId"]);
ap.fKeyId=null;
	var edt=eval(PDS_EditUserPaper);
var sel=eval(PDS_AddUserPaper);
if(edt.getValue()!=sel){
		ctrl.isEnabled=false;
	}
px.Init();
HookValidationEvents(px,px.GetUiObjId(),ebPaperSize_FeatValidate,"feat");}
function ebPaperSize_FeatValidate(src){
var rc=1;
var msg;
var edt=eval(PDS_EditUserPaper);
var feat=edt.getValue();
var rawName=feat.resId.getValue();
var name=stripLT(rawName);
if(name.length>0){
if(name!=rawName){
var trans=new Transaction(src);
feat.resId.setValue(name);
trans.evaluate();
trans.commit();}
var collection=eval(PDS_AllServerPapers);
for(var enumObjects=new Enumerator(collection);
!enumObjects.atEnd();
enumObjects.moveNext()){
var collObject=enumObjects.item();
var colObjName=collObject.resId.getValue();
		var colObjVal="Letter";
		if(collObject.isCustomPaper.getValue()==false)
			colObjVal=collObject.getValue();
if(colObjName.charAt(0)=="!"){
colObjName=getTranslation(colObjName);}
if(feat!=collObject
&&((colObjName.toLowerCase()==name.toLowerCase())
			 ||(colObjVal.toLowerCase()==name.toLowerCase()))){
msg="mbPszNameDup";
break;}}}else{
msg="mbPszName";}
if(msg){
this.HostObj(this.GetUiObjId()).isFocus=true;
var mb=getMessageBox(msg);
mb.addParm(getPrinterInfo(2));
mb.show(GetContainingFrame(src));
rc=-1;}
return rc;}
function init_ebPaperDim(ctrl,name, label, attrib,min,max){
var px=new ContainerProxy(ctrl);
var ap=new VariablePathProxy();
ap.AttachFeature([PDS_EditUserPaper,"Units"]);
px.AttachComponent(ap,"units");
var ap=new VariablePathProxy();
ap.fKeyId=null;
ap.AttachFeature(PDS_MasterUnits);
px.AttachComponent(ap,"mUnits");
var ap=new VariablePathProxy();
ap.fKeyId=null;
ap.AttachFeature([PDS_UserPaperSpec+"."+min]);
px.AttachComponent(ap,"min");
var ap=new VariablePathProxy();
ap.fKeyId=null;
ap.AttachFeature([PDS_UserPaperSpec+"."+max]);
px.AttachComponent(ap,"max");
px.SetUiVal=ebPaperDim_SetRange;
px.Init();
var px=new EditBoxContProxy(ctrl);
ctrl.label=getTranslation(label).replace(/[&:]/g,"");
px.isNumeric=true;
var ap=new VariablePathProxy();
ap.fKeyId=null;
ap.AttachFeature([PDS_EditUserPaper,attrib]);
px.AttachComponent(ap,"pos");
var ap=new VariablePathProxy();
ap.AttachFeature([PDS_EditUserPaper,"Units"]);
px.AttachComponent(ap,"units");
var ap=new VariablePathProxy();
ap.fKeyId=null;
ap.AttachFeature(PDS_MasterUnits);
px.AttachComponent(ap,"mUnits");
var ap=new VariablePathProxy();
ap.fKeyId=null;
ap.AttachFeature([PDS_UserPaperSpec+"."+min]);
px.AttachComponent(ap,"min");
var ap=new VariablePathProxy();
ap.fKeyId=null;
ap.AttachFeature([PDS_UserPaperSpec+"."+max]);
px.AttachComponent(ap,"max");
px.Convert=ebEUP_Convert;
HookValidationEvents(px,px.GetUiObjId(),ebPaperDim_UiValidate,"ui");
px.Init();}
function ebPaperDim_UiValidate(src){
var rc=1;
var uiObj=this.HostObj(this.GetUiObjId());
var crntVal=this.GetUiVal(uiObj);
var edt=eval(PDS_EditUserPaper);
var feat=edt.getValue();
var sel=eval(PDS_AddUserPaper);
var masterUnits=eval(PDS_MasterUnits);
var mUnits=masterUnits.getValue();
var units=this.GetComponent("units").GetCompValue();
if(units!="inches"){
crntVal=(crntVal*10)/254;}
crntVal=crntVal * mUnits;
if(uiObj.name=="ebPaperWidth"){
var minX=sel.minX.getValue();
var maxX=sel.maxX.getValue();
if(crntVal<minX){
crntVal=minX;}
if(crntVal>maxX){
crntVal=maxX;}
feat.xPhy.setValue(crntVal);}
else if(uiObj.name=="ebPaperLength"){
var minY=sel.minY.getValue();
var maxY=sel.maxY.getValue();
if(crntVal<minY){
crntVal=minY;}
if(crntVal>maxY){
crntVal=maxY;}
feat.yPhy.setValue(crntVal);}
return rc;}
function ebPaperDim_SetRange(uiObj,values){
var min=ebEUP_Base2Display(values.min,values.mUnits,values.units);
var max=ebEUP_Base2Display(values.max,values.mUnits,values.units);
if(values.units=="inches"){
min=Math.round(min*100);
max=Math.round(max*100);
uiObj.setValueTable(min+"."+max+".100");
}else{
min=Math.round(min);
max=Math.round(max);
uiObj.setValueTable(min+"."+max);}}
function InitControl_ebPaperWidth(ctrl,name){
init_ebPaperDim(ctrl,name, "!sPaperWidth", "xPhy","minX","maxX");}
function InitControl_ebPaperLength(ctrl,name){
init_ebPaperDim(ctrl,name, "!sPaperLength", "yPhy","minY","maxY");}
function ebEUP_Convert(direction,inVal){
var outVal;
if(direction=="c2f"){
var unitsPerInch=this.GetComponent("mUnits").GetCompValue();
var units=this.GetComponent("units").GetCompValue();
var min=this.GetComponent("min").GetCompValue();
var max=this.GetComponent("max").GetCompValue();
outVal=ebEUP_Display2Base(inVal,unitsPerInch,units,min,max);
outVal={pos : outVal};
}else{
outVal=ebEUP_Base2Display(inVal.pos,inVal.mUnits,inVal.units);}
return outVal;}
function ebEUP_Base2Display(inVal,unitsPerInch,units){
var outVal;
if(inVal!==undefined){
if(units=="inches"){
outVal=inVal*100/unitsPerInch;
outVal=Math.round(outVal)/100;
}else{
outVal=inVal*254/unitsPerInch;
outVal=Math.round(outVal/10);}}
return outVal;}
function ebEUP_Display2Base(inVal,unitsPerInch,units,min,max){
var outVal;
if(units=="inches"){
outVal=inVal*unitsPerInch/1.0;
}else{
outVal=inVal*unitsPerInch/25.4;}
outVal=Math.round(outVal);
if(outVal<min){
outVal=min;}
if(outVal>max){
outVal=max;}
return outVal;}
function InitControl_rbPaperSizeInches(ctrl,name){
var px=new OptionButtonProxy(ctrl);
px.onKey="inches";
px.AttachFeature([PDS_EditUserPaper,"Units"]);
px.Init();}
function InitControl_rbPaperSizeMm(ctrl,name){
var px=new OptionButtonProxy(ctrl);
px.onKey="mm";
px.AttachFeature([PDS_EditUserPaper,"Units"]);
px.Init();}
function InitControl_sWidthRng(ctrl,name){
var px=new ContainerProxy(ctrl);
var ap=new VariablePathProxy();
ap.fKeyId=null;
ap.AttachFeature(PDS_UserPaperSpec+".minX");
px.AttachComponent(ap,"min");
var ap=new VariablePathProxy();
ap.fKeyId=null;
ap.AttachFeature(PDS_UserPaperSpec+".maxX");
px.AttachComponent(ap,"max");
var ap=new VariablePathProxy();
ap.fKeyId=null;
ap.AttachFeature([PDS_EditUserPaper,"Units"]);
px.AttachComponent(ap,"units");
var ap=new VariablePathProxy();
ap.fKeyId=null;
ap.AttachFeature(PDS_MasterUnits);
px.AttachComponent(ap,"mUnits");
px.SetUiVal=sUPSize_Set;
px.Init();}
function InitControl_sLengthRng(ctrl,name){
var px=new ContainerProxy(ctrl);
var ap=new VariablePathProxy();
ap.fKeyId=null;
ap.AttachFeature(PDS_UserPaperSpec+".minY");
px.AttachComponent(ap,"min");
var ap=new VariablePathProxy();
ap.fKeyId=null;
ap.AttachFeature(PDS_UserPaperSpec+".maxY");
px.AttachComponent(ap,"max");
var ap=new VariablePathProxy();
ap.fKeyId=null;
ap.AttachFeature([PDS_EditUserPaper,"Units"]);
px.AttachComponent(ap,"units");
var ap=new VariablePathProxy();
ap.fKeyId=null;
ap.AttachFeature(PDS_MasterUnits);
px.AttachComponent(ap,"mUnits");
px.SetUiVal=sUPSize_Set;
px.Init();}
function sUPSize_Set(uiObj,values){
var min=ebEUP_Base2Display(values.min,values.mUnits,values.units.nameId.getValue());
var max=ebEUP_Base2Display(values.max,values.mUnits,values.units.nameId.getValue());
var lbl="(" + min+" - " + max+")";
uiObj.setLabel(lbl);}
function InitControl_sWidthUnit(ctrl,name){
var px=new ContainerProxy(ctrl);
var ap=new VariablePathProxy();
ap.fKeyId=null;
ap.AttachFeature([PDS_EditUserPaper,"Units"]);
px.AttachComponent(ap,"units");
px.SetUiVal=sUnit_Set;
px.Init();}
function InitControl_sLengthUnit(ctrl,name){
var px=new ContainerProxy(ctrl);
var ap=new VariablePathProxy();
ap.fKeyId=null;
ap.AttachFeature([PDS_EditUserPaper,"Units"]);
px.AttachComponent(ap,"units");
px.SetUiVal=sUnit_Set;
px.Init();}
function sUnit_Set(uiObj,values){
var units=values.units.nameId.getValue();
var unitlbl="!mm";
if(units=="inches")
	 unitlbl="!in";
uiObj.setLabel(unitlbl);}
@END
@DocProps
function onLoad_dlgMoreInput(frame,name){}
function InitControl_lbPageOptions(ctrl,name){
	var proxy=new ObjectProxy();
	var fObj=eval(PDS_MISPageOptions);
	if(fObj)
	{
	 proxy.Attach(ctrl,"uiObj");
	 proxy.Attach(fObj,"feat");
	 proxy.onUpdate=OnListUpdate;
	 proxy.HookEvent("feat","onCollectionUpdate",proxy.onUpdate);
	 proxy.onUpdate(proxy.HostObj("feat"),null,null);
	}
	var trans=new Transaction(ctrl);
	var collection=eval(PDS_MISPageOptions);
	for(var enumObjects=new Enumerator(collection);
		 !enumObjects.atEnd();
		 enumObjects.moveNext())
	{
	 var collObject=enumObjects.item();
	 var colObjName=collObject.resId.getValue();
	 if(colObjName=="!pSzFrontCover")
	{
		 if((eval(PDS_chkMIFrontCover).getValue()))
		{
			 collObject.Icon.setValue("CircleCheck")
		}
		 else
		{
			 collObject.Icon.setValue("")
		}
	}
	 else if(colObjName=="!pSzFirstPage")
	{
		 if((eval(PDS_chkMIFirstPage).getValue()))
		{
			 collObject.Icon.setValue("CircleCheck")
		}
		 else
		{
			 collObject.Icon.setValue("")
		}
	}
	 else if(colObjName=="!pSzLastPage")
	{
		 if((eval(PDS_chkMILastPage).getValue()))
		{
			 collObject.Icon.setValue("CircleCheck")
		}
		 else
		{
			 collObject.Icon.setValue("")
		}
	}
	 else if(colObjName=="!pSzBackCover")
	{
		 if((eval(PDS_chkMIBackCover).getValue()))
		{
			 collObject.Icon.setValue("CircleCheck")
		}
		 else
		{
			 collObject.Icon.setValue("")
		}
	}
	}
	trans.evaluate();
	trans.commit();
	var px=new ListBoxProxy(ctrl);
	px.textId="resId";
	px.GetIconFromOptObj=lb_GetIconFromOptObj;	
	px.AttachFeature(PDS_MISPageOptions);
	px.Init();}
function OnListUpdate(src,context,name){
this.HostObj("uiObj").isEnabled=(src.count ? true : false);}
function lb_GetIconFromOptObj(collObj){
	var icon;
	var org=collObj.Icon.getValue();
	if(org=="CircleCheck")
	{
	 icon="CircleCheck";
	}
	else
	{
	 icon="";
	}
	return icon;}
function InitControl_chkMIFrontCover(ctrl,name){
var px=new ButtonProxy(ctrl);
px.AttachFeature(PDS_chkMIFrontCover);
px.Init();
ctrl.AddEventHandler("onClick",setControlStateForFrontCover);
var px=new ContainerProxy(ctrl);
var ap=new VariablePathProxy();
ap.fKeyId="resId";
ap.AttachFeature(PDS_MISPageOptions);
px.AttachComponent(ap,"name");
px.SetUiVal=ShowCheckFrontCover;
px.Init();}
function ShowCheckFrontCover(uiObj,values){
var isVisible=true;
if(values.name!="!pSzFrontCover"){
isVisible=false;}
uiObj.isVisible=isVisible;}
function InitControl_chkMIFirstPage(ctrl,name){
var px=new ButtonProxy(ctrl);
px.AttachFeature(PDS_chkMIFirstPage);
px.Init();
ctrl.AddEventHandler("onClick",setControlStateForFirstPage);
var px=new ContainerProxy(ctrl);
var ap=new VariablePathProxy();
ap.fKeyId="resId";
ap.AttachFeature(PDS_MISPageOptions);
px.AttachComponent(ap,"name");
px.SetUiVal=ShowCheckFirstPage;
px.Init();}
function ShowCheckFirstPage(uiObj,values){
var isVisible=true;
if(values.name!="!pSzFirstPage"){
isVisible=false;}
uiObj.isVisible=isVisible;}
function InitControl_chkMILastPage(ctrl,name){
var px=new ButtonProxy(ctrl);
px.AttachFeature(PDS_chkMILastPage);
px.Init();
ctrl.AddEventHandler("onClick",setControlStateForLastPage);
var px=new ContainerProxy(ctrl);
var ap=new VariablePathProxy();
ap.fKeyId="resId";
ap.AttachFeature(PDS_MISPageOptions);
px.AttachComponent(ap,"name");
px.SetUiVal=ShowCheckLastPage;
px.Init();}
function ShowCheckLastPage(uiObj,values){
var isVisible=true;
if(values.name!="!pSzLastPage"){
	isVisible=false;}
uiObj.isVisible=isVisible;}
function InitControl_chkMIBackCover(ctrl,name){
var px=new ButtonProxy(ctrl);
px.AttachFeature(PDS_chkMIBackCover);
px.Init();
ctrl.AddEventHandler("onClick",setControlStateForBackCover);
var px=new ContainerProxy(ctrl);
var ap=new VariablePathProxy();
ap.fKeyId="resId";
ap.AttachFeature(PDS_MISPageOptions);
px.AttachComponent(ap,"name");
px.SetUiVal=ShowCheckBackCover;
px.Init();}
function ShowCheckBackCover(uiObj,values){
var isVisible=true;
if(values.name!="!pSzBackCover"){
	isVisible=false;}
uiObj.isVisible=isVisible;}
function InitControl_cbMIPaperTrayFrontCover(ctrl,name){
var px=new ListBoxProxy(ctrl);
px.AttachFeature(PDS_cbMIPaperSourceFrontCover);
px.Init();
var px=new ContainerProxy(ctrl);
var ap=new VariablePathProxy();
ap.fKeyId="resId";
ap.AttachFeature(PDS_MISPageOptions);
px.AttachComponent(ap,"name");
px.SetUiVal=ShowFrontCoverCombo;
px.Init();
var trans=new Transaction(ctrl);
if(!(eval(PDS_chkMIFrontCover).getValue())){
	 eval(PDS_cbMIPaperSourceFrontCover).setValue(eval(PDS_PaperSource).getValue());}
trans.evaluate();
trans.commit();}
function InitControl_cbMIPaperTypeFrontCover(ctrl,name){
var px=new ListBoxProxy(ctrl);
px.AttachFeature(PDS_cbMIPaperTypeFrontCover);
px.Init();
var px=new ContainerProxy(ctrl);
var ap=new VariablePathProxy();
ap.fKeyId="resId";
ap.AttachFeature(PDS_MISPageOptions);
px.AttachComponent(ap,"name");
px.SetUiVal=ShowFrontCoverCombo;
px.Init();
var trans=new Transaction(ctrl);
if(!(eval(PDS_chkMIFrontCover).getValue())){
	 eval(PDS_cbMIPaperTypeFrontCover).setValue(eval(PDS_PaperType).getValue());}
trans.evaluate();
trans.commit();}
function ShowFrontCoverCombo(uiObj,values){
var isEnabled=eval(PDS_chkMIFrontCover).getValue();
uiObj.isEnabled=isEnabled;
var isVisible=true;
if(values.name!="!pSzFrontCover"){
	isVisible=false;}
uiObj.isVisible=isVisible;}
function InitControl_cbMIPaperTrayFirstPage(ctrl,name){
var px=new ListBoxProxy(ctrl);
px.AttachFeature(PDS_cbMIPaperSourceFirstPage);
px.Init();
var px=new ContainerProxy(ctrl);
var ap=new VariablePathProxy();
ap.fKeyId="resId";
ap.AttachFeature(PDS_MISPageOptions);
px.AttachComponent(ap,"name");
px.SetUiVal=ShowFirstPageCombo;
px.Init();
var trans=new Transaction(ctrl);
if(!(eval(PDS_chkMIFirstPage).getValue())){
	 eval(PDS_cbMIPaperSourceFirstPage).setValue(eval(PDS_PaperSource).getValue());}
trans.evaluate();
trans.commit();}
function InitControl_cbMIPaperTypeFirstPage(ctrl,name){
var px=new ListBoxProxy(ctrl);
px.AttachFeature(PDS_cbMIPaperTypeFirstPage);
px.Init();
var px=new ContainerProxy(ctrl);
var ap=new VariablePathProxy();
ap.fKeyId="resId";
ap.AttachFeature(PDS_MISPageOptions);
px.AttachComponent(ap,"name");
px.SetUiVal=ShowFirstPageCombo;
px.Init();
var trans=new Transaction(ctrl);
if(!(eval(PDS_chkMIFirstPage).getValue())){
	 eval(PDS_cbMIPaperTypeFirstPage).setValue(eval(PDS_PaperType).getValue());}
trans.evaluate();
trans.commit();}
function ShowFirstPageCombo(uiObj,values){
	var isEnabled=eval(PDS_chkMIFirstPage).getValue();
	uiObj.isEnabled=isEnabled;
	var isVisible=true;
	if(values.name!="!pSzFirstPage")
	{
	 isVisible=false;
	}
	uiObj.isVisible=isVisible;}
function InitControl_cbMIPaperTrayLastPage(ctrl,name){
var px=new ListBoxProxy(ctrl);
px.AttachFeature(PDS_cbMIPaperSourceLastPage);
px.Init();
var px=new ContainerProxy(ctrl);
var ap=new VariablePathProxy();
ap.fKeyId="resId";
ap.AttachFeature(PDS_MISPageOptions);
px.AttachComponent(ap,"name");
px.SetUiVal=ShowLastPageCombo;
px.Init();
var trans=new Transaction(ctrl);
if(!(eval(PDS_chkMILastPage).getValue())){
	 eval(PDS_cbMIPaperSourceLastPage).setValue(eval(PDS_PaperSource).getValue());}
trans.evaluate();
trans.commit();}
function InitControl_cbMIPaperTypeLastPage(ctrl,name){
var px=new ListBoxProxy(ctrl);
px.AttachFeature(PDS_cbMIPaperTypeLastPage);
px.Init();
var px=new ContainerProxy(ctrl);
var ap=new VariablePathProxy();
ap.fKeyId="resId";
ap.AttachFeature(PDS_MISPageOptions);
px.AttachComponent(ap,"name");
px.SetUiVal=ShowLastPageCombo;
px.Init();
var trans=new Transaction(ctrl);
if(!(eval(PDS_chkMILastPage).getValue())){
	 eval(PDS_cbMIPaperTypeLastPage).setValue(eval(PDS_PaperType).getValue());}
trans.evaluate();
trans.commit();}
function ShowLastPageCombo(uiObj,values){
	var isEnabled=eval(PDS_chkMILastPage).getValue();
	uiObj.isEnabled=isEnabled;
	var isVisible=true;
	if(values.name!="!pSzLastPage")
	{
	 isVisible=false;
	}
	uiObj.isVisible=isVisible;}
function InitControl_cbMIPaperTrayBackCover(ctrl,name){
var px=new ListBoxProxy(ctrl);
px.AttachFeature(PDS_cbMIPaperSourceBackCover);
px.Init();
var px=new ContainerProxy(ctrl);
var ap=new VariablePathProxy();
ap.fKeyId="resId";
ap.AttachFeature(PDS_MISPageOptions);
px.AttachComponent(ap,"name");
px.SetUiVal=ShowBackCoverCombo;
px.Init();
var trans=new Transaction(ctrl);
if(!(eval(PDS_chkMIBackCover).getValue())){
	 eval(PDS_cbMIPaperSourceBackCover).setValue(eval(PDS_PaperSource).getValue());}
trans.evaluate();
trans.commit();}
function InitControl_cbMIPaperTypeBackCover(ctrl,name){
var px=new ListBoxProxy(ctrl);
px.AttachFeature(PDS_cbMIPaperTypeBackCover);
px.Init();
var px=new ContainerProxy(ctrl);
var ap=new VariablePathProxy();
ap.fKeyId="resId";
ap.AttachFeature(PDS_MISPageOptions);
px.AttachComponent(ap,"name");
px.SetUiVal=ShowBackCoverCombo;
px.Init();
var trans=new Transaction(ctrl);
if(!(eval(PDS_chkMIBackCover).getValue())){
	 eval(PDS_cbMIPaperTypeBackCover).setValue(eval(PDS_PaperType).getValue());}
trans.evaluate();
trans.commit();}
function ShowBackCoverCombo(uiObj,values){
	var isEnabled=eval(PDS_chkMIBackCover).getValue();
	uiObj.isEnabled=isEnabled;
	var isVisible=true;
	if(values.name!="!pSzBackCover")
	{
	 isVisible=false;
	}
	uiObj.isVisible=isVisible;}
function setControlStateForFrontCover(src,context,name){
	if(controls("chkMIFrontCover").isChecked==true)
	{
		controls("cbMIPaperTrayFrontCover").isEnabled=true;
		controls("cbMIPaperTypeFrontCover").isEnabled=true;
	}
	else
	{
		controls("cbMIPaperTrayFrontCover").isEnabled=false;
		controls("cbMIPaperTypeFrontCover").isEnabled=false;
	}
	var trans=new Transaction(src);
	var feat=eval(PDS_MISFrontCoverProc);
	feat.execute();
	trans.evaluate();
	trans.commit();}
function setControlStateForFirstPage(src,context,name){
	if(controls("chkMIFirstPage").isChecked==true)
	{
		controls("cbMIPaperTrayFirstPage").isEnabled=true;
		controls("cbMIPaperTypeFirstPage").isEnabled=true;
	}
	else
	{
		controls("cbMIPaperTrayFirstPage").isEnabled=false;
		controls("cbMIPaperTypeFirstPage").isEnabled=false;
	}
	var trans=new Transaction(src);
	var feat=eval(PDS_MISFirstPageProc);
	feat.execute();
	trans.evaluate();
	trans.commit();}
function setControlStateForLastPage(src,context,name){
	if(controls("chkMILastPage").isChecked==true)
	{
		controls("cbMIPaperTrayLastPage").isEnabled=true;
		controls("cbMIPaperTypeLastPage").isEnabled=true;
	}
	else
	{
		controls("cbMIPaperTrayLastPage").isEnabled=false;
		controls("cbMIPaperTypeLastPage").isEnabled=false;
	}
	var trans=new Transaction(src);
	var feat=eval(PDS_MISLastPageProc);
	feat.execute();
	trans.evaluate();
	trans.commit();}
function setControlStateForBackCover(src,context,name){
	if(controls("chkMIBackCover").isChecked==true)
	{
		controls("cbMIPaperTrayBackCover").isEnabled=true;
		controls("cbMIPaperTypeBackCover").isEnabled=true;
	}
	else
	{
		controls("cbMIPaperTrayBackCover").isEnabled=false;
		controls("cbMIPaperTypeBackCover").isEnabled=false;
	}
	var trans=new Transaction(src);
	var feat=eval(PDS_MISBackCoverProc);
	feat.execute();
	trans.evaluate();
	trans.commit();}
function InitControl_grpPageOption(ctrl,name){
var px=new ContainerProxy(ctrl);
var ap=new VariablePathProxy();
ap.fKeyId="resId";
ap.AttachFeature(PDS_MISPageOptions);
px.AttachComponent(ap,"name");
px.SetUiVal=ShowGroupBoxText;
px.Init();}
function ShowGroupBoxText(uiObj,values){
	uiObj.setLabel(values.name);}
function InitControl_sDefaultPaperType(ctrl,name){
	var px=new SelectItemAttrProxy(ctrl);
	px.SetAttr=InitControl_sDefaultPaperType.SetLabel;
	px.AttachFeature(PDS_PaperType);}
function InitControl_sDefaultPaperType.SetLabel(uiObj,value){
uiObj.setLabel(value);}
function InitControl_sDefaultPaperSource(ctrl,name){
	var px=new SelectItemAttrProxy(ctrl);
	px.SetAttr=InitControl_sDefaultPaperSource.SetLabel;
	px.AttachFeature(PDS_PaperSource);}
function InitControl_sDefaultPaperSource.SetLabel(uiObj,value){
uiObj.setLabel(value);}
function InitControl_pbMoreInputHelp(ctrl,name){
ctrl.AddEventHandler("onClick",MPLHelp);}
function MPLHelp(evt){
showHelp(evt,"Context",1);}
@END
@DocProps
function InitControl_rbDriver(ctrl,name){
debugger
var px=new OptionButtonProxy(ctrl);
px.onKey="OFF";
px.AttachFeature(PDS_PrinterLimit);
px.Init();}
function InitControl_rbPhysical(ctrl,name){
debugger
var px=new OptionButtonProxy(ctrl);
px.onKey="ON";
px.AttachFeature(PDS_PrinterLimit);
px.Init();}
function InitControl_chkMetaSpooling(ctrl,name){
var proxy=new ButtonProxy(ctrl);
proxy.AttachFeature(PDS_MetaFile);
proxy.Init();}
function InitControl_rbSpoolAuto(ctrl,name){
var px=new OptionButtonProxy(ctrl);
px.onKey="Automatic";
px.AttachFeature(PDS_MetafileSpooling);
px.Init();}
function InitControl_rbSpoolOff(ctrl,name){
var px=new OptionButtonProxy(ctrl);
px.onKey="Off";
px.AttachFeature(PDS_MetafileSpooling);
px.Init();}
function InitControl_rbSpoolOn(ctrl,name){
var px=new OptionButtonProxy(ctrl);
px.onKey="On";
px.AttachFeature(PDS_MetafileSpooling);
px.Init();}
function InitControl_pbHelpPCL(ctrl,name){
ctrl.AddEventHandler("onClick",HelpPCL);}
function HelpPCL(evt){
showHelp(evt,"Context",0);}
@END
@DocProps PrintProps
@END
