/* dlgs.js - FINRA dialogs (FDlgs) module */
var FDlgs=(function(b){var c={};var a={url:"",name:"",title:"",query_str:"",width:500,height:500,result_map:{},result_effect:"",ok_label:"OK",cancel_label:"Cancel",success_fxn:function(){},cancel_fxn:function(){}};c.OpenModal=function(d){var f;var g=50;var j=120;var h=(Sys.Browser.agent==Sys.Browser.InternetExplorer);var i=b.extend(true,{},a,d);var k={};if(i.cancel_label.length>0){k[i.cancel_label]=function(){b(this).dialog("close");b(this).dialog("destroy");i.cancel_fxn.call();};}k[i.ok_label]=function(){if(b.isFunction(f.Validate)){if(!f.Validate()){return;}}b.each(i.result_map,function(l,m){b(m).val(b(f.document.body).find(l).val());b(m).effect(i.result_effect,{},400);});b(this).dialog("close");b(this).dialog("destroy");i.success_fxn.call();};i.width=h?i.width:i.width+50;i.height=h?i.height:i.height+10;b("#tmp-dlg-ifr").remove();var e="<iframe id='tmp-dlg-ifr' title='"+i.title+"' src='"+i.url+i.name+".aspx"+i.query_str+"' frameborder='0' scrolling='no' />";b(e).dialog({autoOpen:true,resizable:false,width:i.width,height:i.height,modal:true,buttons:k,close:function(){b(this).dialog("destroy");},open:function(){}}).width(i.width-g).height(i.height-j);f=b("#tmp-dlg-ifr")[0].contentWindow;};return c;}(jQuery));
