



var protocalType  = (window.location.protocol.indexOf("https") != -1 ? 'https' : 'http') 

var timeHour1 = parseInt("0");
timeHour1 = timeHour1+1;

function livsrvgetCookie(cookiename)
{
	var cookiestring=""+document.cookie;
	var index1=cookiestring.indexOf(cookiename);
	if (index1==-1 || cookiename=="") return "";
	var index2=cookiestring.indexOf(';',index1);
	if (index2==-1) index2=cookiestring.length;
	return unescape(cookiestring.substring(index1+cookiename.length+1,index2));
}

//---------------retriv the queryString parameter----------
function getParameter( parameterName ) {
	var queryString = "";
	try
	{
	   queryString = window.top.location.search.substring(1);
	}catch(e){}
 
  var parameters = new Array();
  parameters = queryString.split('&');
  for(var i = 0; i < parameters.length; i++) {
    if (parameters[i].indexOf(parameterName)>=0) {
      var parameterValue = new Array();
      parameterValue = parameters[i].split('=');
      return parameterValue[1];
    }
  }
  return 0;
}

var lschatWinLoadStatus = getParameter("ls_cs");
var ls_chatsess_s = escape(livsrvgetCookie("ls_chatsess1947"));
var ls_chatbox_s  = escape(livsrvgetCookie("ls_chatbox1947"));
var ls_brodet_s	  = escape(livsrvgetCookie("ls_brodet1947"));

var tls_tempcs_id = livsrvgetCookie("ls_tempcs_id1947");
var tls_serverip = livsrvgetCookie("ls_serverip1947");
var pInitSess = livsrvgetCookie("ls_initsess1947");

if (tls_tempcs_id == "")
{
	tls_tempcs_id =  "NA";
	tls_serverip = "NA";
}
if(pInitSess == "")
{
	pInitSess = "NA";
}

var ls_nexturl = "";
var did = "1947";


var pageUrl = "NA";

try{
pageUrl = escape(window.top.location.href);
}
catch(e){}


var testpageUrl = "";
try
{
    testpageUrl = window.location.search.substring(1);
}
catch(e)
{}



if(pageUrl.indexOf("livserv_cs_id")>=0 || testpageUrl.indexOf("test_cs_id") != -1)
{
	ls_chatsess_s = "";
}

var ls_chat_url = "";

if(pageUrl.indexOf("brigadegroup.com/residential/helpful-tools/electronic-fund-transfer")== -1){
    if (ls_chatsess_s == "")
    {
    	ls_nexturl = '<script src="' + protocalType + '://sub1.livserv.in/livserv/livservtemp3/index.jsp?did=1947&pid=1&gtm=null' + '&count=' + new Date().getTime() + '"></script>';
    	ls_chat_url = protocalType + '://sub1.livserv.in/livserv/livservtemp3/index.jsp?did=1947&pid=1&gtm=null' + '&count=' + new Date().getTime();
    }
    else
    {
    	ls_nexturl = '<script src="' + protocalType + '://sub1.livserv.in/livserv/livservtemp3/GetLivservWindow.jsp?did=1947&pid=1&exParam=null&browserUrl=' +  pageUrl + '&ls_chatsess=' + ls_chatsess_s + '&ls_chatbox=' + ls_chatbox_s + '&ls_brodet=' + ls_brodet_s + '&pCsid=' + tls_tempcs_id + '&pSrvid=' + tls_serverip + '&pInitSess=' + pInitSess +  '&count=' + new Date().getTime() + '" ></script>';
    	ls_chat_url = protocalType + '://sub1.livserv.in/livserv/livservtemp3/GetLivservWindow.jsp?did=1947&pid=1&exParam=null&browserUrl=' +  pageUrl + '&ls_chatsess=' + ls_chatsess_s + '&ls_chatbox=' + ls_chatbox_s + '&ls_brodet=' + ls_brodet_s + '&pCsid=' + tls_tempcs_id + '&pSrvid=' + tls_serverip + '&pInitSess=' + pInitSess +  '&count=' + new Date().getTime();
    }
}



if(1947 == 508 || 1947 == 6466 || 1947 == 16162 ||  1947 == 16869 ||  1947 == 7596 || 1947 == "8228" || 1947 == "1983" || 1947 ==  "12108" || 1947 == "11912" || 1947 == "12196" || 1947 == "17015" || 1947 == "14218" || 1947 == "17339" || 1947 == "4331" || 1947 == "18185" || 1947 == "15144"  || 1947 == "17552"   || 1947 == "10975"  || 1947 == "6202" || 1947 == "18637" || 1947 == "18492" || 1947 == "16353" || 1947 == "16345" || 1947 == "8228" || 1947 == "8623"  || 1947 == "14373" || 1947 == "16661" || 1947 == "6808"  || 1947 == "15144" || 1947 == "5054"  || 1947 == "16394" || 1947 == "6171"  || 1947 == "16378"  || 1947 == "16386" || 1947 == "18772" || 1947 == "9901"  || 1947 == "18645" || 1947 =="19045")
{
	loadLsChat();
}
else if( 1947 == 7153 ){
    if(lschatWinLoadStatus != "no"){
        loadLsChat();
    }
}
else if(1947 == 57200000)
{
	
	if((timeHour1 <= 7 || timeHour1 > 18))
	{
		document.write(ls_nexturl);
	}

}
else{
    document.write(ls_nexturl);
    //loadLsChat();
}

function loadLsChat(){

	(function(){
		var s = document.createElement('script');
		s.type = "text/javascript";
		s.async = true;
		s.src = ls_chat_url;
		document.body.appendChild(s);
	})();
}