// JavaScript Document

var how_many_spotlights;
var now = new Date();
var sec = now.getSeconds();
var spotlights;

function homepage_ad_rotator() {
  how_many_spotlights = 2;
  spotlights = sec % how_many_spotlights;
  spotlights +=1;

  if (spotlights==1)
  {
    document.write('<a href="http://www.sffoodbank.org/programs/get_food.html" target="_blank"><img src="/images/foodbank_web.jpg" hspace="0" vspace="0" border="0" align="top" /></a>');
  }
  else if (spotlights==2)
  {
    document.write('<a href="http://www.sffoodbank.org/programs/get_food.html" target="_blank"><img src="/images/foodbank_web.jpg" hspace="0" vspace="0" border="0" align="top" /></a>');
  }
}

function homepage_photo_rotator() {
  how_many_spotlights = 26;
  spotlights = sec % how_many_spotlights;
  spotlights +=1;

  if (spotlights==1)
  {
    document.write('<img src="/spotlight/homepage/image01.jpg" hspace="0" vspace="0" border="0" align="top" />');
  }
  else if (spotlights==2)
  {
    document.write('<img src="/spotlight/homepage/image01.jpg" hspace="0" vspace="0" border="0" align="top" />');
  }
  else if (spotlights==3)
  {
    document.write('<img src="/spotlight/homepage/image01.jpg" hspace="0" vspace="0" border="0" align="top" />');
  }
  else if (spotlights==4)
  {
    document.write('<img src="/spotlight/homepage/image01.jpg" hspace="0" vspace="0" border="0" align="top" />');
  }
  else if (spotlights==5)
  {
    document.write('<img src="/spotlight/homepage/image02.jpg" hspace="0" vspace="0" border="0" align="top" />');
  }
  else if (spotlights==6)
  {
    document.write('<img src="/spotlight/homepage/image03.jpg" hspace="0" vspace="0" border="0" align="top" />');
  }
  else if (spotlights==7)
  {
    document.write('<img src="/spotlight/homepage/image04.jpg" hspace="0" vspace="0" border="0" align="top" />');
  }
  else if (spotlights==8)
  {
    document.write('<img src="/spotlight/homepage/image05.jpg" hspace="0" vspace="0" border="0" align="top" />');
  }
  else if (spotlights==9)
  {
    document.write('<img src="/spotlight/homepage/image06.jpg" hspace="0" vspace="0" border="0" align="top" />');
  }
  else if (spotlights==10)
  {
    document.write('<img src="/spotlight/homepage/image07.jpg" hspace="0" vspace="0" border="0" align="top" />');
  }
  else if (spotlights==11)
  {
    document.write('<img src="/spotlight/homepage/image08.jpg" hspace="0" vspace="0" border="0" align="top" />');
  }
  else if (spotlights==12)
  {
    document.write('<img src="/spotlight/homepage/image09.jpg" hspace="0" vspace="0" border="0" align="top" />');
  }
  else if (spotlights==13)
  {
    document.write('<img src="/spotlight/homepage/image10.jpg" hspace="0" vspace="0" border="0" align="top" />');
  }
  else
  {
    clients_photo_rotator();
  }
}

