//0 Greater Boston Tab - s.tab is ""
//1 Globe Tab  s.tab is "globe"
//2 yellowpages tab  s.tab is "yp"
//3 site search

//a. No results from query, and user is on the Globe tab
//This points to [1][0]
//b. No results from query, date parameters are set, and user is on Greater Boston tab
//This points to [0][0]
//c. The page is passed a query parameter value named "t";  the value of this parameter will be the number of the tip to display
//This points to whatever is the correct tab, and sets the index to t

var displayTips = new Array();
//This is greater boston sidecar tips
displayTips[0]=new Array();
//This is globe
displayTips[1]=new Array();
//This is yp
displayTips[2]=new Array();
//This is site
displayTips[3]=new Array();
//This is travel
displayTips[4]=new Array();

displayTips[0][0]="<div class='searchTip'><h3>Looking for a Globe article?</h3></div>"+
"<div class='at'>Click the checkbox for \"Boston Globe articles only\", right next to the search box.</div>"
displayTips[0][1]="<div class='searchTip'><h3>Too many results?</h3></div>"+
"<div class='at'>Use \"More Search Options\" to limit your search to selected types of sites.</div>";
displayTips[0][2]="<div class='searchTip'><h3>Looking for a business?</h3></div>"+
"<div class='at'>Click on the \"Businesses\" tab right above the search box to get results from Google Local.</div>";
displayTips[0][3]="<div class='searchTip'><h3>What is 'Local Search'?</h3></div>"+
"<div class='at'>Local Search combines Boston.com info, news from The "+
"Boston Globe and other Boston news sources, opinion from Boston-area blogs, "+
"business listings from Google, and information from more than 5,000 other local websites.</div>";
displayTips[0][4]="<div class='searchTip'><h3>Searching by date?</h3></div>"+
"<div class='at'>For stories published in The Boston Globe and on Boston.com, search by date using \"More Search Options.\" But for information from other sites, a search by exact publication date is not available.</div>";
displayTips[0][5]="<div class='searchTip'><h3>Too few results?</h3></div>"+
"<div class='at'>Use fewer keywords.  The search engine looks for articles and web pages that include ALL the keywords you typed in.</div>";
displayTips[0][6]="<div class='searchTip'><h3>Looking for the latest news?</h3></div>"+
"<div class='at'>Click the \"Site Search\" tab to get the latest news off the wires, as well as Boston Globe stories, and photo galleries.</div>";
displayTips[0][7]="<div class='searchTip'><h3>Looking for a person's phone number?</h3></div>"+
"<div class='at'>Click the \"<a href=\"http://wp.boston.com\">White Pages</a>\" tab to search residential phone numbers.</div>";
displayTips[0][8]="<div class='searchTip'><h3>Want the weather?</h3></div>"+
"<div class='at'>Just do a search for \"weather\" to get the five-day outlook and the latest video forecast.</div>";

displayTips[1][0]="<div class='searchTip'><h3>Looking for a second opinion?</h3></div>"+
"<div class='at'>Click on the \"Local Search\" tab above the search box to find info from 5,000 sites across Massachusetts.</div>";
displayTips[1][1]="<div class='searchTip'><h3>Looking for a specific article?</h3></div>"+
"<div class='at'>If you know the date or reporter's name, you can use \"More Search Options\" to zero in on the article you want.</div>";
displayTips[1][2]="<div class='searchTip'><h3>Looking for the archives?</h3></div>"+
"<div class='at'>This search includes Globe stories published since 1979. Stories published between 1872 and 1923 are available in the <a href=\"Historic.do?s.tab=historic\">Historic Archive</a>, but papers published between 1924 and 1979 are not available online.</div>";
displayTips[1][3]="<div class='searchTip'><h3>Looking for the latest news?</h3></div>"+
"<div class='at'>Click the \"Site Search\" tab to get the latest news off the wires, in addition to Boston Globe stories.</div>";

displayTips[2][0]="<div class='searchTip'><h3>How do I list my business?</h3></div>"+
"<div class='at'>Go to <a href=\"http://www.google.com/local/add/choice\">Google's add my business</a> form. Click on the \"Local Search\" tab above the search box to find info from more than 4,500 sites across Massachusetts.</div>";
displayTips[2][1]="<div class='searchTip'><h3>Too few results?</h3></div>"+
"<div class='at'>Try using fewer keywords.  The search engine finds listings that include ALL of the keywords you typed in.</div>";
displayTips[2][2]="<div class='searchTip'><h3>Looking for a phone number?</h3></div>"+
"<div class='at'>Click the \"<a href=\"http://wp.boston.com\">White Pages</a>\" tab to search residential phone numbers.</div>";
displayTips[2][3]="<div class='searchTip'><h3>Sports fan?</h3></div>"+
"<div class='at'>Type the name of a Boston player into the search box and click \"Local Search\" to get his latest stats.</div>";

