<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">/*
master/chatfilterjs
Copyright 2022 Profile Your City, Inc.
*/

var ida = '';
var idcc = '00000000_00000000';
var chat_closed = false;
//localStorage.setItem('chatinit','false');
var hide_the_chat = false;

chatDataOut = [];
adminChatDataOut = [];

//SCROLL TO LATEST ON FIRST LOAD
document.addEventListener("DOMContentLoaded", function () {

	 newStateCheck(function(currentState){
		 	
	 	if (currentState == 'agent') { 
	 		//console.log('agent chat 31:'+currentState);
	 		chatUpdateItems();
	 	} else {
	 	    //console.log('AUTO chat 34:'+currentState);
	 		aChatUpdateItems();
			if(hide_the_chat) {
				$('#'+ida+'chatbox').hide();
				//console.log('43');	
			}
	 	}
		
	 });
	 
 	$('.closechat').click(function(){
 		$('#'+ida+'chatbox').hide();
 		chat_closed = true;
 		//console.log('chat close 1: '+chat_closed);
 		$.get('https://brianfryerealtor.com/'+ida+'chat-down', function(data) {
 		});
		localStorage.setItem('chat_is_closed','1');
 	}); 
	
 	$('.closechat2').click(function(){
 		$('#'+ida+'chatbox').hide();
 		chat_closed = true;
 		//console.log('chat close 1: '+chat_closed);
 		$.get('https://brianfryerealtor.com/'+ida+'chat-down', function(data) {
 		});
		localStorage.setItem('chat_is_closed','1');
 	});


});
	
//HANDLE ENTER KEY
$('#'+ida+'postchat').keypress(function (e) {
 var key = e.which;

 if(key == 13)  // the enter key code
  {
	//  alert('pressed enter');
	//console.log('pressed enter');
	
	 $('#'+ida+'chatsubmit').text("Sending");
	  
	   newStateCheck(function(currentState){
   		if(currentState == 'agent') { //agent chat
   			//console.log('agent chat 63');
   			//$('#chatsubmit').text("Sending");
			$('#'+ida+'chatmessage').val($('input[name='+ida+'message]').val());
			$('#'+ida+'chatsubmit').click();
			
   			$.get('https://brianfryerealtor.com/'+ida+'chat-up?time=1743959226', function(data) {
   			});
			localStorage.setItem('chat_is_closed','0');
   		} else { //auto chat bot
   			//console.log('AUTO chat 72');
   			$('#'+ida+'chatsubmit').click();
   		}
	   });
	   
	    $('#'+ida+'chatsubmit').text("Send");
	   
    
    return false;  
  }
});   

if ( !Storage.prototype.setObject ) {
    Storage.prototype.setObject = function(key, value) {
        this.setItem(key, JSON.stringify(value));
    }
}

if ( !Storage.prototype.getObject ) {
    Storage.prototype.getObject = function(key) {
        var value = this.getItem(key);
        return value &amp;&amp; JSON.parse(value);
    }
}

//SAY HI ON OPEN
$('#'+ida+'chatinit').click(function(){     
	
	//$('#'+ida+'chatbox').show();
	localStorage.setItem('chat_is_closed','0');
	
    newStateCheck(function(currentState){
		
		if(currentState == 'agent') { //agent chat
			//console.log('agent chat 104');
			chatUpdateItems();
		} else { //auto chat bot
			//console.log('AUTO chat 107');
			
						aGuestMenuMessage();
					 	
			aChatUpdateItems(); 
		
		}

    });
	
	$.get('https://brianfryerealtor.com/'+ida+'chat-up?time=1743959226', function(data) {
	});

}); 

//no chat yet prompt
hasdata = localStorage.getObject('chatData');
if (isObject(hasdata)) {
	if (hasdata.length &lt; 1) {
		//console.log('has data empty');
	    			$('#chatcount').text("Let's Chat!");
	    					aGuestMenuMessage();
			} else {
	    		$('#chatcount').text("Let's Chat!");
			 
				//console.log('no dl has data');
				if(!hide_the_chat) {
					//$('#'+ida+'chatbox').show();
					localStorage.setItem('chat_is_closed','0');
					//console.log('175');
			    } else {
					//$('#'+ida+'chatbox').hide();
					localStorage.setItem('chat_is_closed','1');
					//console.log('178');
				}
				    		//console.log('has data full');
	}
} else {
	//console.log('has data no object');
	 
		//console.log('no dl first load');
		if(!hide_the_chat) {
			//$('#'+ida+'chatbox').show();
			localStorage.setItem('chat_is_closed','0');
			//console.log('190');
	    } else {
			//$('#'+ida+'chatbox').hide();
			localStorage.setItem('chat_is_closed','1');
			//console.log('193');
		}
	    	$('#chatcount').text("Let's Chat!");
    			aGuestMenuMessage();
	}

// queries
// current_url = window.location.href;

mls_listing_id = '';
type = '';
//closedchatmls = localStorage.getItem('closedchatmls');
showchat = true;

if(ida == '' &amp;&amp; mls_listing_id != '') { 	// &amp;&amp; (closedchatmls != mls_listing_id)

	listing_quest = "What do you think of this property? Click an option: &lt;br&gt;&lt;a href=\"#\" class=\"btn btn-round btn-danger btn-xs\" style=\"padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px;height:unset;\" onclick=\"$(\'#chatmessage\').val(\'I Like It MLS#:"+mls_listing_id+"\');document.getElementById(\'chatsubmit\').click();\"&gt;I Like It&lt;/a&gt;&lt;br&gt;&lt;a href=\"#\" class=\"btn btn-round btn-warning btn-xs\" style=\"padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px;height:unset;\" onclick=\"$(\'#chatmessage\').val(\'Close but no\');document.getElementById(\'chatsubmit\').click();\"&gt;Close but no&lt;/a&gt;&lt;br&gt;&lt;a href=\"#\" class=\"btn btn-round btn-info btn-xs\" style=\"padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px;height:unset;\" onclick=\"$(\'#chatmessage\').val(\'Not what I want\');document.getElementById(\'chatsubmit\').click();\"&gt;Not what I want&lt;/a&gt;";

	aChatMessage(listing_quest,$('input[name='+ida+'user_id]').val(),$('input[name='+ida+'agent_id]').val(),'Automatic Helper','agent');
	
	if(chat_closed != true) {
		//console.log('chat_closed false');
		var chat_closed = false;
		openChatOnScrollUp(true);
	} else {
		//console.log('chat_closed' + chat_closed);
		var chat_closed = true;
		openChatOnScrollUp(false);
	}

	
} 