function homepage_story_rotator() {
  how_many_spotlights = 26;
  spotlights = sec % how_many_spotlights;
  spotlights +=1;

  if (spotlights==1)
  {
    document.write('<br /><br />150,000 San Franciscans face the day not knowing where their next meal will come from: That\'s 1 in 5 adults. 1 in 4 children. And 1 in 4 seniors.');
  }
  else if (spotlights==2)
  {
    document.write('<br /><br />This year, the San Francisco Food Bank will distribute enough food for 88,000 nutritious meals every day.');
  }
  else if (spotlights==3)
  {
    document.write('<br /><br />An individual earning $14,079 a year is only eligible for $14 in Food Stamps monthly.');
  }
  else if (spotlights==4)
  {
    document.write('<br /><br />As the recession deepens, more and more people are in need for the first time.');
  }
  else if (spotlights==5)
  {
    document.write('<br /><br />Every week, the San Francisco Food Bank sources, sorts and distributes between 6 and 10 tractor trailer loads full of fruits and vegetables.');
  }
  else if (spotlights==6)
  {
    document.write('<br /><br />Over 50% of the food distributed by the San Francisco Food Bank is fresh produce.');
  }
  else if (spotlights==7)
  {
    document.write('<br /><br />For many of the low-income families served by the San Francisco Food Bank, the Food Bank pantry is the only source of fresh produce readily accessible in their neighborhood.');
  }
  else if (spotlights==8)
  {
    document.write('<br /><br />Every year, the amount of fresh fruits and vegetables we distribute grows. We now distribute over 1 million pounds of produce every month.');
  }
  else if (spotlights==9)
  {
    document.write('<br /><br />Through the California Farm to Family program, the San Francisco Food Bank receives tons of fresh Central Valley produce every week.');
  }
  else if (spotlights==10)
  {
    document.write('<br /><br />At any given time, we have over 2 million pounds of food in our warehouse in the process of being sorted and packed for distribution.');
  }
  else if (spotlights==11)
  {
    document.write('<br /><br />The Women&#146s Building in the Mission hosts one of over 400 community food programs the Food Bank partners with. They offer a comprehensive array of social services to empower women and immigrants through education, the arts, legal services - and of course, food. ');
  }
  else if (spotlights==12)
  {
    document.write('<br /><br />Eric, Doris and Fred of Page Street Baptist Church have hosted a Food Bank pantry for 12 years. <br>Their deep commitment shines through in the warm and bustling atmosphere of their weekly grocery distributions, where the true diversity of the city comes together over food. <br> &#147People in the community call me grandma,&#148 Doris says. &#147A lot of people come here, and I always tell them&#58; there&#146;s enough for everyone &#151; we all love each other &#151; we&#146;re a family.&#148 ');
  }
  else if (spotlights==13)
  {
    document.write('<br /><br />Sharon serves over 150 seniors every week at a Food Bank pantry in Ingleside. She knows pretty much everyone by name, and they know her, too. &#147I learn something new here, with these seniors, every day that I honestly didn&#146t know before,&#148 she says. ');
  }
  else
  {
    clients_story_rotator();
  }
}

function donate_photo_rotator() {
  how_many_spotlights = 11;
  spotlights = sec % how_many_spotlights;
  spotlights +=1;

  if (spotlights==1)
  {
    document.write('<img src="/spotlight/donate/image01.jpg" hspace="0" vspace="0" border="0" align="top" />');
  }
  else
  {
    clients_photo_rotator();
  }
}

function donate_story_rotator() {
  how_many_spotlights = 11;
  spotlights = sec % how_many_spotlights;
  spotlights +=1;

  if (spotlights==1)
  {
    document.write('<br /><br />"My donation is going to children, working families and people who have worked their entire life but can\'t afford food - people who shouldn\'t be hungry." <br /><br />-Deidre, a Meal-a-Month donor');
  }
  else
  {
    clients_story_rotator();
  }
}

function volunteer_photo_rotator() {
  how_many_spotlights = 9;
  spotlights = sec % how_many_spotlights;
  spotlights +=1;

  if (spotlights==1)
  {
    document.write('<img src="/spotlight/volunteer/image01.jpg" hspace="0" vspace="0" border="0" align="top" />');
  }
  else if (spotlights==2)
  {
    document.write('<img src="/spotlight/volunteer/image02.jpg" hspace="0" vspace="0" border="0" align="top" />');
  }
  else if (spotlights==3)
  {
    document.write('<img src="/spotlight/volunteer/image03.jpg" hspace="0" vspace="0" border="0" align="top" />');
  }
  else if (spotlights==4)
  {
    document.write('<img src="/spotlight/volunteer/image04.jpg" hspace="0" vspace="0" border="0" align="top" />');
  }
  else if (spotlights==5)
  {
    document.write('<img src="/spotlight/volunteer/image05.jpg" hspace="0" vspace="0" border="0" align="top" />');
  }
  else if (spotlights==6)
  {
    document.write('<img src="/spotlight/volunteer/image06.jpg" hspace="0" vspace="0" border="0" align="top" />');
  }
  else if (spotlights==7)
  {
    document.write('<img src="/spotlight/volunteer/image07.jpg" hspace="0" vspace="0" border="0" align="top" />');
  }
  else
  {
    clients_photo_rotator();
  }
}

