var cnum=document.getElementById('chatscr').src,chatlpnum=cnum.replace(/^[^\?]+\??/,'');var jaaulde=window.jaaulde||{};jaaulde.utils=jaaulde.utils||{};jaaulde.utils.cookies=function(){var e,t,n,r,i={expiresAt:null,path:"/",domain:null,secure:false};e=function(e){var t,n;if(typeof e!=="object"||e===null){t=i}else{t={expiresAt:i.expiresAt,path:i.path,domain:i.domain,secure:i.secure};if(typeof e.expiresAt==="object"&&e.expiresAt instanceof Date){t.expiresAt=e.expiresAt}else if(typeof e.hoursToLive==="number"&&e.hoursToLive!==0){n=new Date;n.setTime(n.getTime()+e.hoursToLive*60*60*1e3);t.expiresAt=n}if(typeof e.path==="string"&&e.path!==""){t.path=e.path}if(typeof e.domain==="string"&&e.domain!==""){t.domain=e.domain}if(e.secure===true){t.secure=e.secure}}return t};t=function(t){t=e(t);return(typeof t.expiresAt==="object"&&t.expiresAt instanceof Date?"; expires="+t.expiresAt.toGMTString():"")+"; path="+t.path+(typeof t.domain==="string"?"; domain="+t.domain:"")+(t.secure===true?"; secure":"")};n=function(){var e={},t,n,r,i,s=document.cookie.split(";"),o;for(t=0;t<s.length;t=t+1){n=s[t].split("=");r=n[0].replace(/^\s*/,"").replace(/\s*$/,"");try{i=decodeURIComponent(n[1])}catch(u){i=n[1]}if(typeof JSON==="object"&&JSON!==null&&typeof JSON.parse==="function"){try{o=i;i=JSON.parse(i)}catch(a){i=o}}e[r]=i}return e};r=function(){};r.prototype.get=function(e){var t,r,i=n();if(typeof e==="string"){t=typeof i[e]!=="undefined"?i[e]:null}else if(typeof e==="object"&&e!==null){t={};for(r in e){if(typeof i[e[r]]!=="undefined"){t[e[r]]=i[e[r]]}else{t[e[r]]=null}}}else{t=i}return t};r.prototype.filter=function(e){var t,r={},i=n();if(typeof e==="string"){e=new RegExp(e)}for(t in i){if(t.match(e)){r[t]=i[t]}}return r};r.prototype.set=function(e,n,r){if(typeof r!=="object"||r===null){r={}}if(typeof n==="undefined"||n===null){n="";r.hoursToLive=-8760}else if(typeof n!=="string"){if(typeof JSON==="object"&&JSON!==null&&typeof JSON.stringify==="function"){n=JSON.stringify(n)}else{throw new Error("cookies.set() received non-string value and could not serialize.")}}var i=t(r);document.cookie=e+"="+encodeURIComponent(n)+i};r.prototype.del=function(e,t){var n={},r;if(typeof t!=="object"||t===null){t={}}if(typeof e==="boolean"&&e===true){n=this.get()}else if(typeof e==="string"){n[e]=true}for(r in n){if(typeof r==="string"&&r!==""){this.set(r,null,t)}}};r.prototype.test=function(){var e=false,t="cT",n="data";this.set(t,n);if(this.get(t)===n){this.del(t);e=true}return e};r.prototype.setOptions=function(t){if(typeof t!=="object"){t=null}i=e(t)};return new r}();(function(){if(window.jQuery){(function(e){e.cookies=jaaulde.utils.cookies;var t={cookify:function(t){return this.each(function(){var n,r=["name","id"],i,s=e(this),o;for(n in r){if(!isNaN(n)){i=s.attr(r[n]);if(typeof i==="string"&&i!==""){if(s.is(":checkbox, :radio")){if(s.attr("checked")){o=s.val()}}else if(s.is(":input")){o=s.val()}else{o=s.html()}if(typeof o!=="string"||o===""){o=null}e.cookies.set(i,o,t);break}}}})},cookieFill:function(){return this.each(function(){var t,n,r=["name","id"],i,s=e(this),o;n=function(){t=r.pop();return!!t};while(n()){i=s.attr(t);if(typeof i==="string"&&i!==""){o=e.cookies.get(i);if(o!==null){if(s.is(":checkbox, :radio")){if(s.val()===o){s.attr("checked","checked")}else{s.removeAttr("checked")}}else if(s.is(":input")){s.val(o)}else{s.html(o)}}break}}})},cookieBind:function(t){return this.each(function(){var n=e(this);n.cookieFill().change(function(){n.cookify(t)})})}};e.each(t,function(t){e.fn[t]=this})})(window.jQuery)}})()
var agentCode="";var agentname="";function popitup(e){newwindow=window.open(e,"name","height=475,width=478,resizable=no,status=no,toolbar=no,location=no,menubar=no,top=120,left=140");return false}function setButtonURL(){XLPHelper.wantToLiveChat()}
function xlpAddMonitorTag(e){if(typeof e=="undefined"||typeof e=="object"){e=xlpMTagConfig.xlpMTagSrc?xlpMTagConfig.xlpMTagSrc:"/bundles/tracking"}if(e.indexOf("http")!=0){e=xlpMTagConfig.xlpProtocol+"://"+xlpMTagConfig.xlpCode+"."+xlpMTagConfig.xlpServer+e}else{if(e.indexOf("site=")<0){if(e.indexOf("?")<0)e=e+"?";else e=e+"&";e=e+"site="+xlpMTagConfig.xlpNumber}}var t=document.createElement("script");t.setAttribute("type","text/javascript");t.setAttribute("charset","iso-8859-1");t.setAttribute("src",e);document.getElementsByTagName("head").item(0).appendChild(t)}xlpMTagConfig={xlpServer:"xchatlivepro.com",xlpCode:chatlpnum,xlpProtocol:"http"};xlpAddMonitorTag()
function GetCookie(e){cookieval=$.cookies.get(e);return cookieval}function Get_CookieStudent(e){var t=document.cookie.split(";");var n="";var r="";var s="";var o=false;for(i=0;i<t.length;i++){n=t[i].split("=");if(n!=null){if(n.length>1){r=n[1].replace(/^\s+|\s+$/g,"")}}if(r==e){o=true;if(n.length>1){s=unescape(n[2].replace(/^\s+|\s+$/g,""))}return s;break}n=null;r=""}if(!o){return null}}function MonitorTag(){agentname=GetCookie("salesAgentName");agentskill=GetCookie("skill");LCStatus=GetCookie("LCStatus");LCSPriority=GetCookie("LCSPriority");CustomerName=GetCookie("CustomerName");CustomerCode=Get_CookieStudent("STUDENTCODE");if(LCStatus==null){LCStatus="Unknown Customer"+" - "+"Signup Pending";LCSPriority="1c"}setSessionVar()}function setSessionVar(){if(typeof xlpMTagConfig.sessionVar=="undefined"){xlpMTagConfig.sessionVar=new Array}if(agentskill!=null&&agentskill!=""){xlpMTagConfig.sessionVar[xlpMTagConfig.sessionVar.length]="skill="+agentskill}if(agentname!=null&&agentname!=""){xlpMTagConfig.sessionVar[xlpMTagConfig.sessionVar.length]="AgentName="+agentname}if(LCStatus!=null&&LCStatus!=""){xlpMTagConfig.sessionVar[xlpMTagConfig.sessionVar.length]="Life Cycle Status="+LCStatus}if(LCSPriority!=null&&LCSPriority!=""){xlpMTagConfig.sessionVar[xlpMTagConfig.sessionVar.length]="LC Status Priority="+LCSPriority}if(CustomerName!=null&&CustomerName!=""){xlpMTagConfig.sessionVar[xlpMTagConfig.sessionVar.length]="Customer Name="+CustomerName;xlpMTagConfig.sessionVar[xlpMTagConfig.sessionVar.length]="identifier="+CustomerName}}var cookieval="";var agentname="";var LCStatus="";var LCSPriority="";var CustomerName="";var CustomerCode="";var agentskill="";MonitorTag()


