<% var kEvent = { accessDenied:0, failedEmail:1, failedPassword:2, login:4, logout:5, addAction:10, editAction:11, deleteAction:12, addRole:20, editRole:21, deleteRole:22, addUser:30, editUser:31, deleteUser:32, editOptionSet:40, addOptionPlan:50, editOptionPlan:51, deleteOptionPlan:52, addVestPlan:60, editVestPlan:61, deleteVestPlan:62, addGrant:70, editGrant:71, deleteGrant:72, pageView:255 }; var kAccessLevel = { noAccess:0, readOnly:1, edit:2, admin:3, su:4 }; var loginError = { noError:0, failedEmail:1, failedPassword:2 }; var root = Request.ServerVariables("SCRIPT_NAME")(); var url = root+((url=Request.ServerVariables("QUERY_STRING")()).length>0?"?":"")+url; var page = root.substr(root.lastIndexOf("/")+1); function AddLog(eventType,foreignKey,data){ DebugOut('AddLog('+eventType+','+foreignKey+','+data+')',2); if (data==null && eventType==kEvent.pageView) data = url; data = data==null ? "NULL" : SQLString(data); var ip = Request.ServerVariables("REMOTE_ADDR")(); ExecuteSQL("sp_InsertLog",SQLString(ip),eventType,Session("userID")?Session("userID"):null,foreignKey,data); } Math.randomMax=function(max,float){ max=Math.random()*max; return float?max:Math.round(max) } Date.prototype.customFormat = function(formatString){ var YYYY,YY,MMMM,MMM,MM,M,DDDD,DDD,DD,D,hhh,hh,h,mm,m,ss,s,ampm,AMPM,dMod,th; var dateObject = this; YY = ((YYYY=dateObject.getFullYear())+"").substr(2,2); MM = (M=dateObject.getMonth()+1)<10?('0'+M):M; MMM = (MMMM=["January","February","March","April","May","June","July","August","September","October","November","December"][M-1]).substr(0,3); DD = (D=dateObject.getDate())<10?('0'+D):D; DDD = (DDDD=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][dateObject.getDay()]).substr(0,3); th=(D>=10&&D<=20)?'th':((dMod=D%10)==1)?'st':(dMod==2)?'nd':(dMod==3)?'rd':'th'; formatString = formatString.replace("#YYYY#",YYYY).replace("#YY#",YY).replace("#MMMM#",MMMM).replace("#MMM#",MMM).replace("#MM#",MM).replace("#M#",M).replace("#DDDD#",DDDD).replace("#DDD#",DDD).replace("#DD#",DD).replace("#D#",D).replace("#th#",th); h=(hhh=dateObject.getHours()); if (h==0) h=24; if (h>12) h-=12; hh = h<10?('0'+h):h; AMPM=(ampm=hhh<12?'am':'pm').toUpperCase(); mm=(m=dateObject.getMinutes())<10?('0'+m):m; ss=(s=dateObject.getSeconds())<10?('0'+s):s; return formatString.replace("#hhh#",hhh).replace("#hh#",hh).replace("#h#",h).replace("#mm#",mm).replace("#m#",m).replace("#ss#",ss).replace("#s#",s).replace("#ampm#",ampm).replace("#AMPM#",AMPM); } Date.prototype.sqlDate = function(){ return this.customFormat("'#MM#/#DD#/#YYYY#'") } Date.prototype.sqlDateTime = function(){ return this.customFormat("'#MM#/#DD#/#YYYY# #hhh#:#mm#:#ss#'") } Date.prototype.standardFormat = function(){ return this.customFormat("#MM#/#DD#/#YYYY#") } Array.prototype.applyToEach=function(f){ for (var i=0,len=this.length;i0){ frac = n.substr(breakPoint); if (frac.length=lv)){ Response.Write(""+msg+"\n"); if (Response.Buffer) Response.Flush(); } } function GetSelect(optionSetName,selectedIDs){ //selectedIDs can be a single ID, or an array of IDs which should be selected if (!selectedIDs) selectedIDs=[]; if (!selectedIDs.slice) selectedIDs=[selectedIDs]; for (var i=0,len=selectedIDs.length;i'+opts[i].name+''; return sel; } var reqd = '*'; %>