// JavaScript Document

// JavaScript Document



var Ad = new Array();
/*Today = new Date();
thisday = Today.getDay();*/
Ad[0] = '<img src="images/siteimages/ads_databases.jpg" alt="Hundreds of databases" width="217" height="146" class="home" />	<div id="pagetitle" class="databases"><h2 class="home">Hundreds of<br />&amp; Databases</h2><p style="margin-left: 0px;">Magazine, newspaper, and encyclopedia articles about a variety of topics instantly.</p></div>';
Ad[1] = '<img src="images/siteimages/ads_great_reads.jpg" alt="Find the music you want at the library" width="217" height="146" class="home" /><div id="pagetitle" class="greatreads"><h2 class="home">Great Reads<br />Top Picks</h2><p style="margin-left: 0px;">Check out the Reader’s Nook for great picks and new aquisitions!</p></div>';
Ad[2] = '<img src="images/siteimages/ads_audio_books.jpg" alt="Find the music you want at the library" width="217" height="146" class="home" />	<div id="pagetitle" class="audiobook"><h2>Audio Book</h2><h3>Digital Downloads</h3><p style="margin-left: 0px;">Browse and search hundreds of great titles available for download.</p></div>';
Ad[3] = '<img src="images/siteimages/ads_video.jpg" alt="Find the music you want at the library" width="217" height="146" class="home" /><div id="pagetitle" class="video"><h2 class="home">Movies, music <br />&amp; Books to go</h2><p style="margin-left: 0px;">Access hundreds of videos, audio books, and music titles for a wide range of interests.</p></div>';
Ad[4] = '<img src="images/siteimages/ads_grandpa.jpg" alt="Find the music you want at the library" width="217" height="146" class="home" /><div id="pagetitle" class="grandpa"><h2 class="home">Quality Time</h2><h3>at your library</h3><p style="margin-left: 0px;">Spend juicy moments getting inspired over a good book.</p></div>';
Ad[5] = '<img src="images/siteimages/ads_research.jpg" alt="Find the music you want at the library" width="217" height="146" class="home" /><div id="pagetitle" class="research"><h3 style="padding: 5px 12px 3px 16px;">Overwhelmed?</h3><h2 style="padding: 0 0 3px 16px;">We can help!</h2><p style="margin-left: 0px;">Research gurus available on request to help you find the facts.</p></div>';
Ad[6] = '<img src="images/siteimages/ads_learn.jpg" alt="Find the music you want at the library" width="217" height="146" class="home" /><div id="pagetitle" class="learn "><h2 class="home">Learn More</h2><h3 style="font-size: 1.5em;">Lectures and Classes</h3><p style="margin-left: 0px;">Take advantage of all the great programs offered FREE at your library.</p></div>';
Ad[7] = '<img src="images/siteimages/ads_museum_owl.jpg" alt="Find the music you want at the library" width="217" height="146" class="home" /><div id="pagetitle" class="museum"><h2 class="home">Be a wise-guy</h2><h3>Use Museum Passes</h3><p style="margin-left: 0px;">Explore art, natural history, science, marine life, gardens, farms, and fun for FREE!</p></div>';
Ad[8] = '<img src="images/siteimages/ads_connected.jpg" alt="Find the music you want at the library" width="217" height="146" class="home" /><div id="pagetitle" class="connected"><h2 class="home">Connect</h2><h3>at your library</h3><p style="margin-left: 0px;">The perfect place to meet and share ideas.</p></div>';
Ad[9] = '<img src="images/siteimages/ads_wifi_laptops.jpg" alt="Find the music you want at the library" width="217" height="146" class="home" /><div id="pagetitle" class="wifi"><h2 class="home">Clicky, Clicky</h2><h3>We&rsquo;ve got WiFi</h3><p style="margin-left: 0px;">Get busy with your laptop or use our computers to surf or work in style.</p></div>';
Ad[10] = '<img src="images/siteimages/ads_family.jpg" alt="Find the music you want at the library" width="217" height="146" class="home" /><div id="pagetitle" class="family"><h2 class="home">Family Time</h2><h3>at your library</h3><p style="margin-left: 0px;">Spend quality time discovering new worlds of adventure together.</p></div>';
Ad[11] = '<img src="images/siteimages/ads_music.jpg" alt="Find the music you want at the library" width="217" height="146" class="home" /><div id="pagetitle" class="music"><h2 class="home">Rock Out</h2><h3>at your library</h3><p style="margin-left: 0px;">Check out our music selection with reggae, rock, folk, classical and more!</p></div>';
Ad[12] = '<img src="images/siteimages/ads_rejuvenate.jpg" alt="Find the music you want at the library" width="217" height="146" class="home" /><div id="pagetitle" class="rejuvenate"><h2 class="home">Rejuvenate</h2><h3>at your library</h3><p style="margin-left: 0px;">Find your space and enjoy the quiet solitude and special places.</p></div>';
Ad[13] = '<img src="images/siteimages/ads_play.jpg" alt="Find the music you want at the library" width="217" height="146" class="home" /><div id="pagetitle" class="play"><h2 class="home">Come play<br />and learn</h2><p style="margin-left: 0px;">Children&rsquo;s games, DayCare Kits, books, story times, and more!</p></div>';
/*function writeAd() {
document.write(msg[thisday]);
}*/

