﻿function OpenLiveChat()
{
    lpButtonCTTUrl = 'http://server.iad.liveperson.net/hc/84152841/?' +
                'cmd=file&file=visitorWantsToChat&site=84152841&SESSIONVAR!skill=Archstone&' +
                'SESSIONVAR!Management%20Company=Archstone&' +
                'SESSIONVAR!Community=' + asn_scriptVariables.Community_CommunityName + 
                '&SESSIONVAR!Ad%20Source=ArchstoneApartments.com&' +
                'imageUrl=http://www.archstoneapartments.com/library/images/&referrer=' + escape(document.location);

    lpButtonCTTUrl = (typeof (lpAppendVisitorCookies) != 'undefined' ? 
        lpAppendVisitorCookies(lpButtonCTTUrl) : lpButtonCTTUrl);
    lpButtonCTTUrl = ((typeof (lpMTag) != 'undefined' && typeof (lpMTag.addFirstPartyCookies) != 'undefined') ?
        lpMTag.addFirstPartyCookies(lpButtonCTTUrl) : lpButtonCTTUrl); 
    
    window.open(lpButtonCTTUrl, 'chat84152841', 'width=475,height=400,resizable=yes');
}
            
var lpMTagConfig = {'lpServer' : "server.iad.liveperson.net",'lpNumber' : "84152841",'lpProtocol' : "http"}; 
function lpAddMonitorTag(src){
    if(typeof(src)=='undefined'||typeof(src)=='object'){
        src=lpMTagConfig.lpMTagSrc?lpMTagConfig.lpMTagSrc:'/hcp/html/mTag.js';
    }
    if(src.indexOf('http')!=0){
        src=lpMTagConfig.lpProtocol+"://"+lpMTagConfig.lpServer+src+'?site='+lpMTagConfig.lpNumber;
    }
    else{
        if(src.indexOf('site=')<0){
            if(src.indexOf('?')<0)src=src+'?';
            else src=src+'&';src=src+'site='+lpMTagConfig.lpNumber;
         }
    };
    var s=document.createElement('script');
    s.setAttribute('type','text/javascript');
    s.setAttribute('charset','iso-8859-1');
    s.setAttribute('src',src);
    document.getElementsByTagName('head').item(0).appendChild(s);
} 
if (window.attachEvent) 
    window.attachEvent('onload',lpAddMonitorTag); 
else 
    window.addEventListener("load",lpAddMonitorTag,false);

if (typeof (lpMTagConfig.sessionVar) == "undefined") { lpMTagConfig.sessionVar = new Array(); }
lpMTagConfig.sessionVar[lpMTagConfig.sessionVar.length] = 'skill=Archstone';
lpMTagConfig.sessionVar[lpMTagConfig.sessionVar.length] = 'Management Company=Archstone';
lpMTagConfig.sessionVar[lpMTagConfig.sessionVar.length] = 'Community=' + asn_scriptVariables.Community_CommunityName + '';
lpMTagConfig.sessionVar[lpMTagConfig.sessionVar.length] = 'Ad Source=ArchstoneApartments.com';