function volunteer_story_rotator() {
  how_many_spotlights = 9;
  spotlights = sec % how_many_spotlights;
  spotlights +=1;

  if (spotlights==1)
  {
    document.write('<br /><br />"I know it can be tough to make ends meet. Volunteering at the Food Bank gives me the ability to ensure that everyone can have nutritious food." <br /><br />-John, a regular Food Bank volunteer');
  }
  else if (spotlights==2)
  {
    document.write('<br /><br />"My favorite thing to do is the emergency food boxes. You only have to do one little thing, but at the end of the day, you\'ve gotten so much done! You see a roomful of food that\'s going to feed people who need it." <br /><br />-Cathy, a corporate volunteer');
  }
  else if (spotlights==3)
  {
    document.write('<br /><br />"When I come here, I just think about my grandma. It\'s sad to think that anyone\'s grandma wouldn\'t have enough to eat." <br /><br />-Francine, a weekly volunteer');
  }
  else if (spotlights==4)
  {
    document.write('<br /><br />Much of the food coming into the Food Bank arrives in bulk but has to be distributed in family-size portions. Volunteers take 2,000 lb. sacks of rice and beans and break them down into 1 lb. bags suitable for pantry clients.');
  }
  else if (spotlights==5)
  {
    document.write('<br /><br />"After a day sitting behind my desk, it\'s energizing to roll up my sleeves and sort fruit, stock shelves and pack emergency food boxes. It feels good to do whatever it takes to get food to those in need." <br /><br />-John has been volunteering at the Food Bank for over 8 years');
  }
  else if (spotlights==6)
  {
    document.write('<br /><br />"What keeps me coming back is how organized, productive and efficient it is. You feel like you\'re actually making a difference." <br /><br />-Carolyn started volunteering in 2007 and comes in every week!');
  }
  else if (spotlights==7)
  {
    document.write('<br /><br />"Initially, I came to the Food Bank for school. But I stuck with it because it\'s so much fun! It just feels good to help other people." <br /><br />-Francine, a weekly volunteer');
  }
  else
  {
    clients_story_rotator();
  }
}

function advocate_photo_rotator() {
  how_many_spotlights = 7;
  spotlights = sec % how_many_spotlights;
  spotlights +=1;

  if (spotlights==1)
  {
    document.write('<img src="/spotlight/advocate/image01.jpg" hspace="0" vspace="0" border="0" align="top" />');
  }
  else if (spotlights==2)
  {
    document.write('<img src="/spotlight/advocate/image02.jpg" hspace="0" vspace="0" border="0" align="top" />');
  }
  else if (spotlights==3)
  {
    document.write('<img src="/spotlight/advocate/image03.jpg" hspace="0" vspace="0" border="0" align="top" />');
  }
  else if (spotlights==4)
  {
    document.write('<img src="/spotlight/advocate/image04.jpg" hspace="0" vspace="0" border="0" align="top" />');
  }
  else if (spotlights==5)
  {
    document.write('<img src="/spotlight/advocate/image05.jpg" hspace="0" vspace="0" border="0" align="top" />');
  }
  else
  {
    clients_photo_rotator();
  }
}

function advocate_story_rotator() {
  how_many_spotlights = 7;
  spotlights = sec % how_many_spotlights;
  spotlights +=1;

  if (spotlights==1)
  {
    document.write('<br /><br />"I\'m thankful that many of our clients are leading healthier, more mobile lives thanks to the food they receive." <br /><br />-Tom Nolan, Executive Director of Project Open Hand');
  }
  else if (spotlights==2)
  {
    document.write('<br /><br />"Providing direct service and food to people in need is important &mdash; but we need to do much more to end hunger. Raising awareness of the problem and demanding better social policy &mdash; that is true social justice!" <br /><br />-Terry Krauss, Co-Executive Director of Congregation Emanu-El and an anti-hunger advocate');
  }
  else if (spotlights==3)
  {
    document.write('<br /><br />"The end goal is to eradicate hunger, and the only way to do that is to speak up and address the root causes of hunger." <br /><br />-Terry Krauss, Co-Executive Director of Congregation Emanu-El and an anti-hunger advocate');
  }
  else if (spotlights==4)
  {
    document.write('<br /><br />Roger is retired but still active, volunteering at his local congregation and senior center. He comes to pick up food boxes for the two elderly women who live next door to him: "They\'re my neighbors!," he says. "You got to help out your neighbors."');
  }
  else if (spotlights==5)
  {
    document.write('<br /><br />"Legislators in California and beyond need to be aware of the problems of hunger, poor nutrition and its consequences: health issues, learning challenges and overall lower quality of life." <br /><br />-Terry Krauss, Co-Executive Director of Congregation Emanu-El and an anti-hunger advocate');
  }
  else
  {
    clients_story_rotator();
  }
}