//tracking code
$(document).ready(function(){TrackCurrentVisitor();});function TrackCurrentVisitor(){if(parent.document!=null)
varReferrer=parent.document.referrer;if(document.referrer!=null){varLP=document.referrer;}
if(varReferrer==varLP){varLP=document.URL;}
if(document.referrer!=null){var qs=document.referrer.split('?')[1];if(qs==undefined){qs=document.location.href.split('?')[1];}
if(getVisitorCookie("Parameters")==null)
createVisitorCookie("Parameters",qs,30);if(getVisitorCookie("Network")==null&&getVisitorParameterByName('network')!='')
createVisitorCookie("Network",getVisitorParameterByName('network'),30);if(getVisitorCookie("Place")==null&&getVisitorParameterByName('place')!='')
createVisitorCookie("Place",getVisitorParameterByName('place'),30);if(getVisitorCookie("ADId")==null&&getVisitorParameterByName('adid')!='')
createVisitorCookie("ADId",getVisitorParameterByName('adid'),30);if(getVisitorCookie("KeYWD")==null&&getVisitorParameterByName('kw')!='')
createVisitorCookie("KeYWD",getVisitorParameterByName('kw'),30);if(getVisitorCookie("MatchType")==null&&getVisitorParameterByName('matchtype')!='')
createVisitorCookie("MatchType",getVisitorParameterByName('matchtype'),30);}
if(varReferrer!=''){if(getVisitorCookie("RefererURL")==null)
createVisitorCookie("RefererURL",varReferrer,30);}
if(varLP!=''){if(getVisitorCookie("LandingPage")==null)
createVisitorCookie("LandingPage",varLP,30);}}
function getVisitorParameterByName(name){var ref=document.URL;if(ref==null||ref=='')
return"";name=name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");var regexS="[\\?&]"+name+"=([^&#]*)";var regex=new RegExp(regexS);var results=regex.exec(ref);if(results==null)
return"";else
return decodeURIComponent(results[1].replace(/\+/g," "));}
function createVisitorCookie(name,value,days){if(days){var date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));var expires="; expires="+date.toGMTString();}
else var expires="";document.cookie=name+"="+value+expires+"; path=/";}
function getVisitorCookie(NameOfCookie){if(document.cookie.length>0){begin=document.cookie.indexOf(NameOfCookie+"=");if(begin!=-1)
{begin+=NameOfCookie.length+1;end=document.cookie.indexOf(";",begin);if(end==-1)end=document.cookie.length;return unescape(document.cookie.substring(begin,end));}}
return null;}
