// JavaScript Document
// Event Calendar
// copyright Stephen Chapman, 10th June 2006, 30th October 2006
//http://javascript.about.com/library/blevent2.htm

var tb = 'b'; // top or bottom (t or b)
var headbg = '#c4e1bf';  // table heading background colour
var todaybg = '#c4e1bf'; // current selected date background colour
var textclr = '#0f458b'; // text colour
var linkclr = '#be0374'; // link text colour
var noMessage =  'No event messages to display for today'; // message to display when no entry in array

var dA = new Array(); var x = 0;
// first 8 characters in ccyymmdd format for single date events
// first 8 characters in 0000mmdd format for every year events
dA[x++] = "00000101 New Year";
dA[x++] = "00000214 Valentine's day-Remember, absolutely no chocolate for the dog. Chocolate is very poisonous to them!";
dA[x++] = "20090103 Pet Adoptions first Sat. of each month. <a href='http://www.petco.com/content/locator/Details.aspx?storeId=588&Nav=2' target='_blank'>Burbank Petco</a>, Hollywood Way and Victory";
dA[x++] = "20090207 Pet Adoptions first Sat. of each month. <a href='http://www.petco.com/content/locator/Details.aspx?storeId=588&Nav=2' target='_blank'>Burbank Petco</a>, Hollywood Way and Victory";
dA[x++] = "20090307 Pet Adoptions first Sat. of each month. <a href='http://www.petco.com/content/locator/Details.aspx?storeId=588&Nav=2' target='_blank'>Burbank Petco</a>, Hollywood Way and Victory";
dA[x++] = "20090404 Pet Adoptions first Sat. of each month. <a href='http://www.petco.com/content/locator/Details.aspx?storeId=588&Nav=2' target='_blank'>Burbank Petco</a>, Hollywood Way and Victory";
dA[x++] = "20090417 <a href='http://www.petexpooc.com/' target='_blank'>America's Family Pet Expo</a> Come meet the Ken-Mar Rescue orphans in person at the Ken-Mar Rescue booth. Friday, 10-6, Sat, 10-7 and Sun, 10-6";
dA[x++] = "20090418 <a href='http://www.petexpooc.com/' target='_blank'>America's Family Pet Expo</a> Come meet the Ken-Mar Rescue orphans in person at the Ken-Mar Rescue booth. Friday, 10-6, Sat, 10-7 and Sun, 10-6";
dA[x++] = "20090419 <a href='http://www.petexpooc.com/' target='_blank'>America's Family Pet Expo</a> Come meet the Ken-Mar Rescue orphans in person at the Ken-Mar Rescue booth. Friday, 10-6, Sat, 10-7 and Sun, 10-6";
dA[x++] = "20090502 Pet Adoptions first Sat. of each month. <a href='http://www.petco.com/content/locator/Details.aspx?storeId=519&Nav=2' target='_blank'>Encino Petco</a>, 17919 Ventura Boulevard Encino, CA 91316";
dA[x++] = "20090606 Pet Adoptions first Sat. of each month. <a href='http://www.petco.com/content/locator/Details.aspx?storeId=519&Nav=2' target='_blank'>Encino Petco</a>, 17919 Ventura Boulevard Encino, CA 91316";
dA[x++] = "20090704 Pet Adoptions first Sat. of each month. <a href='http://www.petco.com/content/locator/Details.aspx?storeId=519&Nav=2' target='_blank'>Encino Petco</a>, 17919 Ventura Boulevard Encino, CA 91316";
dA[x++] = "20090718 Pet Adoptions third Sat. of each month. <a href='http://www.petdepot.net/katieslaverne.html' target='_blank'>Katie's Pet Depot</a>, 2300 Foothill Blvd. #D1 La Verne 909-392-9552";
dA[x++] = "20090801 Pet Adoptions first Sat. of each month. <a href='http://www.petco.com/content/locator/Details.aspx?storeId=519&Nav=2' target='_blank'>Encino Petco</a>, 17919 Ventura Boulevard Encino, CA 91316";
dA[x++] = "20090815 Pet Adoptions third Sat. of each month. <a href='http://www.petdepot.net/katieslaverne.html' target='_blank'>Katie's Pet Depot</a>, 2300 Foothill Blvd. #D1 La Verne 909-392-9552";
dA[x++] = "20090905 Pet Adoptions first Sat. of each month. <a href='http://www.petco.com/content/locator/Details.aspx?storeId=519&Nav=2' target='_blank'>Encino Petco</a>, 17919 Ventura Boulevard Encino, CA 91316";
dA[x++] = "20091017 Pet Adoptions third Sat. of each month. <a href='http://www.petdepot.net/katieslaverne.html' target='_blank'>Katie's Pet Depot</a>, 2300 Foothill Blvd. #D1 La Verne 909-392-9552";
dA[x++] = "20091024 Pet Adoptions fourth Sat. of each month. <a href='http://www.petdepot.net/brees.html' target='_blank'>Bree's Pet Depot</a>, 25832 McBean Parkway Santa Clarita 661-288-0213";
dA[x++] = "20091114 West Coast Pet Expos-See Us There Nov 14-15 <a href='http://www.westcoastpetexpos.com' target='_blank'>West Coast Pet Expos</a>, Fairplex Pomona 1101 W. McKinley Ave. 91768";
dA[x++] = "20091115 West Coast Pet Expos-See Us There Nov 14-15 <a href='http://www.westcoastpetexpos.com' target='_blank'>West Coast Pet Expos</a>, Fairplex Pomona 1101 W. McKinley Ave. 91768";
dA[x++] = "20091121 Pet Adoptions third Sat. of each month. <a href='http://www.petdepot.net/katieslaverne.html' target='_blank'>Katie's Pet Depot</a>, 2300 Foothill Blvd. #D1 La Verne 909-392-9552";
dA[x++] = "20091128 Pet Adoptions fourth Sat. of each month. <a href='http://www.petdepot.net/brees.html' target='_blank'>Bree's Pet Depot</a>, 25832 McBean Parkway Santa Clarita 661-288-0213";
dA[x++] = "20091206 Home for the Holidays Adoption Event <a href='http://www.cityofirvine.org/cityhall/cs/animalcare/news_events_n_success_stories/upcoming_events.asp' target='_blank'>Irvine Animal Care Center</a>, 6443 Oak Canyon Irvine, CA 92618 949-724-7740";
dA[x++] = "20091219 Pet Adoptions third Sat. of each month. <a href='http://www.petdepot.net/katieslaverne.html' target='_blank'>Katie's Pet Depot</a>, 2300 Foothill Blvd. #D1 La Verne 909-392-9552"; 
dA[x++] = "20100116 Pet Adoptions third Sat. of each month. <a href='http://www.petdepot.net/katieslaverne.html' target='_blank'>Katie's Pet Depot</a>, 2300 Foothill Blvd. #D1 La Verne 909-392-9552";
dA[x++] = "20100220 Pet Adoptions third Sat. of each month. <a href='http://www.petdepot.net/katieslaverne.html' target='_blank'>Katie's Pet Depot</a>, 2300 Foothill Blvd. #D1 La Verne 909-392-9552";
dA[x++] = "20100320 Pet Adoptions third Sat. of each month. <a href='http://www.petdepot.net/katieslaverne.html' target='_blank'>Katie's Pet Depot</a>, 2300 Foothill Blvd. #D1 La Verne 909-392-9552";
dA[x++] = "20100416 <a href='http://www.petexpooc.com/' target='_blank'>America's Family Pet Expo</a> Come meet the Ken-Mar Rescue orphans in person at the Ken-Mar Rescue booth. Friday, 10-16, Sat, 10-17 and Sun, 10-18";
dA[x++] = "20100417 <a href='http://www.petexpooc.com/' target='_blank'>America's Family Pet Expo</a> Come meet the Ken-Mar Rescue orphans in person at the Ken-Mar Rescue booth. Friday, 10-16, Sat, 10-17 and Sun, 10-18";
dA[x++] = "20100418 <a href='http://www.petexpooc.com/' target='_blank'>America's Family Pet Expo</a> Come meet the Ken-Mar Rescue orphans in person at the Ken-Mar Rescue booth. Friday, 10-16, Sat, 10-17 and Sun, 10-18";
dA[x++] = "20100515 Pet Adoptions third Sat. of each month. <a href='http://www.petdepot.net/katieslaverne.html' target='_blank'>Katie's Pet Depot</a>, 2300 Foothill Blvd. #D1 La Verne 909-392-9552";
dA[x++] = "20100606 Irvine Super Adoption <a href='http://www.cityofirvine.org/cityhall/cs/animalcare/news_events_n_success_stories/super_pet_adoption.asp' target='_blank'>Visit our Orphans at Super Adoption Event!</a>, Irvine Animal Care Center, 6443 Oak Canyon Rd., Irvine 949-724-7740";
dA[x++] = "20100619 Pet Adoptions third Sat. of each month. <a href='http://www.petco.com/content/locator/SearchResult.aspx?city=encino&state=CA&zip=&origin=home&veterinary=0&fullGrooming=0&selfGrooming=0&education=0&photography=0&aquatics=0&dnabreedtesting=0&Nav=2' target='_blank'>Encino Petco</a>, 17919 Ventura Boulevard Encino 818-343-1124";
dA[x++] = "20100717 Pet Adoptions third Sat. of each month. <a href='http://www.petco.com/content/locator/SearchResult.aspx?city=encino&state=CA&zip=&origin=home&veterinary=0&fullGrooming=0&selfGrooming=0&education=0&photography=0&aquatics=0&dnabreedtesting=0&Nav=2' target='_blank'>Encino Petco</a>, 17919 Ventura Boulevard Encino 818-343-1124";
dA[x++] = "20100724 Tennis Tournament to Benefit Ken-Mar Rescue! <a href='http://www.kenmarrescue.org/news.html#tournament' target='_blank'>Click to Learn More</a> 4141 Whitsett Ave, Studio City 5pm-8pm";

