function LoopOverActivitiesCollection()
{
// Get a reference to the WebScheduleInfo
var scheduleInfo = ig_getWebScheduleInfoById("WebScheduleInfo1");
// Get the WebScheduleInfo's Activities
var activities = scheduleInfo.getActivities();
var activity = null;
// Loop over the activities collection
for(var i = 0; i < activities.length; i++)
{
// Find the activity that has subject New Appointment
if(activities[i].getSubject() == "New Appointment")
{
activity = activities[i];
// Return the New Appointments Location
alert(activity.getLocation());
break;
}
}
}