
// get a cookie by name
function getCookie(name) {
var search = name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
var offset = document.cookie.indexOf(search)
// if cookie exists
if (offset != -1) {
offset += search.length
// set index of beginning of value
var end = document.cookie.indexOf(";", offset);
// set index of end of cookie value
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}
// returns true if the value is found in the Open Phone List
function inOpenPhoneList(value)
{
if (openPhones[value] == value) return true;
else return false;
}
// get the list of Open Phones from the cookie
function getOpenPhoneList()
{
var values = getCookie("OpenPhones");
// alert("openphones-"+values);
if (values.length > 0) {
var offset=0;
while (offset < values.length) {
var end = values.indexOf(",", offset);
if (end < offset) end = values.length;
var phone=values.substring(offset, end);
openPhones[phone]=phone;
offset = end+1;
}
}
}
function showZip(suffix)
{
var link = document.getElementById("zipLabel"+suffix);
var zip_number = document.getElementById("zipVal"+suffix);
if (link != null) {
link.style.display = "none";
}
if (zip_number != null) {
zip_number.style.display = "";
}
// showObject('zipVal'+suffix);
// hideObject('zipLabel'+suffix);
}
// used to show the phone number without logging a click
function showPhone(suffix)
{
if(showObject('phoneLink'+suffix)) {
showObject('phoneLabel'+suffix);
hideObject('phoneVal'+suffix);
}
}
// used to show the phone number without logging a click
function closePhone(suffix)
{
if(showObject('phoneLabel'+suffix)) {
showObject('phoneLink'+suffix);
hideObject('phoneVal'+suffix);
hideObject('phoneLabel'+suffix);
}
}
// add a phone id to the open phone list and store it in the cookie
function addToOpenPhoneList(value)
{
openPhones[value] = value;
var values= escape(listToString(openPhones));
document.cookie="OpenPhones="+values;
// alert("cookie-"+document.cookie);
}
function listToString(list) {
var outString = "";
for (anItem in list) {
outString += anItem + ",";
}
if(outString.length > 0) {
outString = outString.substring(0, outString.length-1);
}
return outString;
}
function doEmailLink(bidClickUrl, listingClickInfo, suffix)
{
var rtn = true;
if(showObject('emailVal'+suffix)) {
rtn = false;
hideObject('emailLink'+suffix);
showObject('emailLabel'+suffix);
logClick(bidClickUrl, listingClickInfo, "emailReveal");
}
return rtn;
}
function doSendLinkNoLog(bidClickUrl, listingClickInfo, suffix)
{
var rtn = true;
if(showObject('sendVal'+suffix)) {
rtn = false;
//hideObject('sendLink'+suffix);
showObject('sendLabel'+suffix);
logClick(bidClickUrl, listingClickInfo, "sendReveal");
}
return rtn;
}
function doSendLink(bidClickUrl, listingClickInfo, suffix)
{
var rtn = true;
if(showObject('sendVal'+suffix)) {
rtn = false;
//hideObject('sendLink'+suffix);
showObject('sendLabel'+suffix);
logClick(bidClickUrl, listingClickInfo, "sendReveal");
}
return rtn;
}
function doSendLinkB(bidClickUrl, listingClickInfo, suffix)
{
var rtn = true;
if(showObject('sendVal'+suffix)) {
rtn = false;
hideObject('sendLink'+suffix);
showObject('sendLabel'+suffix);
logClick(bidClickUrl, listingClickInfo, "sendReveal");
}
return rtn;
}
function doPhoneLink(bidClickUrl, listingClickInfo, suffix,clkTracker)
{
var rtn = true;
if(showObject('phoneVal'+suffix)) {
rtn = false;
hideObject('phoneLink'+suffix);
showObject('phoneLabel'+suffix);
logClick(bidClickUrl, listingClickInfo, "phoneReveal",clkTracker);
addToList(bidClickUrl, listingClickInfo);
}
return rtn;
}
function getObject(objID)
{
if (document.all)
{
var obj = document.all[objID];
}
else if (document.getElementById)
{
var obj = document.getElementById(objID);
}
return obj;
}
function hideObject(objID)
{
var obj = getObject(objID);
var rtn = false;
if (obj != null) {
obj.style.display = "none";
rtn = true;
}
return rtn;
}
function showObject(objID)
{
var obj = getObject(objID);
var rtn = false;
if (obj != null) {
obj.style.display = "inline";
// obj.style.width = "auto";
// obj.style.height = "auto";
obj.style.overflow = "visible";;
rtn = true;
}
return rtn;
}
function timelogClick(t) {
var img = new Image();
img.src = t;
}
function doReviews(bidClickUrl, listingClickInfo,clickType,url)
{
var landingurl = logReviewsClick(bidClickUrl, listingClickInfo, clickType,url);
return landingurl;
}
function logReviewsClick(bidClickUrl, listingClickInfo, clickType,url)
{
var img = new Image();
var d = new Date();
var s_clickBase = bidClickUrl + "&FL="+clickType+"&TL=ureviews"+ listingClickInfo + "&LOC=";
tsrc = s_clickBase +url+"&lrv=1";
return tsrc;
}
function openSaveSend (index){
var savesendLnk = document.getElementById('savesendLink'+index);
var savesendLbl = document.getElementById('savesendLabel'+index);
var savesendFlippy = document.getElementById('savesendFlippy'+index);
if(savesendLnk && savesendLbl) {
savesendLnk.style.display = 'none';
savesendLbl.style.display = '';
savesendFlippy.style.display = '';
}
}
function closeSaveSend (index){
var savesendLnk = document.getElementById('savesendLink'+index);
var savesendLbl = document.getElementById('savesendLabel'+index);
var savesendFlippy = document.getElementById('savesendFlippy'+index);
if(savesendLnk && savesendLbl) {
savesendLnk.style.display = '';
savesendLbl.style.display = 'none';
savesendFlippy.style.display = 'none';
}
}