dA[x++] = "20100814 Pet Adoptions second Sat. of each month, 11-4. <a href='http://www.krisers.com/locations.html' target='_blank'>Kriser's</a>, 12507 Ventura Blvd. Ventura Boulevard Studio City 818-760-9550";

dA[x++] = "20100821 Pet Adoptions third Sat. of each month, 12-3. <a href='http://www.petco.com/content/locator/SearchResult.aspx?city=encino&state=CA&zip=&origin=home&veterinary=0&fullGrooming=0&selfGrooming=0&education=0&photography=0&aquatics=0&dnabreedtesting=0&Nav=2' target='_blank'>Encino Petco</a>, 17919 Ventura Boulevard Encino 818-343-1124";

dA[x++] = "20100822 Adoption Event, 11-4. <a href='http://www.evidenceoflove.org/Le_Pet_Affair' target='_blank'>Le' Pet Affair</a>, Van Nuys-Sherman Oaks Rec Center, 14201 Huston St. Sherman Oaks 91423 (corner Hazeltine  and Huston) Food for Humans too!";

dA[x++] = "20100911 Pet Adoptions second Sat. of each month, 11-4. <a href='http://www.krisers.com/locations.html' target='_blank'>Kriser's</a>, 12507 Ventura Blvd. Ventura Boulevard Studio City 818-760-9550";

