/*
* pass the 3 character segment id into this method (or whatever string you want)
* returns true if the segment exists in the users cookie
* returns false if it does not exist, or if the flashtalking cookie does not exist
* will only work in javasript served from *.flashtalking.com
*/
var isSegmentSet = function(seg)
{
var bs = decodeURIComponent('%'+'5c');
var ptn = new RegExp("^.+?segment="+bs+"((.+?)"+bs+").+?$");
var matches = document.cookie.match(ptn);
if(matches === null) return false;
var segs = matches[1];
var ptn = new RegExp("(^|,)("+seg+")(-|,|$)");
var val = segs.match(ptn);
if(val === null) return false;
if(val[2] === seg) return true;
return false;
};
//example usage
if(isSegmentSet('abc')){
//do nothing
}else{
//fire the flashtalking segment pixel for abc and also fire the DSP pixel
}