current_url = window.location.href;
if (current_url.match(/(results\?)/gmi)) {
	//console.log('on results');
		  //console.log('guest results');	
	 aChatFilter('triggergaa');
	 if(!hide_the_chat) {
	    //$('#'+ida+'chatbox').show();
		 localStorage.setItem('chat_is_closed','0');
	    //console.log('265');
     } else {
		//$('#'+ida+'chatbox').hide();
		 localStorage.setItem('chat_is_closed','1');
		//console.log('268');
	  }
	 } 

if (current_url.match(/(\?logout)/gmi)) {
	//alert('cleared!');
	localStorage.clear();
}

if (current_url.match(/auth\/login/gmi)) {
	//console.log('on auth/login');
var x = window.matchMedia("(max-width: 700px)")
var toHide = hideChatIf(x)
	if(toHide) {
		//$('#'+ida+'chatbox').hide();
		localStorage.setItem('chat_is_closed','1');
	} else {
		if(!hide_the_chat) {
		    //$('#'+ida+'chatbox').show();
			localStorage.setItem('chat_is_closed','0');
		    //console.log('287');
	    } else {
			//$('#'+ida+'chatbox').hide();
			localStorage.setItem('chat_is_closed','1');
			//console.log('290');
		}
	}
}

//SAVE CHAT response DATA
$('#'+ida+'chatsubmit').click(function(){ 

	newStateCheck(function(currentState){
	 	if(currentState == 'agent') {
 				
			 var tm = $('input[name=message]').val();
	 
			  if(tm != '')  {
				  
				  $('#'+ida+'chatsubmit').text("Sending");
    
			  $.ajax({
			      url: 'https://brianfryerealtor.com/newuchat',
			      type: "post",
			      data: {'message':$('input[name=message]').val(),
				  	'user_id':$('input[name=user_id]').val(), 
				  	'agent_id':$('input[name=agent_id]').val(), 
					'username':$('input[name=username]').val(), 
					'code':$('input[name=code]').val(), 
					'from':$('input[name=from]').val(), 
				  	'_token': $('input[name=_token]').val()},
			      success: function(data){
				//	  alert('chat clicked');
					chatUpdateItems(true);
					$('#postchat')[0].reset();
					$('.chat-input').val('');
					$(".chat-input").focus();
					
			        $('.conversation-list').scrollTo('100%', '100%', {
			            easing: 'swing'
			        });
					
			      }
			    });     

				}
		
	 	} else { //auto chat bot
			
		//$('#chatsubmit').text("Sending");
 		
		 var message = $('input[name='+ida+'message]').val();
		 var mrm = message.toLowerCase();

		 if (mrm == 'restart' || mrm == 'do over' || mrm == 'done' || mrm == 'stop' || mrm == 'end' || mrm == 'quit' || mrm == 'go to bed' || mrm == 'go to sleep' || mrm == 'get some rest' ) {
 
			 aChatUpdateItems();
			 aChatFilter(mrm);
 
		 } else {
	  		 aChatMessage($('input[name='+ida+'message]').val(),$('input[name='+ida+'user_id]').val(),$('input[name='+ida+'agent_id]').val(),$('input[name='+ida+'username]').val(),$('input[name='+ida+'from]').val());

	 var pendinganswer = localStorage.getItem('await');
	 var pendingvalid = localStorage.getItem('await_valid');
	 var qindex = localStorage.getItem('question_index');
	 

	 if (localStorage.getItem('series_name') != null  &amp;&amp; pendinganswer != null &amp;&amp; pendinganswer != '' &amp;&amp; pendingvalid != null &amp;&amp; pendingvalid != '') {
	 	localStorage.setItem(pendinganswer, $('input[name='+ida+'message]').val()); // set question name answer
	
		valid_arr = aChatValid($('input[name='+ida+'message]').val(),pendingvalid);

		if (typeof valid_arr[0].isvalid !== 'undefined' &amp;&amp; valid_arr[0].isvalid) {
		
			var tttime = MysqlDateNow();
			//alert(tttime);
			//go to next 
			localStorage.setItem('await','');
			localStorage.setItem('await_valid','');
			localStorage.setItem('answer_time_'+qindex,tttime);
			aChatSeries(true,$('input[name='+ida+'message]').val());
			
		} else {
		 	//send validation error
			aChatMessage(valid_arr[0].message,$('input[name='+ida+'user_id]').val(),$('input[name='+ida+'agent_id]').val(),'Automatic Helper','agent');

		}
	 } 
	 
/*	if(pendinganswer == 'cht_max_price') {
		const changeSelected = (e) =&gt; {
		  const $select = document.querySelector('#sonmaxprice');
		  $select.value = localStorage.getItem('cht_min_price');
		};
	}*/

	 aChatUpdateItems();
	 aChatFilter(mrm);
 
	}

	 }
	 
		 $('#'+ida+'chatmessage').val('');//reset input message box
		 
		 $('#'+ida+'chatsubmit').text("Send");
		 
	});
	
 });  
 
 
   function aGuestMenuMessage() {
	 
  	var series_json = {
  		"series_name": "hello",
  		"series": false,
  		"questions": [
  			{
  				"name": "cht_hello",
  				  				"question": "Hi! Searching has never been so easy! Click an option:&lt;br&gt;&amp;bull; &lt;a href=\"#\" style=\"text-decoration:underline;\" onclick=\"$('#chatmessage').val('Find a Property');document.getElementById('chatsubmit').click();\"&gt;Find a Property&lt;/a&gt;&lt;br&gt;&amp;bull; &lt;a href=\"#\" style=\"text-decoration:underline;\" onclick=\"$('#chatmessage').val('Create a Property Alert');document.getElementById('chatsubmit').click();\"&gt;Create a Property Alert&lt;/a&gt;&lt;br&gt;&amp;bull; &lt;a href=\"#\" style=\"text-decoration:underline;\" onclick=\"$('#chatmessage').val('Create An Account');document.getElementById('chatsubmit').click();\"&gt;Create An Account&lt;/a&gt;&lt;br&gt;&amp;bull; &lt;a href=\"#\" style=\"text-decoration:underline;\" onclick=\"$('#chatmessage').val('Log Into My Account');document.getElementById('chatsubmit').click();\"&gt;Log Into My Account&lt;/a&gt;&lt;br&gt;&amp;bull; &lt;a href=\"#\" style=\"text-decoration:underline;\" onclick=\"$(\'#chatmessage\').val(\'Chat with Live Agent\');document.getElementById(\'chatsubmit\').click();\"&gt;Chat with Live Agent&lt;/a&gt;&lt;br&gt;&amp;bull; &lt;a href=\"#\" style=\"text-decoration:underline;\" onclick=\"$('#chatmessage').val('Contact An Agent');document.getElementById('chatsubmit').click();\"&gt;Call/Email An Agent&lt;/a&gt;",
  				  				"validation": "none",
  				"answer": ""
  			}
  		]
  	};
		
  	localStorage.setObject('seriesData', series_json);	

  	aFlushSeries();					
  	aChatSeries(true,'');
	
 }
 function aChatFilter(mrm) { 
	
 	//console.log('Guest chat');
	
 	current_url = window.location.href;
	//console.log('Guest chat current_url:'+current_url);
	
	
 if (mrm == 'hi' || mrm == 'hi!' |mrm == 'hello' || mrm == 'hola' || mrm == 'anyone there?' || mrm == 'anybody there?' || mrm == 'help' || mrm == 'need help' || mrm == 'i need help' || mrm == 'help me' || mrm == 'start') {  
 	aGuestMenuMessage();

 } else if (mrm.match(/(talk to|speak to|live|real|actual)(.*?)(person|agent|broker|real estate agent|realtor|human)/gmi) || mrm == 'realtor' || mrm.match(/(interested|looking for|available|wondering|call me)/gmi)) {
  	 
  	var series_json = {
  		"series_name": "guest get live agent",
  		"series": true,
		"redirect": current_url,
  		"questions": [
 			{
 				"name": "cht_client_email",
 				"question": "&amp;#128512; I can help with that! What's your email address?",
 				"validation": "email",
 				"answer": ""
 			},
 			{
 				"name": "cht_client_name",
 				"question": "What's your name?",
 				//"condition": "nouser",
 				"validation": "notempty",
 				"answer": ""
 			}
  		]
  	};
		
  	localStorage.setObject('seriesData', series_json);	
  	aFlushSeries();					
  	aChatSeries(true,'');
	 
} else if (mrm.match(/contact(.*?)(agent|realtor|company|broker)/gmi)) { //Contact My Agent 	
	 	var agent_name = 'Brian Frye';
 	var agent_email = 'brifryesells@gmail.com';
 	var agent_phone = '239-692-3840';
			
 	var series_json = {
 		"series_name": "find agent",
 		"series": false,
 		"questions": [
 			{
 				"name": "cht_reply",
 				 				"question": "OK, you want to contact an agent. &amp;#128512;&lt;br&gt;Your Agent: "+agent_name+"&lt;br&gt;Call: &lt;a href=\"tel:1"+agent_phone+"\"&gt;"+agent_phone+"&lt;/a&gt;&lt;br&gt;Email: &lt;a href=\"mailto:"+agent_email+"\"&gt;"+agent_email+"&lt;/a&gt;&lt;br&gt;&lt;a href=\"/contact\"&gt;or Click here to contact an agent.&lt;/a&gt;. Type HELP or &lt;a href=\"#\" onclick=\"$(\'#chatmessage\').val(\'HELP\');document.getElementById(\'chatsubmit\').click();\" style=\"text-decoration:underline;\"&gt;Click HELP&lt;/a&gt; to see these options again. &amp;#128512;",
 				 				"validation": "",
 				"answer": ""
 			}
 		]
 	};
		
 	localStorage.setObject('seriesData', series_json);	
 	aFlushSeries();					
 	aChatSeries(true,'');
	
	
 } else if (mrm.match(/(list|advertise)(.*?)(property|listing|house)/gmi)) { 	
 	var series_json = {
 		"series_name": "list property",
 		"series": false,
 		"questions": [
 			{
 				"name": "cht_reply",
 				"question": "Click below to watch video and learn how to add your property to our site:&lt;br&gt;&lt;iframe width=\"100%\" src=\"https://www.youtube.com/embed/DVmwt6RHxrE\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" allowfullscreen&gt;&lt;/iframe&gt;&lt;a href=\"/list-your-property\"  style=\"text-decoration:underline;\"&gt;Then click here and enter the details of your property now.&lt;/a&gt;. Type HELP or &lt;a href=\"#\" onclick=\"$(\'#chatmessage\').val(\'HELP\');document.getElementById(\'chatsubmit\').click();\" style=\"text-decoration:underline;\"&gt;Click HELP&lt;/a&gt; to see these options again. &amp;#128512;",
 				"validation": "",
 				"answer": ""
 			}
 		]
 	};
		
 	localStorage.setObject('seriesData', series_json);	
 	aFlushSeries();					
 	aChatSeries(true,'');
	
 } else if (mrm.match(/(create|make|start)(.*?)account/gmi) || mrm == 'signup' || mrm == 'sign up' || mrm == 'log in' || mrm == 'login') { 	
 	var series_json = {
 		"series_name": "guest create account",
 		"series": true,
		"redirect": current_url,
 		"questions": [
 			{
 				"name": "cht_client_email",
 				"question": "&amp;#128512; I can help with that! What's your email address?",
 				"validation": "email",
 				"answer": ""
 			},
 			{
 				"name": "cht_client_name",
 				"question": "What's your name?",
 				//"condition": "nouser",
 				"validation": "notempty",
 				"answer": ""
 			}
 		]
 	};
		
 	localStorage.setObject('seriesData', series_json);	
 	aFlushSeries();					
 	aChatSeries(true,'');
	
	
 } else if (mrm.match(/(set up|setup|create|email|add)(.*?)(alert|update|property alert|property update)/gmi)) { 	
 	var series_json = {
 		"series_name": "guest property alert",
 		"series": true,
		"redirect": current_url,
 		"questions": [
 			{
 				"name": "cht_ptype",
 				"question": "One of our most popular requests &amp;#128512;! What type of property are you searching for? Click an option: &lt;br&gt;&lt;a href=\"#\" class=\"btn btn-round btn-danger btn-xs\" style=\"padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px;height:unset;\" onclick=\"$(\'#chatmessage\').val(\'Single Family\');document.getElementById(\'chatsubmit\').click();\"&gt;Single Family&lt;/a&gt;&lt;br&gt;&lt;a href=\"#\" class=\"btn btn-round btn-primary btn-xs\" style=\"padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px;height:unset;\" onclick=\"$(\'#chatmessage\').val(\'Condominiums\');document.getElementById(\'chatsubmit\').click();\"&gt;Condominiums&lt;/a&gt;&lt;br&gt;&lt;a href=\"#\" class=\"btn btn-round btn-success btn-xs\" style=\"padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px;height:unset;\" onclick=\"$(\'#chatmessage\').val(\'Lots or Land\');document.getElementById(\'chatsubmit\').click();\"&gt;Lots or Land&lt;/a&gt;",
 				"validation": "limit:single family|condominiums|lots or land",
 				"answer": ""
 			},
 			{
 				"name": "cht_min_price",
 				"question": "What's your minimum price? (type for example $1, 10K or 100,000) or choose then click Save Choice:&lt;br&gt;&lt;select id=\"sonminprice\" onchange=\"$(\'#chatmessage\').val(this.value);\"&gt;&lt;option value=\"1000\"&gt;$1,000&lt;/option&gt;&lt;option value=\"5000\"&gt;$5,000&lt;/option&gt;&lt;option value=\"10000\"&gt;$10,000&lt;/option&gt;&lt;option value=\"25000\"&gt;$25,000&lt;/option&gt;&lt;option value=\"50000\"&gt;$50,000&lt;/option&gt;&lt;option value=\"100000\"&gt;$100,000&lt;/option&gt;&lt;option value=\"150000\"&gt;$150,000&lt;/option&gt;&lt;option value=\"200000\"&gt;$200,000&lt;/option&gt;&lt;option value=\"250000\"&gt;$250,000&lt;/option&gt;&lt;option value=\"300000\"&gt;$300,000&lt;/option&gt;&lt;option value=\"350000\"&gt;$350,000&lt;/option&gt;&lt;option value=\"400000\"&gt;$400,000&lt;/option&gt;&lt;option value=\"450000\"&gt;$450,000&lt;/option&gt;&lt;option value=\"500000\"&gt;$500,000&lt;/option&gt;&lt;option value=\"750000\"&gt;$750,000&lt;/option&gt;&lt;option value=\"1000000\"&gt;$1,000,000&lt;/option&gt;&lt;option value=\"2000000\"&gt;$2,000,000&lt;/option&gt;&lt;option value=\"3000000\"&gt;$3,000,000&lt;/option&gt;&lt;option value=\"4000000\"&gt;$4,000,000&lt;/option&gt;&lt;option value=\"5000000\"&gt;$5,000,000&lt;/option&gt;&lt;option value=\"10000000\"&gt;$10,000,000&lt;/option&gt;&lt;/select&gt; &lt;a href=\"#\" class=\"btn btn-round btn-danger btn-xs\" style=\"padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px;height:unset;\" onclick=\"$(\'#chatmessage\').val($(\'#sonminprice\').val());document.getElementById(\'chatsubmit\').click();\"&gt;Save Choice&lt;/a&gt;",
 				"validation": "numeric",
 				"answer": ""
 			},
 			{
 				"name": "cht_max_price",
 				"question": "What's your maximum price? (type for example: 250K or 250,000) or choose then click Save Choice:&lt;br&gt; &lt;select id=\"sonmaxprice\" onchange=\"$(\'#chatmessage\').val(this.value);\"&gt;&lt;option value=\"99999999999\"&gt;No Maximum&lt;/option&gt;&lt;option value=\"100000000\"&gt;$100,000,000&lt;/option&gt;&lt;option value=\"10000000\"&gt;$10,000,000&lt;/option&gt;&lt;option value=\"5000000\"&gt;$5,000,000&lt;/option&gt;&lt;option value=\"4000000\"&gt;$4,000,000&lt;/option&gt;&lt;option value=\"3000000\"&gt;$3,000,000&lt;/option&gt;&lt;option value=\"2000000\"&gt;$2,000,000&lt;/option&gt;&lt;option value=\"1000000\"&gt;$1,000,000&lt;/option&gt;&lt;option value=\"750000\"&gt;$750,000&lt;/option&gt;&lt;option value=\"500000\"&gt;$500,000&lt;/option&gt;&lt;option value=\"450000\"&gt;$450,000&lt;/option&gt;&lt;option value=\"400000\"&gt;$400,000&lt;/option&gt;&lt;option value=\"350000\"&gt;$350,000&lt;/option&gt;&lt;option value=\"300000\"&gt;$300,000&lt;/option&gt;&lt;option value=\"250000\"&gt;$250,000&lt;/option&gt;&lt;option value=\"200000\"&gt;$200,000&lt;/option&gt;&lt;option value=\"150000\"&gt;$150,000&lt;/option&gt;&lt;option value=\"100000\"&gt;$100,000&lt;/option&gt;&lt;option value=\"50000\"&gt;$50,000&lt;/option&gt;&lt;option value=\"25000\"&gt;$25,000&lt;/option&gt;&lt;option value=\"10000\"&gt;$10,000&lt;/option&gt;&lt;option value=\"5000\"&gt;$5,000&lt;/option&gt;&lt;/select&gt; &lt;a href=\"#\" class=\"btn btn-round btn-danger btn-xs\" style=\"padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px;height:unset;\" onclick=\"$(\'#chatmessage\').val($(\'#sonmaxprice\').val());document.getElementById(\'chatsubmit\').click();\"&gt;Save Choice&lt;/a&gt;",
 				"validation": "numeric",
 				"answer": ""
 			},
 			{
 				"name": "cht_min_beds",
 				"question": "How many bedrooms minimum? (type for example: 3 or three) or choose then click Save Choice:&lt;br&gt;&lt;select id=\"sonbedrooms\" onchange=\"$(\'#chatmessage\').val(this.value);\"&gt;&lt;option value=\"1\"&gt;1&lt;/option&gt;&lt;option value=\"2\"&gt;2&lt;/option&gt;&lt;option value=\"3\"&gt;3&lt;/option&gt;&lt;option value=\"4\"&gt;4&lt;/option&gt;&lt;option value=\"5\"&gt;5&lt;/option&gt;&lt;option value=\"6\"&gt;6&lt;/option&gt;&lt;option value=\"7\"&gt;7&lt;/option&gt;&lt;option value=\"8\"&gt;8&lt;/option&gt;&lt;option value=\"9\"&gt;9&lt;/option&gt;&lt;option value=\"10\"&gt;10&lt;/option&gt;&lt;/select&gt; &lt;a href=\"#\" class=\"btn btn-round btn-danger btn-xs\" style=\"padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px;height:unset;\" onclick=\"$(\'#chatmessage\').val($(\'#sonbedrooms\').val());document.getElementById(\'chatsubmit\').click();\"&gt;Save Choice&lt;/a&gt;",
 				"validation": "numeric",
 				"condition": "cht_ptype:single family|condominiums",
 				"answer": ""
 			},
 			{
 				"name": "cht_min_baths",
 				"question": "How many bathrooms minimum? (type for example: 2 or two) or choose then click Save Choice:&lt;br&gt;&lt;select id=\"sonbathsfull\" onchange=\"$(\'#chatmessage\').val(this.value);\"&gt;&lt;option value=\"0\"&gt;0&lt;/option&gt;&lt;option value=\"1\"&gt;1&lt;/option&gt;&lt;option value=\"2\"&gt;2&lt;/option&gt;&lt;option value=\"3\"&gt;3&lt;/option&gt;&lt;option value=\"4\"&gt;4&lt;/option&gt;&lt;option value=\"5\"&gt;5&lt;/option&gt;&lt;option value=\"6\"&gt;6&lt;/option&gt;&lt;option value=\"7\"&gt;7&lt;/option&gt;&lt;option value=\"8\"&gt;8&lt;/option&gt;&lt;option value=\"9\"&gt;9&lt;/option&gt;&lt;option value=\"10\"&gt;10&lt;/option&gt;&lt;/select&gt; &lt;a href=\"#\" class=\"btn btn-round btn-danger btn-xs\" style=\"padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px;height:unset;\" onclick=\"$(\'#chatmessage\').val($(\'#sonbathsfull\').val());document.getElementById(\'chatsubmit\').click();\"&gt;Save Choice&lt;/a&gt;",
 				"validation": "numeric",
 				"condition": "cht_ptype:single family|condominiums",
 				"answer": ""
 			}
 			 			,
 			{
 				"name": "cht_city",
 				"question": "Which city should it search? " + buildMultiSelectCity(),
 				"validation": "none",
 				"answer": ""
 			},
			{
				"name": "cht_community_name",
				"question": "Do you want to look in a specific community? &lt;span id='bmsc'&gt;&lt;/span&gt;",
				"validation": "none",
				"answer": ""
			},
			{
				"name": "cht_subdivision",
				"question": "Should I search a specific subdivision?  &lt;span id='bmss'&gt;&lt;/span&gt;",
				"validation": "none",
				"answer": ""
			},
 			 			{
 				"name": "cht_min_acres",
 				"question": "How many acres minimum? (type for example: 3 or three) or choose then click Save Choice:&lt;br&gt;&lt;select id=\"sonacres\" onchange=\"$(\'#chatmessage\').val(this.value);\"&gt;&lt;option value=\"0\"&gt;Under 1 Acre&lt;/option&gt;&lt;option value=\"1\"&gt;1&lt;/option&gt;&lt;option value=\"2\"&gt;2&lt;/option&gt;&lt;option value=\"3\"&gt;3&lt;/option&gt;&lt;option value=\"4\"&gt;4&lt;/option&gt;&lt;option value=\"5\"&gt;5&lt;/option&gt;&lt;option value=\"6\"&gt;6&lt;/option&gt;&lt;option value=\"7\"&gt;7&lt;/option&gt;&lt;option value=\"8\"&gt;8&lt;/option&gt;&lt;option value=\"9\"&gt;9&lt;/option&gt;&lt;option value=\"10\"&gt;10&lt;/option&gt;&lt;option value=\"15\"&gt;15&lt;/option&gt;&lt;option value=\"20\"&gt;20&lt;/option&gt;&lt;option value=\"30\"&gt;30&lt;/option&gt;&lt;option value=\"40\"&gt;40&lt;/option&gt;&lt;option value=\"50\"&gt;50&lt;/option&gt;&lt;option value=\"100\"&gt;100&lt;/option&gt;&lt;/select&gt; &lt;a href=\"#\" class=\"btn btn-round btn-danger btn-xs\" style=\"padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px;height:unset;\" onclick=\"$(\'#chatmessage\').val($(\'#sonacres\').val());document.getElementById(\'chatsubmit\').click();\"&gt;Save Choice&lt;/a&gt;",
 				"validation": "numeric",
 				"condition": "cht_ptype:lots or land",
 				"answer": ""
 			},
 			{
 				"name": "cht_pool",
 				"question": "Only include properties with private pools? &lt;a href=\"#\" class=\"btn btn-round btn-success btn-xs\" style=\"padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px;height:unset;\" onclick=\"$(\'#chatmessage\').val(\'Yes\');document.getElementById(\'chatsubmit\').click();\"&gt;Yes&lt;/a&gt; &lt;a href=\"#\" class=\"btn btn-round btn-danger btn-xs\" style=\"padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px;height:unset;\" onclick=\"$(\'#chatmessage\').val(\'No\');document.getElementById(\'chatsubmit\').click();\"&gt;No&lt;/a&gt;",
 				"condition": "cht_ptype:single family",
 				"validation": "yesno",
 				"answer": ""
 			},
 			{
 				"name": "cht_client_email",
 				"question": "What's your email address?",
 				"validation": "email",
 				"answer": ""
 			},
 			{
 				"name": "cht_client_name",
 				"question": "What's your name?",
 				//"condition": "nouser",
 				"validation": "notempty",
 				"answer": ""
 			}
 		]
 	};

 	localStorage.setObject('seriesData', series_json);	
 	aFlushSeries();					
 	aChatSeries(true,'');
	
 } else if (mrm == 'triggergaa') {  
 
var series_json = {
	"series_name": "results guest add alert",
	"series": true,
	"current_url": current_url,
	"questions": [
		{
			"name": "cht_client_email",
			"question": "Want to receive new alerts for properties matching this search?&lt;br&gt;&lt;br&gt; &amp;#128512; I can help with that! &lt;br&gt;&lt;br&gt;What email address should we send your alerts to?",
			"validation": "email",
			"answer": ""
		},
		{
			"name": "cht_client_name",
			"question": "What's your name?",
			//"condition": "nouser",
			"validation": "notempty",
			"answer": ""
		}
	]
};
	
localStorage.setObject('seriesData', series_json);	
aFlushSeries();					
aChatSeries(true,'');
 
 
} else if (mrm.match(/find(.*?)(property|land|listing|house|home)/gmi)) { 	
 	var series_json = {
 		"series_name": "guest find property",
 		"series": true,
 		"questions": [
 			{
 				"name": "cht_ptype",
 				"question": "I can help find what you need &amp;#128512;! What type of property are you searching for? Click an option: &lt;br&gt;&lt;a href=\"#\" class=\"btn btn-round btn-danger btn-xs\" style=\"padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px;height:unset;\" onclick=\"$(\'#chatmessage\').val(\'Single Family\');document.getElementById(\'chatsubmit\').click();\"&gt;Single Family&lt;/a&gt;&lt;br&gt;&lt;a href=\"#\" class=\"btn btn-round btn-primary btn-xs\" style=\"padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px;height:unset;\" onclick=\"$(\'#chatmessage\').val(\'Condominiums\');document.getElementById(\'chatsubmit\').click();\"&gt;Condominiums&lt;/a&gt;&lt;br&gt;&lt;a href=\"#\" class=\"btn btn-round btn-success btn-xs\" style=\"padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px;height:unset;\" onclick=\"$(\'#chatmessage\').val(\'Lots or Land\');document.getElementById(\'chatsubmit\').click();\"&gt;Lots or Land&lt;/a&gt;",
 				"validation": "limit:single family|condominiums|lots or land",
 				"answer": ""
 			},
 			{
 				"name": "cht_min_price",
 				"question": "What's your minimum price? (type for example $1, 10K or 100,000) or choose then click Save Choice:&lt;br&gt;&lt;select id=\"sonminprice\" onchange=\"$(\'#chatmessage\').val(this.value);\"&gt;&lt;option value=\"1000\"&gt;$1,000&lt;/option&gt;&lt;option value=\"5000\"&gt;$5,000&lt;/option&gt;&lt;option value=\"10000\"&gt;$10,000&lt;/option&gt;&lt;option value=\"25000\"&gt;$25,000&lt;/option&gt;&lt;option value=\"50000\"&gt;$50,000&lt;/option&gt;&lt;option value=\"100000\"&gt;$100,000&lt;/option&gt;&lt;option value=\"150000\"&gt;$150,000&lt;/option&gt;&lt;option value=\"200000\"&gt;$200,000&lt;/option&gt;&lt;option value=\"250000\"&gt;$250,000&lt;/option&gt;&lt;option value=\"300000\"&gt;$300,000&lt;/option&gt;&lt;option value=\"350000\"&gt;$350,000&lt;/option&gt;&lt;option value=\"400000\"&gt;$400,000&lt;/option&gt;&lt;option value=\"450000\"&gt;$450,000&lt;/option&gt;&lt;option value=\"500000\"&gt;$500,000&lt;/option&gt;&lt;option value=\"750000\"&gt;$750,000&lt;/option&gt;&lt;option value=\"1000000\"&gt;$1,000,000&lt;/option&gt;&lt;option value=\"2000000\"&gt;$2,000,000&lt;/option&gt;&lt;option value=\"3000000\"&gt;$3,000,000&lt;/option&gt;&lt;option value=\"4000000\"&gt;$4,000,000&lt;/option&gt;&lt;option value=\"5000000\"&gt;$5,000,000&lt;/option&gt;&lt;option value=\"10000000\"&gt;$10,000,000&lt;/option&gt;&lt;/select&gt; &lt;a href=\"#\" class=\"btn btn-round btn-danger btn-xs\" style=\"padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px;height:unset;\" onclick=\"$(\'#chatmessage\').val($(\'#sonminprice\').val());document.getElementById(\'chatsubmit\').click();\"&gt;Save Choice&lt;/a&gt;",
 				"validation": "numeric",
 				"answer": ""
 			},
 			{
 				"name": "cht_max_price",				
 				"question": "What's your maximum price? (type for example: 250K or 250,000) or choose then click Save Choice:&lt;br&gt;&lt;select id=\"sonmaxprice\" onchange=\"$(\'#chatmessage\').val(this.value);\"&gt;&lt;option value=\"99999999999\"&gt;No Maximum&lt;/option&gt;&lt;option value=\"100000000\"&gt;$100,000,000&lt;/option&gt;&lt;option value=\"10000000\"&gt;$10,000,000&lt;/option&gt;&lt;option value=\"5000000\"&gt;$5,000,000&lt;/option&gt;&lt;option value=\"4000000\"&gt;$4,000,000&lt;/option&gt;&lt;option value=\"3000000\"&gt;$3,000,000&lt;/option&gt;&lt;option value=\"2000000\"&gt;$2,000,000&lt;/option&gt;&lt;option value=\"1000000\"&gt;$1,000,000&lt;/option&gt;&lt;option value=\"750000\"&gt;$750,000&lt;/option&gt;&lt;option value=\"500000\"&gt;$500,000&lt;/option&gt;&lt;option value=\"450000\"&gt;$450,000&lt;/option&gt;&lt;option value=\"400000\"&gt;$400,000&lt;/option&gt;&lt;option value=\"350000\"&gt;$350,000&lt;/option&gt;&lt;option value=\"300000\"&gt;$300,000&lt;/option&gt;&lt;option value=\"250000\"&gt;$250,000&lt;/option&gt;&lt;option value=\"200000\"&gt;$200,000&lt;/option&gt;&lt;option value=\"150000\"&gt;$150,000&lt;/option&gt;&lt;option value=\"100000\"&gt;$100,000&lt;/option&gt;&lt;option value=\"50000\"&gt;$50,000&lt;/option&gt;&lt;option value=\"25000\"&gt;$25,000&lt;/option&gt;&lt;option value=\"10000\"&gt;$10,000&lt;/option&gt;&lt;option value=\"5000\"&gt;$5,000&lt;/option&gt;&lt;/select&gt; &lt;a href=\"#\" class=\"btn btn-round btn-danger btn-xs\" style=\"padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px;height:unset;\" onclick=\"$(\'#chatmessage\').val($(\'#sonmaxprice\').val());document.getElementById(\'chatsubmit\').click();\"&gt;Save Choice&lt;/a&gt;",
 				"validation": "numeric",
 				"answer": ""
 			},
 			{
 				"name": "cht_min_beds",
 				"question": "How many bedrooms minimum? (type for example: 3 or three) or choose then click Save Choice:&lt;br&gt;&lt;select id=\"sonbedrooms\" onchange=\"$(\'#chatmessage\').val(this.value);\"&gt;&lt;option value=\"1\"&gt;1&lt;/option&gt;&lt;option value=\"2\"&gt;2&lt;/option&gt;&lt;option value=\"3\"&gt;3&lt;/option&gt;&lt;option value=\"4\"&gt;4&lt;/option&gt;&lt;option value=\"5\"&gt;5&lt;/option&gt;&lt;option value=\"6\"&gt;6&lt;/option&gt;&lt;option value=\"7\"&gt;7&lt;/option&gt;&lt;option value=\"8\"&gt;8&lt;/option&gt;&lt;option value=\"9\"&gt;9&lt;/option&gt;&lt;option value=\"10\"&gt;10&lt;/option&gt;&lt;/select&gt; &lt;a href=\"#\" class=\"btn btn-round btn-danger btn-xs\" style=\"padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px;height:unset;\" onclick=\"$(\'#chatmessage\').val($(\'#sonbedrooms\').val());document.getElementById(\'chatsubmit\').click();\"&gt;Save Choice&lt;/a&gt;",
 				"validation": "numeric",
 				"condition": "cht_ptype:single family|condominiums",
 				"answer": ""
 			},
 			{
 				"name": "cht_min_baths",
 				"question": "How many bathrooms minimum? (type for example: 2 or two) or choose then click Save Choice:&lt;br&gt;&lt;select id=\"sonbathsfull\" onchange=\"$(\'#chatmessage\').val(this.value);\"&gt;&lt;option value=\"0\"&gt;0&lt;/option&gt;&lt;option value=\"1\"&gt;1&lt;/option&gt;&lt;option value=\"2\"&gt;2&lt;/option&gt;&lt;option value=\"3\"&gt;3&lt;/option&gt;&lt;option value=\"4\"&gt;4&lt;/option&gt;&lt;option value=\"5\"&gt;5&lt;/option&gt;&lt;option value=\"6\"&gt;6&lt;/option&gt;&lt;option value=\"7\"&gt;7&lt;/option&gt;&lt;option value=\"8\"&gt;8&lt;/option&gt;&lt;option value=\"9\"&gt;9&lt;/option&gt;&lt;option value=\"10\"&gt;10&lt;/option&gt;&lt;/select&gt; &lt;a href=\"#\" class=\"btn btn-round btn-danger btn-xs\" style=\"padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px;height:unset;\" onclick=\"$(\'#chatmessage\').val($(\'#sonbathsfull\').val());document.getElementById(\'chatsubmit\').click();\"&gt;Save Choice&lt;/a&gt;",
 				"validation": "numeric",
 				"condition": "cht_ptype:single family|condominiums",
 				"answer": ""
 			}
 			 			,
 			{
 				"name": "cht_city",
 				"question": "Which city should it search?" + buildMultiSelectCity(),
 				"validation": "none",
 				"answer": ""
 			},
 			{
 				"name": "cht_community_name",
 				"question": "Do you want to look in a specific community? &lt;span id='bmsc'&gt;&lt;/span&gt;",
 				"validation": "none",
 				"answer": ""
 			},
 			{
 				"name": "cht_subdivision",
 				"question": "Should I search a specific subdivision?  &lt;span id='bmss'&gt;&lt;/span&gt;",
 				"validation": "none",
 				"answer": ""
 			},
 			 			{
 				"name": "cht_min_acres",
 				"question": "How many acres minimum? (type for example: 3 or three) or choose then click Save Choice:&lt;br&gt;&lt;select id=\"sonacres\" onchange=\"$(\'#chatmessage\').val(this.value);\"&gt;&lt;option value=\"0\"&gt;Under 1 Acre&lt;/option&gt;&lt;option value=\"1\"&gt;1&lt;/option&gt;&lt;option value=\"2\"&gt;2&lt;/option&gt;&lt;option value=\"3\"&gt;3&lt;/option&gt;&lt;option value=\"4\"&gt;4&lt;/option&gt;&lt;option value=\"5\"&gt;5&lt;/option&gt;&lt;option value=\"6\"&gt;6&lt;/option&gt;&lt;option value=\"7\"&gt;7&lt;/option&gt;&lt;option value=\"8\"&gt;8&lt;/option&gt;&lt;option value=\"9\"&gt;9&lt;/option&gt;&lt;option value=\"10\"&gt;10&lt;/option&gt;&lt;option value=\"15\"&gt;15&lt;/option&gt;&lt;option value=\"20\"&gt;20&lt;/option&gt;&lt;option value=\"30\"&gt;30&lt;/option&gt;&lt;option value=\"40\"&gt;40&lt;/option&gt;&lt;option value=\"50\"&gt;50&lt;/option&gt;&lt;option value=\"100\"&gt;100&lt;/option&gt;&lt;/select&gt; &lt;a href=\"#\" class=\"btn btn-round btn-danger btn-xs\" style=\"padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px;height:unset;\" onclick=\"$(\'#chatmessage\').val($(\'#sonacres\').val());document.getElementById(\'chatsubmit\').click();\"&gt;Save Choice&lt;/a&gt;",
 				"validation": "numeric",
 				"condition": "cht_ptype:lots or land",
 				"answer": ""
 			},
 			{
 				"name": "cht_pool",
 				"question": "Only include properties with private pools? &lt;a href=\"#\" class=\"btn btn-round btn-success btn-xs\" style=\"padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px;height:unset;\" onclick=\"$(\'#chatmessage\').val(\'Yes\');document.getElementById(\'chatsubmit\').click();\"&gt;Yes&lt;/a&gt; &lt;a href=\"#\" class=\"btn btn-round btn-danger btn-xs\" style=\"padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px;height:unset;\" onclick=\"$(\'#chatmessage\').val(\'No\');document.getElementById(\'chatsubmit\').click();\"&gt;No&lt;/a&gt;",
 				"condition": "cht_ptype:single family",
 				"validation": "yesno",
 				"answer": ""
 			}
 		]
 	};

 	localStorage.setObject('seriesData', series_json);	
 	aFlushSeries();					
 	aChatSeries(true,'');
	
 } else if (mrm.match(/(current)(.*?)(link|url)/gmi)) { 	
 	var series_json = {
 		"series_name": "current link",
 		"series": false,
 		"questions": [
 			{
 				"name": "cht_reply",
 				"question": "You are on: "+current_url+" Type HELP or &lt;a href=\"#\" onclick=\"$(\'#chatmessage\').val(\'HELP\');document.getElementById(\'chatsubmit\').click();\" style=\"text-decoration:underline;\"&gt;Click HELP&lt;/a&gt; to see these options again. &amp;#128512;",
 				"validation": "",
 				"answer": ""
 			}
 		]
 	};
		
 	localStorage.setObject('seriesData', series_json);	
 	aFlushSeries();					
 	aChatSeries(true,'');
	
 } else if (mrm.match(/not what i want/gmi)) { 	
 	var series_json = {
 		"series_name": "guest not what i want",
 		"series": true,
		"redirect": current_url,
 		"passthrough": [
 			{
 				"mls_listing_id": "",
 				"type": ""
 			}
 		],
 		"questions": [
 			{
 				"name": "cht_what_you_think",
 				"question": "What needs to be different about this property?",
 				"validation": "notempty",
 				"answer": ""
 			},
 			{
 				"name": "cht_client_email",
 				"question": "&amp;#128512 We have powerful free tools available to help you find exactly the property you need. &lt;br&gt;&lt;br&gt;To get access to the tools and get started now, What's your email address?",
 				"validation": "email", 
 				"answer": ""
 			},
 			{
 				"name": "cht_client_name",
 				"question": "What's your name?",
 				"validation": "notempty",
 				"answer": ""
 			}
 		]
 	};
		
 	localStorage.setObject('seriesData', series_json);	
 	aFlushSeries();					
 	aChatSeries(true,'');
	
 } else if (mrm.match(/close but no/gmi)) { 	
 		
 	var series_json = {
 		"series_name": "guest close but no",
 		"series": true,
		"redirect": current_url,
 		"passthrough": [
 			{
 				"mls_listing_id": "",
 				"type": ""
 			}
 		],
 		"questions": [
 			{
 				"name": "cht_what_you_think",
 				"question": "What needs to be different about this property to make it perfect?",
 				"validation": "notempty",
 				"answer": ""
 			},
 			{
 				"name": "cht_client_email",
 				"question": "&amp;#128512 We have powerful free tools available to help you find exactly the property you need. &lt;br&gt;&lt;br&gt;To get access to the tools and get started now, What's your email address?",
 				"validation": "email", 
 				"answer": ""
 			},
 			{
 				"name": "cht_client_name",
 				"question": "What's your name?",
 				"validation": "notempty",
 				"answer": ""
 			}
 		]
 	};
		
 	localStorage.setObject('seriesData', series_json);	
 	aFlushSeries();					
 	aChatSeries(true,'');
	
 } else if (mrm.match(/i like it/gmi)) { 	
 		
 	var series_json = {
 		"series_name": "guest i like it",
 		"series": true,
		"redirect": current_url,
 		"passthrough": [
 			{
 				"mls_listing_id": "",
 				"type": ""
 			}
 		],
 		"questions": [
 			{
 				"name": "cht_client_email",
 				"question": "Glad you found something you like, let&amp;rsquo;s add it to your favorites!&lt;br&gt;&lt;br&gt;To get started, What's your email address?",
 				"validation": "email",
 				"answer": ""
 			},
 			{
 				"name": "cht_client_name",
 				"question": "What's your name?",
 				"validation": "notempty",
 				"answer": ""
 			}
 		]
 	};
		
 	localStorage.setObject('seriesData', series_json);	
 	aFlushSeries();					
 	aChatSeries(true,'');
	
 } else if (mrm == 'log into my account' ||mrm == 'sign into my account' ||  mrm == 'log in' || mrm == 'login' || mrm == 'signin' || mrm == 'sign in' || mrm == 'sing in' || mrm == 'singin') { 
 	var series_json = {
 		"series_name": "sign in",
 		"series": false,
 		"questions": [
 			{
 				"name": "cht_signin",
 				"question": "&lt;a href=\"/auth/login\" style=\"text-decoration:underline;\"&gt;Click here to log in now.&lt;/a&gt; Forgot your password? &lt;a href=\"/password/email\" style=\"text-decoration:underline;\"&gt;Click here to reset your password.&lt;/a&gt; Type HELP or &lt;a href=\"#\" onclick=\"$(\'#chatmessage\').val(\'HELP\');document.getElementById(\'chatsubmit\').click();\" style=\"text-decoration:underline;\"&gt;Click HELP&lt;/a&gt; to see options again.",
 				"validation": "none",
 				"answer": ""
 			}
 		]
 	};
		
 	localStorage.setObject('seriesData', series_json);	

 	aFlushSeries();					
 	aChatSeries(true,'');

 } else if (mrm.match(/Hi |Hello |can I |when will |when can |when I |where is |where does |where can |what is |what can |why is |why are |how are |how is |how do /gmi)) { 	
 	var series_json = {
 		"series_name": "guest get live agent catchall",
 		"series": true,
		"redirect": current_url,
 		"questions": [
 			{
 				"name": "cht_client_email",
 				"question": "I'm just a humble bot &amp;#128512; But I can help with that! What's your email address?",
 				"validation": "email",
 				"answer": ""
 			},
 			{
 				"name": "cht_client_name",
 				"question": "What's your name?",
 				//"condition": "nouser",
 				"validation": "notempty",
 				"answer": ""
 			}
 		]
 	};
		
 	localStorage.setObject('seriesData', series_json);	
 	aFlushSeries();					
 	aChatSeries(true,'');
	
	
 }
 } //func

  
/*if(hide_the_chat) {
	$('#'+ida+'chatbox').hide();
	//console.log('1412');	
}*/
if(localStorage.getItem('chat_is_closed') === '1') {
	console.log('chat_is_closed');
	$('#'+ida+'chatbox').hide();
} else {
	console.log('chat_not_closed');
	//$('#'+ida+'chatbox').show();
}</pre></body></html>