dA[x++] = "20100918 Pet Adoptions third Sat. of each month, 12-3. <a href='http://www.petco.com/content/locator/SearchResult.aspx?city=encino&state=CA&zip=&origin=home&veterinary=0&fullGrooming=0&selfGrooming=0&education=0&photography=0&aquatics=0&dnabreedtesting=0&Nav=2' target='_blank'>Encino Petco</a>, 17919 Ventura Boulevard Encino 818-343-1124";

dA[x++] = "20101009 Pet Adoptions second Sat. of each month, 11-4. <a href='http://www.krisers.com/locations.html' target='_blank'>Kriser's</a>, 12507 Ventura Blvd. Ventura Boulevard Studio City 818-760-9550";

dA[x++] = "20101016 Pet Adoptions third Sat. of each month, 12-3. <a href='http://www.petco.com/content/locator/SearchResult.aspx?city=encino&state=CA&zip=&origin=home&veterinary=0&fullGrooming=0&selfGrooming=0&education=0&photography=0&aquatics=0&dnabreedtesting=0&Nav=2' target='_blank'>Encino Petco</a>, 17919 Ventura Boulevard Encino 818-343-1124";

dA[x++] = "20101113 <a href='http://www.kenmarrescue.org/news.html' target='_blank'>Ken-Mar Rescue's Wine, Cheese and Chocolate Extravaganza</a> Saturday, Nov. 13, 2-6. Fundraiser, silent auction and raffle.";