displayTips[3][0]="<div class='searchTip'><h3>Looking for a second opinion?</h3></div>"+
"<div class='at'>Click on the \"Local Search\" tab above the search box to search other news sites, and more than 4,500 other local sites.</div>";
displayTips[3][1]="<div class='searchTip'><h3>Looking for a Boston Globe article?</h3></div>"+
"<div class='at'>Click the checkbox for \"Boston Globe articles only\", right next to the search box, to search the archives of the Globe since 1979.</div>";
displayTips[3][2]="<div class='searchTip'><h3>Trying to do the right thing?</h3></div>"+
"<div class='at'>Miss Conduct advises: \"A little forethought can prevent regret later.\" More tips are in <a href=\"http://www.boston.com/news/globe/magazine/missconduct/?p1=search_tip\">her blog</a>.</div>";
displayTips[3][3]="<div class='searchTip'><h3>Too few listings?</h3></div>"+
"<div class='at'>Try using fewer keywords.  The search engine finds listings that include all of the keywords you typed in.</div>";
displayTips[3][4]="<div class='searchTip'><h3>Looking for a person's phone number?</h3></div>"+
"<div class='at'>Click the \"<a href=\"http://wp.boston.com\">White Pages</a>\" tab to search residential phone numbers.</div>";

displayTips[4][0]="<div class='searchTip'><h3>What am I searching?</h3></div>"+
"<div class='at'>This travel search includes news articles, photo galleries, listing"+
" information from Frommer's, and several hundred local tourism websites.</div>";
displayTips[4][1]="<div class='searchTip'><h3>State names are optional</h3></div>"+
"<div class='at'>You don't need to type in the state name (unless there's a chance of confusion between Concord, NH and Concord, MA).</div>";


var set;
var counter;
var display = 0;

function wrap(a,b){
  if(b < 0){
  return displayTips[a].length-1;
 }
 if (b > displayTips[a].length-1){
 return 0;}
 return b;
}
       var c = '';

function left(){      

c ='tip'+counter;
document.getElementById(c).style.display='none';
counter = wrap(set,counter - 1);
c = 'tip'+counter;
document.getElementById(c).style.display='';
}
function right(){

c ='tip'+counter;
document.getElementById(c).style.display='none';
counter = wrap(set,counter + 1);

c = 'tip'+counter;
document.getElementById(c).style.display='';
}
counter=0;
set=0;

function writeSection(){
if (oldTabID != 'ypages') {document.writeln('<div style=\"margin-top:30px;margin-bottom:20px;margin-left:6px;\"><h2>Need <a href=\"Search.do?s.tab=yp&s.ypsearch=Ice+cream&s.yplocation=Boston&s.isBrowse=y\" onclick=\"s_linkType=\'o\';s_linkName=\'search_query\';s_eVar2=\'YP-Footer-Ice Cream-Boston\';s_eVar5=\'results_yp_footer\';s_lnk=s_co(this);s_gs(\'nytbglobe\');\">ice cream</a> or a <a href=\"Search.do?s.tab=yp&s.ypsearch=Contractor&s.yplocation=Boston&s.isBrowse=y\" onclick=\"s_linkType=\'o\';s_linkName=\'search_query\';s_eVar2=\'YP-Footer-Contractor-Boston\';s_eVar5=\'results_yp_footer\';s_lnk=s_co(this);s_gs(\'nytbglobe\');\">contractor</a>? Try the <a href=\"http://www.boston.com/search/local_search/business\">new Business Search</a></h2><div style=\"margin-top:10px;\">Boston.com\'s business search now brings you Google\'s search results for stores, services, and businesses of all kinds - all in your community.</div></div><div style=\"margin-top:20px;margin-bottom:20px;margin-left:6px;\"><a href=\"http://www.boston.com/help/feedback/\">Tell us what you think</a> of Local Search on Boston.com. Or <a href=\"http://www.boston.com/help/searchfaqv1/\">learn more</a> about Local Search in our <a href=\"http://www.boston.com/help/searchfaqv1/\">FAQ</a>.</div>');}
else
{document.writeln('<div style=\"margin-top:30px;margin-bottom:20px;margin-left:6px;\">Something missing? <a href=\"http://www.google.com/local/add?hl=en&gl=us\" class=\"bold\">Add or edit YOUR business</a> or <a href=\"http://www.google.com/intl/en_us/help/maps/tour/\#add_place\" class=\"bold\">Add ANY business</a></div><div style=\"margin-top:20px;margin-bottom:20px;margin-left:6px;\"><a href=\"http://www.boston.com/help/feedback/\">Tell us what you think</a> of Local Business Search on Boston.com. Or <a href=\"http://www.boston.com/help/searchfaqv1/\">learn more</a> about Local Search in our <a href=\"http://www.boston.com/help/searchfaqv1/\">FAQ</a>.</div>');}
}



