(function() {
var license = '1063868',
    params = '',
    lang = 'en',
    skill = '0';

__lc_load = function (p) { if (typeof __lc_loaded != 'function')
  if (p) { var d = document, l = d.createElement('script'), s = d.getElementsByTagName('script')[0], a = unescape('%26'),
    h = ('https:' == d.location.protocol ? 'https://' : 'http://'); l.type = 'text/javascript'; l.async = true;
    l.src = h + 'gis' + p +'.livechatinc.com/gis.cgi?serverType=control'+a+'licenseID='+license+a+'jsonp=__lc_load';
    if (!(typeof p['server'] !== 'string' || typeof __lc_serv === 'string')) {
      l.src = h + (__lc_serv = p['server']) + '/licence/'+license+'/script.cgi?lang='+lang+a+'groups='+skill;
      l.src += (params == '') ? '' : a+'params='+encodeURIComponent(encodeURIComponent(params)); s.parentNode.insertBefore(l, s);
    } else setTimeout(__lc_load, 1000); if(typeof __lc_serv != 'string'){ s.parentNode.insertBefore(l, s);}
  } else __lc_load(Math.ceil(Math.random()*5)); }
__lc_load();
})();
		  
$(document).ready(function() {
		
	CheckLiveChatStatus();
	
});

function CheckLiveChatStatus()
{
	
	$.ajax({
	url: "//www.discountfilters.com/livechat_status.php",
	success: function(html){ 
			if(html == "online")
			{
				$("#top_livechat").fadeIn();
			} else {
				$("#top_livechat").hide();
			}	
			setTimeout('CheckLiveChatStatus()', 30000);
		}
	});
		
}