dA[x++] = "20101120 Pet Adoptions third Sat. of each month, 12-3. <a href='http://www.petco.com/content/locator/SearchResult.aspx?city=encino&state=CA&zip=&origin=home&veterinary=0&fullGrooming=0&selfGrooming=0&education=0&photography=0&aquatics=0&dnabreedtesting=0&Nav=2' target='_blank'>Encino Petco</a>, 17919 Ventura Boulevard Encino 818-343-1124";

dA[x++] = "20101211 Pet Adoptions second Sat. of each month, 11-4. <a href='http://www.krisers.com/locations.html' target='_blank'>Kriser's</a>, 12507 Ventura Blvd. Ventura Boulevard Studio City 818-760-9550";

dA[x++] = "20101218 Pet Adoptions third Sat. of each month, 12-3. <a href='http://www.petco.com/content/locator/SearchResult.aspx?city=encino&state=CA&zip=&origin=home&veterinary=0&fullGrooming=0&selfGrooming=0&education=0&photography=0&aquatics=0&dnabreedtesting=0&Nav=2' target='_blank'>Encino Petco</a>, 17919 Ventura Boulevard Encino 818-343-1124";
dA[x++] = "00001225 Christmas Day-Fido just wants a home with lots of love";
// dA[x++] = "20060610 New Event Calendar Started today";

