// JavaScript Document



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>");
}