if(!iQ.Ajax){alert('iQAjax.js Not Loaded');}; if(!iQ.Utils){alert('iQUtils.js Not Loaded');}; YAHOO.util.Event.addListener(window,"load",function(){doCreatePWatchForms()}); var m_CallbackFunc = null; var m_CallbackArgs = null; //important - set this if registration may be required (if you need to) // (when either calling login or registration forms) // use function below var m_PWPublicID = '2383'; var objLogin_Panel = null; var objLogin_Checker = null; var objRegister_Panel = null; var objRegister_Checker = null; var objPasswordReminder_Panel = null; var objPasswordReminder_Checker = null; var objSaveCriteria_Panel = null; var objSaveCriteria_Checker = null; var objUpdateProfile_Panel = null; var objUpdateProfile_Checker = null; var objAgentSelect_Panel = null; function SetPWPublicID(sPublicID){ m_PWPublicID = sPublicID; } function GetCriteriaParams(){ var params = ''; params += '"SearchType":"' + encodeURIComponent(iQ.Utils.getFieldValue('DataForm','SearchType')) + '",'; params += '"SearchList":"' + encodeURIComponent(iQ.Utils.getFieldValue('DataForm','SearchList')) + '",'; params += '"PropertyType":"' + encodeURIComponent(iQ.Utils.getFieldValue('DataForm','PropertyType')) + '",'; params += '"SiteID":"' + encodeURIComponent(iQ.Utils.getFieldValue('DataForm','SiteID_List')) + '",'; params += '"Images":"' + encodeURIComponent(iQ.Utils.getFieldValue('DataForm','ImagesMin')) + '",'; if(iQ.Utils.getFieldValue('DataForm','PropertyType') == 'Residential'){ params += '"PriceMin":"' + encodeURIComponent(iQ.Utils.getFieldValue('DataForm','Res_PriceMin')) + '",'; params += '"PriceMax":"' + encodeURIComponent(iQ.Utils.getFieldValue('DataForm','Res_PriceMax')) + '",'; params += '"Style":"' + encodeURIComponent(iQ.Utils.getFieldValue('DataForm','Res_StyleList')) + '",'; params += '"Beds":"' + encodeURIComponent(iQ.Utils.getFieldValue('DataForm','Res_BedsMin')) + '",'; params += '"Baths":"' + encodeURIComponent(iQ.Utils.getFieldValue('DataForm','Res_BathsMin')) + '",'; params += '"Sq_Foot":"' + encodeURIComponent(iQ.Utils.getFieldValue('DataForm','Res_SQFeetMin')) + '",'; params += '"Garage":"' + encodeURIComponent(iQ.Utils.getFieldValue('DataForm','Res_GarageMin')) + '",'; params += '"Story":"' + encodeURIComponent(iQ.Utils.getFieldValue('DataForm','Res_Story')) + '",'; params += '"Year_Built":"' + encodeURIComponent(iQ.Utils.getFieldValue('DataForm','Res_YearMin')) + '",'; params += '"Acreage":"' + encodeURIComponent(iQ.Utils.getFieldValue('DataForm','Res_AcreageMin')) + '",'; params += '"Pool":"' + encodeURIComponent(iQ.Utils.getFieldValue('DataForm','Res_Pool')) + '",'; params += '"SchoolDistrict":"' + encodeURIComponent(iQ.Utils.getFieldValue('DataForm','Res_SchoolDistrict')) + '",'; params += '"CommunityName":"' + encodeURIComponent(iQ.Utils.getFieldValue('DataForm','Res_CommunityName')) + '",'; params += '"SubType":"' + encodeURIComponent(iQ.Utils.getFieldValue('DataForm','Res_SubType')) + '",'; } if(iQ.Utils.getFieldValue('DataForm','PropertyType') == 'Land'){ params += '"PriceMin":"' + encodeURIComponent(iQ.Utils.getFieldValue('DataForm','Lan_PriceMin')) + '",'; params += '"PriceMax":"' + encodeURIComponent(iQ.Utils.getFieldValue('DataForm','Lan_PriceMax')) + '",'; params += '"Acreage":"' + encodeURIComponent(iQ.Utils.getFieldValue('DataForm','Lan_AcreageMin')) + '",'; params += '"Zoning":"' + encodeURIComponent(iQ.Utils.getFieldValue('DataForm','Lan_Zoning')) + '",'; params += '"SubType":"' + encodeURIComponent(iQ.Utils.getFieldValue('DataForm','Lan_SubType')) + '",'; } if(iQ.Utils.getFieldValue('DataForm','PropertyType') == 'Commercial'){ params += '"PriceMin":"' + encodeURIComponent(iQ.Utils.getFieldValue('DataForm','Com_PriceMin')) + '",'; params += '"PriceMax":"' + encodeURIComponent(iQ.Utils.getFieldValue('DataForm','Com_PriceMax')) + '",'; params += '"Sq_Foot":"' + encodeURIComponent(iQ.Utils.getFieldValue('DataForm','Com_SQFeetMin')) + '",'; params += '"Sq_Foot_Office":"' + encodeURIComponent(iQ.Utils.getFieldValue('DataForm','Com_SQFeetOfficeMin')) + '",'; params += '"Zoning":"' + encodeURIComponent(iQ.Utils.getFieldValue('DataForm','Com_Zoning')) + '",'; params += '"Story":"' + encodeURIComponent(iQ.Utils.getFieldValue('DataForm','Com_StoryMin')) + '",'; params += '"SubType":"' + encodeURIComponent(iQ.Utils.getFieldValue('DataForm','Com_SubType')) + '",'; } if(iQ.Utils.getFieldValue('DataForm','PropertyType') == 'MultiFamily'){ params += '"PriceMin":"' + encodeURIComponent(iQ.Utils.getFieldValue('DataForm','Mul_PriceMin')) + '",'; params += '"PriceMax":"' + encodeURIComponent(iQ.Utils.getFieldValue('DataForm','Mul_PriceMax')) + '",'; params += '"Buildings":"' + encodeURIComponent(iQ.Utils.getFieldValue('DataForm','Mul_BuildingsMin')) + '",'; params += '"Units":"' + encodeURIComponent(iQ.Utils.getFieldValue('DataForm','Mul_UnitsMin')) + '",'; params += '"SubType":"' + encodeURIComponent(iQ.Utils.getFieldValue('DataForm','Mul_SubType')) + '",'; } params = iQ.Utils.Left(params,params.length-1); return params; } function doLogoutAndRedirect(redirecturl){ iQ.Utils.SetCookie('isAuthenticated','F',0); iQ.Utils.SetCookie('AutoLogin','F',0); self.location = redirecturl; } function doLoginAndRedirect(redirecturl){ var isAuthed = iQ.Utils.GetCookie('isAuthenticated'); if(isAuthed == 'T'){ //clear these - either we got called back // or not - either way done m_CallbackFunc = null; m_CallbackArgs = null; //alert('here'); self.location = redirecturl; }else{ //login code will call back here // and this code gets skipped because auth will be true m_CallbackFunc = doLoginAndRedirect; m_CallbackArgs = arguments; var userid = iQ.Utils.GetCookie('UserID'); var password = iQ.Utils.GetCookie('Password'); var autologin = iQ.Utils.GetCookie('AutoLogin'); if(password){ iQ.Utils.setFieldValue('Login_Form','Password',password); iQ.Utils.setFieldValue('Login_Form','UserID',userid); iQ.Utils.setFieldValue('Login_Form','SaveLogin','T'); } if(autologin){ if(autologin == 'T'){ iQ.Utils.setFieldValue('Login_Form','AutoLogin','T'); } } objLogin_Panel.center(); objLogin_Panel.show(); } } function doSaveCriteria(){ var isAuthed = iQ.Utils.GetCookie('isAuthenticated'); if(isAuthed == 'T'){ //clear these - either we got called back // or not - either way done m_CallbackFunc = null; m_CallbackArgs = null; objSaveCriteria_Panel.center(); objSaveCriteria_Panel.show(); }else{ //login code will call back here // and this code gets skipped because auth will be true m_CallbackFunc = doSaveCriteria; m_CallbackArgs = arguments; objLogin_Panel.center(); objLogin_Panel.show(); } } function doSaveProperty(ML_Number,PropertyType){ var isAuthed = iQ.Utils.GetCookie('isAuthenticated'); if(isAuthed == 'T'){ //clear these - either we got called back // or not - either way done m_CallbackFunc = null; m_CallbackArgs = null; iQ.Utils.doShowProcessing(); var params = ''; params += '"ML_Number":"' + encodeURIComponent(ML_Number) + '"'; params += ','; params += '"PropertyType":"' + encodeURIComponent(PropertyType) + '"'; params += ','; params += '"UserID":"' + encodeURIComponent(iQ.Utils.GetCookie('UserID')) + '"'; params += ','; params += '"SelectedLanguage":"' + encodeURIComponent(iQ.Utils.GetCookie('SelectedLanguage')) + '"'; //alert(params); var _Ajax = new iQ.Ajax(); _Ajax.CFCMethod = 'doSaveProperty'; _Ajax.URL = '/websvc/PropertyWatch.cfc'; _Ajax.Params ={Params:'{' + params + '}'}; _Ajax.CallbackHandler = "onSaveProperty"; _Ajax.Send(); }else{ //login code will call back here // and this code gets skipped because auth will be true m_CallbackFunc = doSaveProperty; m_CallbackArgs = arguments; objLogin_Panel.center(); objLogin_Panel.show(); } } function onSaveProperty(jsonRet){ iQ.Utils.doHideProcessing(); if(jsonRet.RSERROR){ iQ.Utils.doMessagePanel('Message',jsonRet.ERRORMESSAGE); }else{ if(jsonRet.ERRORMESSAGE){ iQ.Utils.doMessagePanel('Message',jsonRet.ERRORMESSAGE); }else{ iQ.Utils.doMessagePanel('Message',jsonRet.MESSAGE); } } } function doShowLogin(){ var userid = iQ.Utils.GetCookie('UserID'); var password = iQ.Utils.GetCookie('Password'); var autologin = iQ.Utils.GetCookie('AutoLogin'); if(password){ iQ.Utils.setFieldValue('Login_Form','Password',password); iQ.Utils.setFieldValue('Login_Form','UserID',userid); iQ.Utils.setFieldValue('Login_Form','SaveLogin','T'); } if(autologin){ if(autologin == 'T'){ iQ.Utils.setFieldValue('Login_Form','AutoLogin','T'); } } objLogin_Panel.center(); objLogin_Panel.show(); } function doShowRegister(){ objLogin_Checker.doClearAllStatus(); objLogin_Panel.cancel(); iQ.Utils.setFieldValue('Register_Form','PublicID',m_PWPublicID); if(m_PWPublicID != ''){ var divPublicID= iQ.Utils.getBrowserObject('divPublicID'); divPublicID.style.visibility = 'hidden'; divPublicID.style.display = 'none'; } objRegister_Panel.center(); objRegister_Panel.show(); } function doShowPasswordReminder(){ objLogin_Checker.doClearAllStatus(); objLogin_Panel.cancel(); objPasswordReminder_Panel.center(); objPasswordReminder_Panel.show(); } function doPostLoginForm(){ iQ.Utils.doShowProcessing(); var params = iQ.Utils.BuildAjaxParamStruct('Login_Form'); //alert(params) var _Ajax = new iQ.Ajax(); _Ajax.CFCMethod = 'doLogin'; _Ajax.URL = '/websvc/PropertyWatch.cfc'; _Ajax.Params ={Params:'{' + params + '}'}; _Ajax.CallbackHandler = "onLogin"; _Ajax.Send(); } function onLogin(jsonRet){ iQ.Utils.doHideProcessing(); objLogin_Checker.doClearAllStatus(); objLogin_Panel.cancel(); if(!jsonRet.RSERROR && !jsonRet.ERRORMESSAGE){ iQ.Utils.SetCookie('isAuthenticated','T',365); iQ.Utils.SetCookie('UserID',jsonRet.USERID,365); iQ.Utils.SetCookie('FirstName',jsonRet.FIRSTNAME,365); iQ.Utils.SetCookie('LastName',jsonRet.LASTNAME,365); iQ.Utils.SetCookie('EmailAddress',jsonRet.EMAILADDRESS,365); iQ.Utils.SetCookie('TrackingID',jsonRet.TRACKINGID,365); //alert(jsonRet.EMAILADDRESS); //alert(jsonRet.USERID); if(jsonRet.SAVEINFO == 'T'){ iQ.Utils.SetCookie('Password',jsonRet.PASSWORD,365); }else{ iQ.Utils.SetCookie('Password',jsonRet.PASSWORD,0); } if(jsonRet.AUTOLOGIN == 'T'){ iQ.Utils.SetCookie('AutoLogin','T',365); }else{ iQ.Utils.SetCookie('AutoLogin','F',0); } } if(jsonRet.RSERROR){ iQ.Utils.doMessagePanel('Message',jsonRet.ERRORMESSAGE); }else{ if(jsonRet.ERRORMESSAGE){ iQ.Utils.doMessagePanel('Message',jsonRet.ERRORMESSAGE); }else{ if(m_CallbackFunc == null){ iQ.Utils.doMessagePanel('Message',jsonRet.MESSAGE); }else{ m_CallbackFunc.apply(this,m_CallbackArgs); } } } } function doLogoff(){ iQ.Utils.SetCookie('isAuthenticated','F',0); iQ.Utils.doMessagePanel('Message','Logoff Complete'); } function doPostRegisterForm(){ iQ.Utils.doShowProcessing(); var params = iQ.Utils.BuildAjaxParamStruct('Register_Form'); var _Ajax = new iQ.Ajax(); _Ajax.CFCMethod = 'doCreateUser'; _Ajax.URL = '/websvc/PropertyWatch.cfc'; _Ajax.Params ={Params:'{' + params + '}'}; _Ajax.CallbackHandler = "onPostRegisterReturn"; _Ajax.Send(); } function onPostRegisterReturn(jret){ if(!jret.RSERROR && !jret.ERRORMESSAGE && !jret.RSAGENTS && !jret.RSCONTACTS){ if(jret.PWSTATUS == 'A'){ iQ.Utils.SetCookie('isAuthenticated','T',365); } iQ.Utils.SetCookie('UserID',iQ.Utils.getFieldValue('Register_Form','UserID'),365); iQ.Utils.SetCookie('Password',iQ.Utils.getFieldValue('Register_Form','Password'),365); iQ.Utils.SetCookie('FirstName',iQ.Utils.getFieldValue('Register_Form','FirstName'),365); iQ.Utils.SetCookie('LastName',iQ.Utils.getFieldValue('Register_Form','LastName'),365); iQ.Utils.SetCookie('EmailAddress',iQ.Utils.getFieldValue('Register_Form','EmailAddress'),365); } iQ.Utils.doHideProcessing(); objRegister_Checker.doClearAllStatus(); if(jret.RSAGENTS){ doCreateAgentSelectPanel(jret.RSAGENTS); }else if(jret.RSCONTACTS){ doCreateContactSelectPanel(jret.RSCONTACTS); }else{ if(jret.RSERROR){ iQ.Utils.doMessagePanel('Message',jret.ERRORMESSAGE); }else{ if(jret.ERRORMESSAGE){ iQ.Utils.doMessagePanel('Message',jret.ERRORMESSAGE); }else{ objRegister_Panel.cancel(); if(jret.TRACKINGID){ iQ.Utils.SetCookie('TrackingID',jret.TRACKINGID,365); } if(jret.PWSTATUS == 'A'){ if(m_CallbackFunc == null){ iQ.Utils.doMessagePanel('Message',jret.MESSAGE); setTimeout("self.location = '/Default.cfm/Page=/PWatch.htm'",500); }else{ m_CallbackFunc.apply(this,m_CallbackArgs); } }else{ iQ.Utils.doMessagePanel('Message','Your account has been created but set to inactive. An email to the address ' + iQ.Utils.getFieldValue('Register_Form','EmailAddress') + '.Please follow the directions in the email to activate your account.'); } } } } } function doPostPasswordReminderForm(){ iQ.Utils.doShowProcessing(); var params = iQ.Utils.BuildAjaxParamStruct('PasswordReminder_Form'); var _Ajax = new iQ.Ajax(); _Ajax.CFCMethod = 'doPasswordReminder'; _Ajax.URL = '/websvc/PropertyWatch.cfc'; _Ajax.Params ={Params:'{' + params + '}'}; _Ajax.CallbackHandler = "onPasswordReminder"; _Ajax.Send(); } function onPasswordReminder(jsonRet){ iQ.Utils.doHideProcessing(); if(jsonRet.RSERROR){ iQ.Utils.doMessagePanel('Message','An unexpected error has occured. Please try again later.'); }else{ if(jsonRet.ERRORMESSAGE){ iQ.Utils.doMessagePanel('Message',jsonRet.ERRORMESSAGE); }else{ iQ.Utils.doMessagePanel('Message',jsonRet.MESSAGE); } } objPasswordReminder_Checker.doClearAllStatus(); objPasswordReminder_Panel.cancel(); } function doPostSaveCriteriaForm(){ iQ.Utils.doShowProcessing(); //get params from YUI popup var params = iQ.Utils.BuildAjaxParamStruct('SaveCriteria_Form'); //need params from the main form as well params += ','; params += GetCriteriaParams(); //need userid too params += ','; params += '"UserID":"' + encodeURIComponent(iQ.Utils.GetCookie('UserID')) + '"'; var _Ajax = new iQ.Ajax(); _Ajax.CFCMethod = 'doCreateWatch'; _Ajax.URL = '/websvc/PropertyWatch.cfc'; _Ajax.Params ={Params:'{' + params + '}'}; _Ajax.CallbackHandler = "onSaveCriteria"; _Ajax.Send(); } function onSaveCriteria(jsonRet){ iQ.Utils.doHideProcessing(); if(jsonRet.RSERROR){ iQ.Utils.doMessagePanel('Message',jsonRet.ERRORMESSAGE); }else{ if(jsonRet.ERRORMESSAGE){ iQ.Utils.doMessagePanel('Message',jsonRet.ERRORMESSAGE); }else{ iQ.Utils.doMessagePanel('Message',jsonRet.MESSAGE); } } objSaveCriteria_Checker.doClearAllStatus(); objSaveCriteria_Panel.cancel(); } function doGetUser(ContactID){ iQ.Utils.doShowProcessing(); var params = '"ContactID":"' + encodeURIComponent(ContactID) + '"'; var _Ajax = new iQ.Ajax(); _Ajax.CFCMethod = 'doGetUser'; _Ajax.URL = '/websvc/PropertyWatch.cfc'; _Ajax.Params ={Params:'{' + params + '}'}; _Ajax.CallbackHandler = "onGetUser"; _Ajax.Send(); } function onGetUser(jsonRet){ iQ.Utils.doHideProcessing(); if(jsonRet.RSERROR){ iQ.Utils.doMessagePanel('Message',jsonRet.ERRORMESSAGE); }else{ if(jsonRet.ERRORMESSAGE){ iQ.Utils.doMessagePanel('Message',jsonRet.ERRORMESSAGE); }else{ jsonCols = new Object(); var rsData = jsonRet.RSUSER; for(var i = 0;i < rsData.COLUMNS.length;i++){ jsonCols[rsData.COLUMNS[i]] = i; } iQ.Utils.setFieldValue('UpdateProfile_Form','EmailAddress',rsData.DATA[0][jsonCols["EMAILADDRESS"]]); iQ.Utils.setFieldValue('UpdateProfile_Form','UserID',rsData.DATA[0][jsonCols["USERID"]]); iQ.Utils.setFieldValue('UpdateProfile_Form','Password',rsData.DATA[0][jsonCols["PASSWORD"]]); iQ.Utils.setFieldValue('UpdateProfile_Form','FirstName',rsData.DATA[0][jsonCols["FIRSTNAME"]]); iQ.Utils.setFieldValue('UpdateProfile_Form','LastName',rsData.DATA[0][jsonCols["LASTNAME"]]); iQ.Utils.setFieldValue('UpdateProfile_Form','PhoneNumber',rsData.DATA[0][jsonCols["PHONENUMBER"]]); iQ.Utils.setFieldValue('UpdateProfile_Form','MobilePhone',rsData.DATA[0][jsonCols["MOBILEPHONE"]]); iQ.Utils.setFieldValue('UpdateProfile_Form','FaxNumber',rsData.DATA[0][jsonCols["FAXNUMBER"]]); iQ.Utils.setFieldValue('UpdateProfile_Form','Address',rsData.DATA[0][jsonCols["ADDRESS"]]); iQ.Utils.setFieldValue('UpdateProfile_Form','City',rsData.DATA[0][jsonCols["CITY"]]); iQ.Utils.setFieldValue('UpdateProfile_Form','StateOrProvince',rsData.DATA[0][jsonCols["STATEORPROVINCE"]]); iQ.Utils.setFieldValue('UpdateProfile_Form','PostalCode',rsData.DATA[0][jsonCols["POSTALCODE"]]); iQ.Utils.setFieldValue('UpdateProfile_Form','ContactID',rsData.DATA[0][jsonCols["CONTACTID"]]); iQ.Utils.setFieldValue('UpdateProfile_Form','PasswordAgain',rsData.DATA[0][jsonCols["PASSWORD"]]); objUpdateProfile_Panel.center(); objUpdateProfile_Panel.show(); } } } function doPostUpdateProfileForm(){ iQ.Utils.doShowProcessing(); var params = iQ.Utils.BuildAjaxParamStruct('UpdateProfile_Form'); var _Ajax = new iQ.Ajax(); _Ajax.CFCMethod = 'doUpdateUser'; _Ajax.URL = '/websvc/PropertyWatch.cfc'; _Ajax.Params ={Params:'{' + params + '}'}; _Ajax.CallbackHandler = "onUpdateProfile"; _Ajax.Send(); } function onUpdateProfile(jsonRet){ iQ.Utils.doHideProcessing(); if(jsonRet.RSERROR){ iQ.Utils.doMessagePanel('Message',jsonRet.ERRORMESSAGE); }else{ if(jsonRet.ERRORMESSAGE){ iQ.Utils.doMessagePanel('Message',jsonRet.ERRORMESSAGE); }else{ iQ.Utils.doMessagePanel('Message',jsonRet.MESSAGE); } } objUpdateProfile_Checker.doClearAllStatus(); objUpdateProfile_Panel.cancel(); } function doCreatePWatchForms(){ //*****login panel var objLogin_FormRules =[ {FormName:'Login_Form',FieldName:'UserID',Required:true,Rule:''}, {FormName:'Login_Form',FieldName:'Password',Required:true,Rule:''} ] var onLoginSubmit = function(){ var check = objLogin_Checker.doCheckAllFields(); if(check){ doPostLoginForm(); } }; var onLoginCancel = function(){ objLogin_Checker.doClearAllStatus(); this.cancel(); }; objLogin_Panel = new YAHOO.widget.Dialog("Login_Panel",{ postmethod:"none", width:"400px", disply:"table", visible:false, draggable:true, close:false, constraintoviewport:false, modal:true, zindex:500, buttons:[{text:"Submit",handler:onLoginSubmit,isDefault:true},{text:"Cancel",handler:onLoginCancel}]} ); objLogin_Panel.setBody('
'); objLogin_Panel.setHeader('Property Watch') objLogin_Panel.render(document.body); objLogin_Checker = new iQ.Form.Checker(objLogin_FormRules); objLogin_Checker.doLoad(); //*****register panel var objRegister_FormRules =[{FormName:'Register_Form',FieldName:'FirstName',Required:true,Rule:''},{FormName:'Register_Form',FieldName:'LastName',Required:true,Rule:''},{FormName:'Register_Form',FieldName:'EmailAddress',Required:true,Rule:'email'},{FormName:'Register_Form',FieldName:'Phone',Required:false,Rule:'phonenumber'},{FormName:'Register_Form',FieldName:'Cell',Required:false,Rule:'phonenumber'},{FormName:'Register_Form',FieldName:'WorkPhone',Required:false,Rule:'phonenumber'},{FormName:'Register_Form',FieldName:'UserID',Required:true,Rule:''},{FormName:'Register_Form',FieldName:'Password',Required:true,Rule:''},{FormName:'Register_Form',FieldName:'PasswordAgain',Required:true,Rule:''}] var onRegisterSubmit = function(){ var check = objRegister_Checker.doCheckAllFields(); if(check){ doPostRegisterForm(); } }; var onRegisterCancel = function(){ objRegister_Checker.doClearAllStatus(); this.cancel(); }; objRegister_Panel = new YAHOO.widget.Dialog("Register_Panel",{ postmethod:"none", width:"600px", disply:"table", visible:false, draggable:true, close:false, constraintoviewport:false, modal:true, zindex:500, buttons:[{text:"Submit",handler:onRegisterSubmit,isDefault:true},{text:"Cancel",handler:onRegisterCancel}]} ); objRegister_Panel.setBody(''); objRegister_Panel.setHeader('Property Watch') objRegister_Panel.render(document.body); objRegister_Checker = new iQ.Form.Checker(objRegister_FormRules); objRegister_Checker.doLoad(); //*****password reminder panel var objPasswordReminder_FormRules =[ {FormName:'PasswordReminder_Form',FieldName:'UserID',Required:true,Rule:''} ] var onPasswordReminderSubmit = function(){ var check = objPasswordReminder_Checker.doCheckAllFields(); if(check){ doPostPasswordReminderForm(); } }; var onPasswordReminderCancel = function(){ objPasswordReminder_Checker.doClearAllStatus(); this.cancel(); }; objPasswordReminder_Panel = new YAHOO.widget.Dialog("PasswordReminder_Panel",{ postmethod:"none", width:"400px", disply:"table", visible:false, draggable:true, close:false, constraintoviewport:false, modal:true, zindex:500, buttons:[{text:"Submit",handler:onPasswordReminderSubmit,isDefault:true},{text:"Cancel",handler:onPasswordReminderCancel}]} ); objPasswordReminder_Panel.setBody(''); objPasswordReminder_Panel.setHeader('Property Watch') objPasswordReminder_Panel.render(document.body); objPasswordReminder_Checker = new iQ.Form.Checker(objPasswordReminder_FormRules); objPasswordReminder_Checker.doLoad(); //*****save criteria panel var objSaveCriteria_FormRules =[ {FormName:'SaveCriteria_Form',FieldName:'WatchName',Required:true,Rule:''} ] var onSaveCriteriaSubmit = function(){ var check = objSaveCriteria_Checker.doCheckAllFields(); if(check){ doPostSaveCriteriaForm(); } }; var onSaveCriteriaCancel = function(){ objSaveCriteria_Checker.doClearAllStatus(); this.cancel(); }; objSaveCriteria_Panel = new YAHOO.widget.Dialog("SaveCriteria_Panel",{ postmethod:"none", width:"400px", disply:"table", visible:false, draggable:true, close:false, constraintoviewport:false, modal:true, zindex:500, buttons:[{text:"Submit",handler:onSaveCriteriaSubmit,isDefault:true},{text:"Cancel",handler:onSaveCriteriaCancel}]} ); objSaveCriteria_Panel.setBody(''); objSaveCriteria_Panel.setHeader('Property Watch') objSaveCriteria_Panel.render(document.body); objSaveCriteria_Checker = new iQ.Form.Checker(objSaveCriteria_FormRules); objSaveCriteria_Checker.doLoad(); //*****update profile panel var objUpdateProfile_FormRules =[ {FormName:'UpdateProfile_Form',FieldName:'EmailAddress',Required:true,Rule:'email'}, {FormName:'UpdateProfile_Form',FieldName:'UserID',Required:true,Rule:''}, {FormName:'UpdateProfile_Form',FieldName:'Password',Required:true,Rule:''}, {FormName:'UpdateProfile_Form',FieldName:'PasswordAgain',Required:true,Rule:''}, {FormName:'UpdateProfile_Form',FieldName:'FirstName',Required:true,Rule:''}, {FormName:'UpdateProfile_Form',FieldName:'LastName',Required:true,Rule:''} ] var onUpdateProfileSubmit = function(){ var check = objUpdateProfile_Checker.doCheckAllFields(); if(check){ doPostUpdateProfileForm(); } }; var onUpdateProfileCancel = function(){ objUpdateProfile_Checker.doClearAllStatus(); this.cancel(); }; objUpdateProfile_Panel = new YAHOO.widget.Dialog("UpdateProfile_Panel",{ postmethod:"none", width:"400px", disply:"table", visible:false, draggable:true, close:false, constraintoviewport:false, modal:true, zindex:500, buttons:[{text:"Submit",handler:onUpdateProfileSubmit,isDefault:true},{text:"Cancel",handler:onUpdateProfileCancel}]} ); objUpdateProfile_Panel.setBody(''); objUpdateProfile_Panel.setHeader('My Profile') objUpdateProfile_Panel.render(document.body); objUpdateProfile_Checker = new iQ.Form.Checker(objUpdateProfile_FormRules); objUpdateProfile_Checker.doLoad(); } function doCreateAgentSelectPanel(jsonData){ var onAgentSelectSubmit = function(){ var tmpPublicID = iQ.Utils.getFieldValue('AgentSelect_Form','PublicID'); if(tmpPublicID == 'NONE'){ iQ.Utils.setFieldValue('Register_Form','SelectedPublicID',tmpPublicID); iQ.Utils.setFieldValue('Register_Form','PublicID',''); }else{ iQ.Utils.setFieldValue('Register_Form','SelectedPublicID',tmpPublicID); iQ.Utils.setFieldValue('Register_Form','PublicID',tmpPublicID); } doPostRegisterForm(); this.cancel(); }; var onAgentSelectCancel = function(){ this.cancel(); }; objAgentSelect_Panel = new YAHOO.widget.Dialog("AgentSelect_Panel",{ postmethod:"none", width:"500px", disply:"table", visible:false, draggable:true, close:false, constraintoviewport:true, modal:true, zindex:530, buttons:[{text:"Submit",handler:onAgentSelectSubmit,isDefault:true},{text:"Cancel",handler:onAgentSelectCancel}]} ); objAgentSelect_Panel.setBody(''); objAgentSelect_Panel.setHeader('IQWeb_Select_Your_Agent_Info') objAgentSelect_Panel.render(document.body); objAgentSelect_Panel.center(); objAgentSelect_Panel.show(); jsonCols = new Object(); for(var i = 0;i < jsonData.COLUMNS.length;i++){ jsonCols[jsonData.COLUMNS[i]] = i; } var dd = iQ.Utils.getFormObject('AgentSelect_Form','PublicID','select'); dd.options.length = 0; dd.options[0] = new Option("N/A","NONE"); if(jsonData.DATA.length > 0){ for(var i = 0;i < jsonData.DATA.length;i++){ opID = i + 1; dd.options[opID] = new Option(jsonData.DATA[i][jsonCols["LASTNAME"]] + ',' + jsonData.DATA[i][jsonCols["FIRSTNAME"]],jsonData.DATA[i][jsonCols["PUBLICID"]]); dd.options[opID].id = jsonData.DATA[i][jsonCols["PUBLICID"]]; } } } function doCreateContactSelectPanel(jsonData){ var onContactSelectSubmit = function(){ var tmpContactID = iQ.Utils.getFieldValue('ContactSelect_Form','ContactID'); iQ.Utils.setFieldValue('Register_Form','ContactID',tmpContactID); doPostRegisterForm(); this.cancel(); }; var onContactSelectCancel = function(){ this.cancel(); }; objContactSelect_Panel = new YAHOO.widget.Dialog("ContactSelect_Panel",{ postmethod:"none", width:"500px", disply:"table", visible:false, draggable:true, close:false, constraintoviewport:true, modal:true, zindex:530, buttons:[{text:"Submit",handler:onContactSelectSubmit,isDefault:true},{text:"Cancel",handler:onContactSelectCancel}]} ); objContactSelect_Panel.setBody(''); objContactSelect_Panel.setHeader('IQWeb_Select_Your_Contact_Info') objContactSelect_Panel.render(document.body); objContactSelect_Panel.center(); objContactSelect_Panel.show(); jsonCols = new Object(); for(var i = 0;i < jsonData.COLUMNS.length;i++){ jsonCols[jsonData.COLUMNS[i]] = i; } var dd = iQ.Utils.getFormObject('ContactSelect_Form','ContactID','select'); dd.options.length = 0; if(jsonData.DATA.length > 0){ for(var i = 0;i < jsonData.DATA.length;i++){ dd.options[i] = new Option(jsonData.DATA[i][jsonCols["FIRSTNAME"]] + ' ' + jsonData.DATA[i][jsonCols["LASTNAME"]],jsonData.DATA[i][jsonCols["CONTACTID"]]); dd.options[i].id = jsonData.DATA[i][jsonCols["CONTACTID"]]; } } }