checkmeter();
function checkmeter()
{
// first week, turn off the paymeter
return(1);
var curURL = String(window.location);
var IsSubscriber = String(getpwCookie('IsSubscriber'));
if(IsSubscriber == "True")
{
// we're already logged in
var eToken = String(getpwCookie('Eedition'));
// have we checked in today?
// never mind, register every page view...
// var DidThat = String(getpwCookie('ABCcount'));
// if(DidThat !== "True")
// {
encURL = encodeURIComponent(curURL);
var track = new Image();
track.src="https://dpw1.pressdemocrat.com/TrackWebSiteUsage.aspx?token=" + eToken + "&storyURL=" + encURL;
// setABCCookie(); // mark that we checked in for today
// }
// modify the "login / my account" link
// var loginURL = "https://dpw1.pressdemocrat.com/login.aspx";
// var eeURL = "http://santarosapressdemocrat.ca.newsmemory.com/?token=" + eToken;
// var links = 'My Account | Read Today\'s eEdition';
// $('#loginlinks').html(links);
// modify the "read the paper" link
// $('#paperlink').attr('href', eeURL);
return(1);
}
else
{
// modify the "login" link
var loginURL = "https://dpw1.pressdemocrat.com/login.aspx?SentFromUrl=" + curURL;
// var links = 'Login | Subscribe | Read Today\'s Paper';
// $('#loginlinks').html(links);
// modify the "read the paper" link
// $('#paperlink').attr('href', loginURL);
}
// check if this is a metered page
var bits = curURL.split("/");
if(bits.length <= 4)
return(0);
sectionname = bits[3];
pos = sectionname.indexOf("multimedia")
if(pos == 0)
return(0);
pageno = bits[4];
pos = pageno.indexOf("181")
if(pos == -1)
return(0);
var prevURL = String(document.referrer);
if(prevURL.indexOf("pressdemocrat.com") == -1)
return(99);
var views = Number(getpwCookie('PD_free'));
// increment the view count
var views1 = views + 1;
setpwCookie('PD_free', views1);
if(views == 12) // hit the speed bump first
{
$(document).ready(function() {
hideArticle();
});
}
else if(views >= 18) // time to sign up!
{
var newURL = "https://dpw1.pressdemocrat.com/login.aspx?SentFromUrl=";
var qpos = curURL.indexOf('?');
if(qpos != -1)
curURL = curURL.substr(0, qpos);
newURL = newURL + curURL;
window.location.assign(newURL);
}
}
////////////////////////////////
function getpwCookie(cname)
{
var i,name, val;
var ARRcookies=document.cookie.split(";");
for (i=0; i