if(!iQ.Ajax){alert('iQAjax.js Not Loaded');}; if(!iQ.Utils){alert('iQUtils.js Not Loaded');}; YAHOO.util.Event.addListener(window,"load",function(){doLoginFormRules()}); 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 = ''; function SetPWPublicID(sPublicID){ m_PWPublicID = sPublicID; } var objLoginFormChecker = null; function doLoginFormRules(){ //alert(document.cookie); var objFormRules =[ {FormName:'DefaultLogin_Form',FieldName:'UserID',Required:true,Rule:''}, {FormName:'DefaultLogin_Form',FieldName:'Password',Required:true,Rule:''} ] objLoginFormChecker = new iQ.Form.Checker(objFormRules); objLoginFormChecker.doLoad(); } function doLogin(){ var check = objLoginFormChecker.doCheckAllFields(); if(!check){ return false; } iQ.Utils.doShowProcessing(); var params = iQ.Utils.BuildAjaxParamStruct('DefaultLogin_Form'); 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){ objLoginFormChecker.doClearAllStatus(); 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{ self.location = '/Default.cfm/Page=/PWatch/Cat=/Private.htm'; } } iQ.Utils.doHideProcessing(); }