function GetCookie (name){
var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
//alert ("GetCookie name: " + name);
//alert ("GetCookie lngth: " + clen);
//alert ("GetCookie document.cookie: " + document.cookie);
var i = 0;
while (i < clen) {
var j = i + alen;
if (document.cookie.substring(i, j) == arg) return getCookieVal(j);
i = document.cookie.indexOf(" ", i) + 1;
if (i == 0) break;
}
return null;
}
function SetCookie (name, value,TimeToLive )
{
var argv = SetCookie.arguments;
var argc = SetCookie.arguments.length;
var path = "/";
//domains need to consist of 2 periods
var cookieDomain = ".switchboard.com";
if ( typeof( window[ 'SWBD_DomainOverride' ] ) != "undefined" )
{
cookieDomain = SWBD_DomainOverride;
}
var OneMinute = 60 * 1000;
var OneHour = OneMinute * 60;
var OneDay = OneHour * 24;
TargetDate = new Date();
ExpTime = TargetDate.getTime();
ExpTime += (OneDay * TimeToLive);
TargetDate.setTime(ExpTime);
expires = TargetDate.toGMTString();
NewCookie = name+"="+value+"; expires=" + expires + "; path=" + path + ";";
//not writing cookie with a domain when running on localhost or test server
if (document.domain.indexOf('switchboard.com') >= 0) {
NewCookie = name+"="+value+"; expires=" + expires + "; path=" + path + "; domain=" + cookieDomain + ";";
}
document.cookie = NewCookie;
//alert("NewCookie: " + NewCookie);
}
function getCookieVal(offset)
{
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}
function GetSubCookie (name, cookiestring)
{
var ccString = new String(cookiestring);
var CookieAray = ccString.split("&");
var itemcount = CookieAray.length;
var subitemarray;
var i = 0;
while (i < itemcount)
{
if ( -1 != CookieAray[i].search(name) )
{
subitemarray = CookieAray[i].split("=");
return subitemarray[1];
}
i = i+1;
}
return null;
}
function DeleteCookie(cn)
{ var cs = GetCookie(cn);
if(cs != null){SetCookie(cn, cs, -30);}
}
function comp(str1,str2)
{ return str1.toUpperCase()==str2.toUpperCase();
}
function _hbLink(RecentSearches,MostRecentSearches,Empty)
{}
function initStartPage()
{
if ( document.getElementById('swbgetcat') )
{
if ( document.swbgetcat.KW.style.visibility=="visible" )
{
document.swbgetcat.KW.focus();
}
}
}
addLoadEvent(initStartPage);
function _hbLink(RecentSearches,MostRecentSearches,Empty)
{}
function evaluateFeedback(myFeedback,myWhitePagesUrl)
{
if (myFeedback != null) {
if (myFeedback.selectedIndex > -1) {
if (myFeedback.options[myFeedback.selectedIndex].value ==
"How to Remove White Page Listings") {
window.open(myWhitePagesUrl,'mywindow','width=640,height=480,scrollbars=yes');
}
}
}
}