var photo_url="http://picasaweb.google.com/webmaster.todmi";
var video_url="http://video.google.com/videosearch?q=todmi+mission+genre:RELIGIOUS+site:google.com&so=1&num=100";

function change(html){
  description.innerHTML= "<font style='font-size: 10pt'>" + html + "</font>";
}

function getDocumentLink(directoryNoEndSlash, filenameNoExtension, ext) {
  var icon;
  if (ext == "doc") {
    icon = "/images/msword-sml.jpg";
  } else {
    icon = "/images/pdficon-sml.jpg";
  }
  return "<a target=\"_blank\" href=\"" + directoryNoEndSlash + "/" + filenameNoExtension + "." + ext + "\">" +
		   "<img border=\"0\" src=\"" + icon + "\" width=\"16\" height=\"14\" align=\"absbottom\"></a>&nbsp;";
}

// returns a Word document icon and an pdf document icon, with 
// hyperlinks to the files
function getDocumentIconLinks(directoryNoEndSlash, filenameNoExtension) {
  return getDocumentIconLink(directoryNoEndSlash, filenameNoExtension, 'doc') + 
         "" + 
         getDocumentIconLink(directoryNoEndSlash, filenameNoExtension, 'pdf');
}



function getItineraryRow(item)
{
	var date = item[0];
	var location = item[1];
	var details = item[2];
	var doc1 = item[3];
	var pdf1 = item[4];
	var doc2 = item[5];
	var pdf2 = item[6];

	
	if (doc1 != "")
	{
		details += " " + getDocumentLink("/events", doc1, "doc");
	}

	if (pdf1 != "")
	{
		details += " " + getDocumentLink("/events", pdf1, "pdf");
	}
	
	if (doc2 != "")
	{
		details += " " + getDocumentLink("/events", doc2, "doc");
	}	
	
	if (pdf2 != "")
	{
		details += " " + getDocumentLink("/events", pdf2, "pdf");
	}	
	
	return "<tr>" +
			"<td>" + date + "</td>" +
			"<td>" + location + "</td>" +
			"<td>" + details + "</td>" +
		   "</tr>";
}