var cities = [
"Abington",
"Acton",
"Acushnet",
"Amesbury",
"Andover",
"Arlington",
"Ashburnham",
"Ashby",
"Ashland",
"Athol",
"Attleboro",
"Auburn",
"Avon",
"Ayer",
"Back Bay",
"Barnstable",
"Barre",
"Bedford",
"Bellingham",
"Belmont",
"Berkley",
"Berlin",
"Beverly",
"Billerica",
"Blackstone",
"Bolton",
"Boston",
"Bourne",
"Boxborough",
"Boxford",
"Boylston",
"Braintree",
"Brewster",
"Bridgewater",
"Brockton",
"Brookfield",
"Brookline",
"Brookline Village",
"Burlington",
"Cambridge",
"Canton",
"Cape Cod",
"Carlisle",
"Carver",
"Charlestown",
"Charlton",
"Chatham",
"Chelmsford",
"Chelsea",
"Chestnut Hill",
"Chinatown",
"Clinton",
"Cohasset",
"Concord",
"Danvers",
"Davis Square",
"Dartmouth",
"Dedham",
"Dennis",
"Dighton",
"Dorchester",
"Douglas",
"Downtown",
"Dover",
"Dracut",
"Dudley",
"Dunstable",
"Duxbury",
"East Boston",
"East Bridgewater",
"East Brookfield",
"Eastham",
"Easton",
"Essex",
"Everett",
"Fairhaven",
"Fall River",
"Falmouth",
"Fitchburg",
"Foxborough",
"Framingham",
"Franklin",
"Freetown",
"Gardner",
"Georgetown",
"Gloucester",
"Grafton",
"Groton",
"Groveland",
"Halifax",
"Hamilton",
"Hanover",
"Hanson",
"Hardwick",
"Harvard",
"Harvard Square",
"Harwich",
"Haverhill",
"Hingham",
"Holbrook",
"Holden",
"Holliston",
"Hopedale",
"Hopkinton",
"Hubbardston",
"Hudson",
"Hyde Park",
"Hull",
"Ipswich",
"Jamaica Plain",
"Kenmore Square",
"Kingston",
"Lakeville",
"Lancaster",
"Lawrence",
"Leicester",
"Leominster",
"Lexington",
"Lincoln",
"Littleton",
"Lowell",
"Lunenburg",
"Lynn",
"Lynnfield",
"Malden",
"Manchester",
"Mansfield",
"Marblehead",
"Marion",
"Marlborough",
"Marshfield",
"Marthas Vineyard",
"Mashpee",
"Mattapan",
"Mattapoisett",
"Maynard",
"Medfield",
"Medford",
"Medway",
"Melrose",
"Mendon",
"Merrimac",
"Metrowest",
"Methuen",
"Middleborough",
"Middleton",
"Milford",
"Millbury",
"Millis",
"Millville",
"Milton",
"Nahant",
"Nantucket",
"Natick",
"Needham",
"New Bedford",
"New Braintree",
"Newbury",
"Newburyport",
"Newton",
"Norfolk",
"North Andover",
"North Attleborough",
"North Brookfield",
"North End",
"North Reading",
"North Shore",
"Northborough",
"Northbridge",
"Norton",
"Norwell",
"Norwood",
"Oakham",
"Orleans",
"Oxford",
"Paxton",
"Peabody",
"Pembroke",
"Pepperell",
"Petersham",
"Phillipston",
"Plainville",
"Plymouth",
"Plympton",
"Princeton",
"Provincetown",
"Quincy",
"Randolph",
"Raynham",
"Reading",
"Rehoboth",
"Revere",
"Rochester",
"Rockland",
"Rockport",
"Roslindale",
"Rowley",
"Roxbury",
"Royalston",
"Rutland",
"Salem",
"Salisbury",
"Sandwich",
"Saugus",
"Scituate",
"Seekonk",
"Sharon",
"Sherborn",
"Shirley",
"Shrewsbury",
"Somerset",
"Somerville",
"South Boston",
"South End",
"South Shore",
"Southborough",
"Southbridge",
"Spencer",
"Sterling",
"Stoneham",
"Stoughton",
"Stow",
"Sturbridge",
"Sudbury",
"Sutton",
"Swampscott",
"Swansea",
"Taunton",
"Templeton",
"Tewksbury",
"Theater District",
"Topsfield",
"Townsend",
"Truro",
"Tyngsborough",
"Upton",
"Uxbridge",
"Wakefield",
"Walpole",
"Waltham",
"Wareham",
"Warren",
"Watertown",
"Wayland",
"Webster",
"Wellesley",
"Wellfleet",
"Wenham",
"West Boylston",
"West Bridgewater",
"West Brookfield",
"West Newbury",
"West Roxbury",
"Westborough",
"Westford",
"Westminster",
"Weston",
"Westport",
"Westwood",
"Weymouth",
"Whitman",
"Wilmington",
"Winchendon",
"Winchester",
"Winthrop",
"Woburn",
"Worcester",
"Wrentham",
"Yarmouth",
"Concord, NH",
"Hampton, NH",
"Manchester, NH",
"Merrimack, NH",
"Nashua, NH",
"Pelham, NH",
"Seabrook, NH"

];