var A = Ad.length;
var whichAd=Math.round(Math.random()*(A-1));
function showAd(){document.write(Ad[whichAd]);}
/*showQuotation();*/

var Images = new Array();

Images[0] = "<img src='../images/siteimages/r_inner_23.jpg' width='177' height='146' />";
Images[1] = "<img src='../images/siteimages/r_inner_1.jpg' width='177' height='146' />";
Images[2] = "<img src='../images/siteimages/r_inner_2.jpg' width='177' height='146' />";
Images[3] = "<img src='../images/siteimages/r_inner_3.jpg' width='177' height='146' />";
Images[4] = "<img src='../images/siteimages/r_inner_4.jpg' width='177' height='146' />";
Images[5] = "<img src='../images/siteimages/r_inner_5.jpg' width='177' height='146' />";
Images[6] = "<img src='../images/siteimages/r_inner_6.jpg' width='177' height='146' />";
Images[7] = "<img src='../images/siteimages/r_inner_7.jpg' width='177' height='146' />";
Images[8] = "<img src='../images/siteimages/r_inner_8.jpg' width='177' height='146' />";
Images[9] = "<img src='../images/siteimages/r_inner_9.jpg' width='177' height='146' />";
Images[10] = "<img src='../images/siteimages/r_inner_10.jpg' width='177' height='146' />";
Images[11] = "<img src='../images/siteimages/r_inner_11.jpg' width='177' height='146' />";
Images[12] = "<img src='../images/siteimages/r_inner_12.jpg' width='177' height='146' />";
Images[13] = "<img src='../images/siteimages/r_inner_13.jpg' width='177' height='146' />";
Images[14] = "<img src='../images/siteimages/r_inner_14.jpg' width='177' height='146' />";
Images[15] = "<img src='../images/siteimages/r_inner_15.jpg' width='177' height='146' />";
Images[16] = "<img src='../images/siteimages/r_inner_16.jpg' width='177' height='146' />";
Images[17] = "<img src='../images/siteimages/r_inner_17.jpg' width='177' height='146' />";
Images[18] = "<img src='../images/siteimages/r_inner_18.jpg' width='177' height='146' />";
Images[19] = "<img src='../images/siteimages/r_inner_19.jpg' width='177' height='146' />";
Images[20] = "<img src='../images/siteimages/r_inner_20.jpg' width='177' height='146' />";
Images[21] = "<img src='../images/siteimages/r_inner_21.jpg' width='177' height='146' />";
Images[22] = "<img src='../images/siteimages/r_inner_22.jpg' width='177' height='146' />";

var I = Images.length;
var whichImage=Math.round(Math.random()*(I-1));
function showImage(){document.write(Images[whichImage]);}

//function YouAreHere(vizid)
//{
//document.getElementById(vizid).style.borderBottom="1px dotted #FFFFFF";
//}
function YouAreHere(vizid, subvizid)
{
document.getElementById(vizid).style.backgroundColor="#fdb825"
document.getElementById(vizid).style.color="#FFFFFF"
document.getElementById(vizid).style.display="block"
document.getElementById(vizid).style.margin="0px 0 0 0"
document.getElementById(vizid).style.padding="0px 2px 0px 16px"
document.getElementById(vizid).style.borderBottom="1px solid #fdb825"
document.getElementById(subvizid).style.color="#fdb825"
document.getElementById(subvizid).style.display="block"
document.getElementById(subvizid).style.margin="0"
document.getElementById(subvizid).style.padding="0 2px 0 32px"
document.getElementById(subvizid).style.border="0"
}


function callfeed() {
// new variable to handle long event names
				var maxNameLength = 43;
		
			// EventKeeper first returns a javascript variable called fString for FeedString 
			// which tells us what varibles are returned. 
			// characters in the string can be: 
			// D : date 
			// T : time 
			// N : name 
			// 1 : keyword 1 
			// 2 : keyword 2 
			
			// EventKeeper has created an javascript array variable called evtArray
			// with fields = evt_date, evt_time, evt_name, evt_ID, evt_Key1 and evtKey2

			document.write("<ul>");
			
			// loop through the array, creating a list item for each row in the array.
			for (i=0; i<evtArray.length; i++)
			{
				
				if (FeedString.indexOf("N") != -1)
				{
					{
						// handle long event names
						var theName = evtArray[i][evt_name];
						if (theName.length > maxNameLength)
							theName = theName.substring(0,maxNameLength-2) + '...';
							
						// create the hyperlink based on the Event Name and the Event ID
						
						var linkurl = 'http://www.eventkeeper.com/clients/fitchbpl/ek_fitchbpl.cfm';
						
						linkurl += "#" + evtArray[i][evt_id];
						var namelink = '<a href="' + linkurl + '" target="_blank" title="';
						namelink += evtArray[i][evt_name] + '">' + theName + '</a>';
						document.write("<li>" + namelink + "<br />");
					}
				}

				if (FeedString.indexOf("D") != -1);
				document.write(evtArray[i][evt_date]);
					
				if (FeedString.indexOf("T") != -1);
					document.write(" " +evtArray[i][evt_time] + "<br /></li> ");
			}	
			document.write("</ul></i>");
}