var _____WB$wombat$assign$function_____ = function(name) {return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name)) || self[name]; };
if (!self.__WB_pmw) { self.__WB_pmw = function(obj) { this.__WB_source = obj; return this; } }
{
let window = _____WB$wombat$assign$function_____("window");
let self = _____WB$wombat$assign$function_____("self");
let document = _____WB$wombat$assign$function_____("document");
let location = _____WB$wombat$assign$function_____("location");
let top = _____WB$wombat$assign$function_____("top");
let parent = _____WB$wombat$assign$function_____("parent");
let frames = _____WB$wombat$assign$function_____("frames");
let opener = _____WB$wombat$assign$function_____("opener");
// PATENT PENDING
function _vs_popup(url, wid, ht){
var win;
ht = ht || 600;
wid = wid || 650;
win = window.open(url, 'VSPOPUP', "toolbar=no,status=no,location=no,menubar=no,"+
"resizable=yes,scrollbars=yes,height=" + ht + ",width=" + wid, 'yes');
win.opener = self;
win.focus();
win.location = url;
}
var _vsrkpd = {
R: /(\(?)(\d*)(\d{3})([\s\)\.\-]*)(\d{3})([\s\.\-]*)(\d{4})(\d*)/,
dbg: document.URL.match(/\?.*_vsdebug/),
esc: function(txt){
if(typeof encodeURIComponent=="function"){
return encodeURIComponent(txt)
}else{
return escape(txt)
}
},
unesc: function(txt){
if(typeof decodeURIComponent=="function"){
return decodeURIComponent(txt)
}else{
return unescape(txt)
}
},
arg: function(p, v){
if( v ){
return p + '=' + this.esc(v) + ';';
}else{
return '';
}
},
'_debugtxt': '',
debug: function(m){
this._debugtxt = this._debugtxt + m + "\n";
},
alert: function(m){
if( this.dbg ){
if (typeof console != 'undefined' && typeof console.log == 'function') {
console.log(m);
} else {
alert(m);
}
}
},
set_cookie: function(name, val, exp){
var ck = name + "=" + this.esc( val ) + ";path=/";
if(exp){
var now = new Date();
exp = new Date( now.getTime + exp );
ck = ck + ";expires=" + exp.toGMTString();
}
document.cookie = ck;
},
get_cookie: function(n){
var c = document.cookie;
var s = c.indexOf( n + '=' );
if( s == -1 ) return null;
if( s && c.charAt(s-1) != ' ' ) return null;
var e = c.indexOf(';', s);
if( e == -1 ) e = c.length;
return this.unesc(c.substring( s + n.length + 1, e ));
},
get_number_data: function(){
var n = 'rkpd_' + vs_account_id;
var d = this.get_cookie(n);
var ignck = document.URL.match(/\?.*_vsignck/);
if( ! vs_account_id ){
// misconfigured. user did not set the account id
return ;
}
if( d && !ignck ){
this.debug( "cookie[" + n + "]: " + d);
eval(d); // json-cookie
this.rewrite_document();
}else{
// fetch data
var url = "http://web.archive.org/web/20090322091342/http://calltracking.fathomseo.com/euinc/getnumdata.js?"
+ this.arg('var', '_vsrkpd.d')
+ this.arg('acc', window.vs_account_id)
+ this.arg('cky', n)
+ this.arg('ign', (ignck ? 1 : 0))
+ this.arg('ref', document.referrer)
+ this.arg('url', document.URL);
if (typeof vs_ref_override != 'undefined' && vs_ref_override) url += this.arg('ref_ovrd', vs_ref_override);
this.debug( "no cookie[" + n + "] fetch: " + url);
document.write('');
// next script will run rewrite_document
}
},
rewrite_number: function(m){
// (, x, 111, ), 555, -, 1234, x
var numfull = '' + m[1] + m[2] + m[3] + m[4] + m[5] + m[6] + m[7] + m[8];
if( m[2] != '' || m[8] != '' ){
this.debug( "not a number: " + numfull );
return null;
}
var num = '' + m[3] + m[5] + m[7];
var pd = this.d;
var rw,lk,na,nb,nc,rwtxt;
var nr = pd.length;
var i;
for(i=0; i " + rw);
}else{
pd[i].ctcp = 1; // no number, force ctc
this.debug("rewriting: " + numfull + " => click-to-call");
}
rwtxt = '';
if( pd[i].txtl ) rwtxt += pd[i].txtl;
if( rw ) rwtxt += rw;
if( pd[i].txtr ) rwtxt += pd[i].txtr;
if( ! rwtxt ){
// provide default text if none
rwtxt = 'Click-To-Call';
}
if( pd[i].ctcp ){
lk = 'http://web.archive.org/web/20090322091342/http://calltracking.fathomseo.com/euinc/ctc/callformpop?cmp=' + pd[i].cmp;
}
return { text: rwtxt, href: lk, cmp: pd[i].cmp };
}
}
return null;
},
rewrite_text_node: function(node){
var txt = node.nodeValue;
var m = this.R.exec(txt);
if( !m ) return; // no match
var rw = this.rewrite_number(m);
// split into 3 nodes => text, number, text
var n2 = node.splitText( m.index );
var n3 = n2.splitText( m[0].length );
if( ! rw ) return; // number unchanged
n2.nodeValue = rw.text;
if( ! rw.href ) return; // no ctc
var a = document.createElement('A');
node.parentNode.replaceChild(a, n2);
a.appendChild(n2);
a.href = '#';
a.className = 'vsctcnumber';
if( this.dbg ){
a.title = 'cmp:' + rw.cmp;
}else{
a.title = 'Click To Call';
}
a.onclick = function(){ _vs_popup( rw.href, 300,200 ); };
// ...
},
replace_all_numbers: function(node){
if( ! node ) return;
// skip certain types?
if( node.nodeName == 'SCRIPT' || node.nodeName == 'STYLE' ) return;
// handle special spans?
if( node.className == 'vsnotnumber' ) return;
// rewrite this node text
if( node.nodeName == '#text' ){
this.rewrite_text_node( node );
}
// walk children nodes
var nn, i;
for(i=0; i