function clients_photo_rotator() {
  how_many_spotlights = 10;
  spotlights = sec % how_many_spotlights;
  spotlights +=1;

  if (spotlights==1)
  {
    document.write('<img src="/spotlight/clients/image01.jpg" hspace="0" vspace="0" border="0" align="top" />');
  }
  else if (spotlights==2)
  {
    document.write('<img src="/spotlight/clients/image02.jpg" hspace="0" vspace="0" border="0" align="top" />');
  }
  else if (spotlights==3)
  {
    document.write('<img src="/spotlight/clients/image03.jpg" hspace="0" vspace="0" border="0" align="top" />');
  }
  else if (spotlights==4)
  {
    document.write('<img src="/spotlight/clients/image04.jpg" hspace="0" vspace="0" border="0" align="top" />');
  }
  else if (spotlights==5)
  {
    document.write('<img src="/spotlight/clients/image05.jpg" hspace="0" vspace="0" border="0" align="top" />');
  }
  else if (spotlights==6)
  {
    document.write('<img src="/spotlight/clients/image06.jpg" hspace="0" vspace="0" border="0" align="top" />');
  }
  else if (spotlights==7)
  {
    document.write('<img src="/spotlight/clients/image07.jpg" hspace="0" vspace="0" border="0" align="top" />');
  }
  else if (spotlights==8)
  {
    document.write('<img src="/spotlight/clients/image08.jpg" hspace="0" vspace="0" border="0" align="top" />');
  }
  else if (spotlights==9)
  {
    document.write('<img src="/spotlight/clients/image09.jpg" hspace="0" vspace="0" border="0" align="top" />');
  }
  else if (spotlights==10)
  {
    document.write('<img src="/spotlight/clients/image10.jpg" hspace="0" vspace="0" border="0" align="top" />');
  }
}

function clients_story_rotator() {
  how_many_spotlights = 10;
  spotlights = sec % how_many_spotlights;
  spotlights +=1;

  if (spotlights==1)
  {
    document.write('<br /><br />"I have to pay all the money I have for my house and the nurse care. This food is very important for seniors!" <br /><br />Inna lives in supportive housing for senior citizens and visits a pantry in the Mission every week for groceries.');
  }
  else if (spotlights==2)
  {
    document.write('<br /><br />"My children love green apples! The food here is good, it\'s healthy and it tastes delicious." <br /><br />-Eloise, a pantry volunteer and client');
  }
  else if (spotlights==3)
  {
    document.write('<br /><br />"Kids get excited about kiwi and broccoli. It really helps them get away from junk food." <br /><br />-A Food Bank pantry volunteer');
  }
  else if (spotlights==4)
  {
    document.write('<br /><br />Boris and Svetlana are in their seventies. Supplemental Security Income, their only source of income, is not enough to pay rent on their Richmond apartment, utilities and buy food.');
  }
  else if (spotlights==5)
  {
    document.write('<br /><br />Charles lives with his 90-year old mother, nephew and his four children. He is retired from his job as a veterinary technician. "All my retirement money went to rent, utilities and food and didn\'t last long," he says. "Cooking for the family is hard. You\'re always taking from Peter to pay Paul."');
  }
  else if (spotlights==6)
  {
    document.write('<br /><br />Wei was an accountant for 19 years. She put all her savings towards sending her children through school. "I worked 12 hour days and was never on welfare. But now that I\'m retired, I need the extra help," she says.');
  }
  else if (spotlights==7)
  {
    document.write('<br /><br />"The people who come to get food at the pantry had been, to regular middle-class churchgoers, basically invisible. We knew they were there, but we couldn\'t see them. As I got to know them, I started to see more clearly how the people who came to the pantry were like me." <br /><br />-Sara has helped to launch 10 pantries throughout San Francisco');
  }
  else if (spotlights==8)
  {
    document.write('<br /><br />When Sandra\'s father was arrested on domestic violence charges, her grandmother stepped in to take care of her and her two siblings. "From the 1st of the month to the 8th, I got to buy food. From the 8th to the 16th, it\'s Food Stamps. From the 16th to the end, I have to pay money for food, so I come up here to stretch through the month," she explains.');
  }
  else if (spotlights==9)
  {
    document.write('<br /><br />Cecilia volunteers at a neighborhood pantry in Ingleside. She receives bread, fruit, vegetables and dairy products to help feed her four children - and she helps others in the community in need of food.');
  }
  else if (spotlights==10)
  {
    document.write('<br /><br />Linda is a volunteer and client at a Food Bank pantry with two children of her own and two foster children. "My kids just love all the stuff I get from here. Juices, fresh fruit, all the bread &#8212; it just helps tremendously."');
  }
}

function go_to(url) {
  window.location=url;
}

function rand_link() {
var a;
a = 1+Math.round(Math.random()); // a = random number between 1-2
if (a==1) {
go_to("https://org2.democracyinaction.org/o/5420/shop/custom.jsp?donate_page_KEY=447&track=header_button");
}

if (a==2) {
go_to("https://org2.democracyinaction.org/o/5420/shop/custom.jsp?donate_page_KEY=1026&track=header_button");
}
}