// permission is granted to use this javascript provided that the below code is not altered
var pageLoaded = 0; window.onload = function() {pageLoaded = 1;}
function loaded(i,f) {if (document.getElementById && document.getElementById(i) != null) f(); else if (!pageLoaded) setTimeout('loaded(\''+i+'\','+f+')',100);
}
function monthlength(month,year) {var dd = new Date(year, month, 0);return dd.getDate();}
var moy = ['January','February','March','April','May','June','July','August','September','October','November','December'];var today = new Date();var selDate = today.getFullYear()+getmmdd(today.getMonth()+1,today.getDate());
function dispCal(yy,mm) {if (mm < 0 || mm > 12) {alert('month must be between 1 and 12'); return false;} if (yy != 0 && (yy < 1901 || yy > 2100)) {alert('year must be after 1900 and before 2101'); return false;} var dow = ['Sun','Mon','Tue','Wed','Thu','Fri','Sat']; var calendar = new Date();  var today = calendar.getDate(); calendar.setDate(1); if (yy > 1900) calendar.setFullYear(yy); if (mm > 0) calendar.setMonth(mm - 1); var yy = year = calendar.getFullYear(); var month = calendar.getMonth(); calendar.setDate(today); var weekday = calendar.getDay(); var daysInMonth = monthlength(month+1,year); var hilite_start = '<td width="14" style="background:' + todaybg + '" align="center"><b>'; var td_start = '<td width="14" align="center">'; var cal = '<div id="cal"><div style="height:156px;width:170px"><table border="1" cellspacing="0" cellpadding="0" align="center"><tr><td colspan="7" style="background:' + headbg + '" align="center"><b>' + moy[month]  + ' ' + year + '<\/b><\/td><\/tr><tr>'; for(dex=0; dex < 7; dex++) {cal += td_start + dow[dex] + '</td>';} cal += '<\/tr><tr>'; var day2 = today; for (dex = today; dex > 6; dex -=7) day2 = dex; weekday -= day2 - 1; while (weekday < 0) weekday += 7; for(dex=0; dex < weekday; dex++) cal += td_start + ' <\/td>'; for(dex=1; dex <= daysInMonth; dex++) {if(weekday == 7) {cal += '</tr><tr>'; weekday = 0;} if(selDate==year+getmmdd(month+1,dex)) cal += hilite_start +'<span'+clickDate(dex,month,year) + '>'+ dex + '<\/span><\/b><\/td>'; else cal += td_start + '<span '+clickDate(dex,month,year) + '>' + dex + '<\/span><\/td>'; weekday += 1;} for(dex=weekday; dex < 7; dex++) cal += td_start + ' <\/td>'; cal += '<\/tr><\/table><\/div>';if (document.getElementById) {var mmb = month;  mm = month + 1; var yya = yyb = yy; if (mmb <1) {mmb += 12; yyb--;} var mma = month + 2; if (mma > 12) {mma -= 12; yya++;} var yb = yy -1; var ya = yy +1; cal += '<table border="0" cellspacing="0" cellpadding="1" width="160"><tr><td><a href="#" onclick="if (cala = dispCal('+yb+','+mm+')) {document.getElementById(\'cal\').innerHTML = cala; return false;}"><<</a></td><td><a href="#" onclick="if (cala = dispCal('+yyb+','+mmb+')) {document.getElementById(\'cal\').innerHTML = cala; return false;}"><</a></td><td align="right"><a href="#" onclick="if (cala = dispCal('+yya+','+mma+')) {document.getElementById(\'cal\').innerHTML = cala; return false;}">></a></td><td align="right"><a href="#" onclick="if (cala = dispCal('+ya+','+mm+')) {document.getElementById(\'cal\').innerHTML = cala; return false;}">>></a></td></tr></table>';} else {cal += '<div> </div>';} cal += '</div>'; return cal;}
function start() {var x = '<div id="calDate"><\/div>'; var y = ''; if (tb == 't') y = x + dispCal(0,0); else y = dispCal(0,0) + x; document.getElementById('calendar').innerHTML = y; ev();}
loaded('calendar',start);
function clickDate(day, month, year) {var ct = nextDate(year + getmmdd(month+1,day));if (ct == '') ct = nextDate('0000' + getmmdd(month+1,day));if (ct == '') return 'style="color:'+textclr+'"'; else return 'style="cursor:pointer;color:'+linkclr+'" onclick="selDate = '+year+ getmmdd(month+1,day)+'; isDate(' + day + ',' + month + ',' + year + ');return false;"';}function isDate(dayVal,monthVal,yearVal) {var ct = nextDate(yearVal + getmmdd(monthVal+1,dayVal));if (ct == '') ct = nextDate('0000' + getmmdd(monthVal+1,dayVal));if (ct == '') ct = noMessage;document.getElementById('calDate').innerHTML = selDate + ':<br \/>' +ct; return false;}function nextDate(yymmdd) {var x = dA.length;for (var i = 0; i < x; i++) {if (dA[i].substr(0,8) == yymmdd) return dA[i].substr(8);}return '';}function getmmdd(mm,dd) {return (mm > 9 ? '' + mm : '0' + mm) + (dd > 9 ? dd : '0' + dd);}
function ev() {var ct = nextDate(selDate);var ct = nextDate(selDate);if (ct == '') ct = nextDate('0000' + selDate.substr(4));if (ct == '') ct = noMessage; document.getElementById('calDate').innerHTML = selDate + ':<br \/> ' +ct;}