﻿
//CALENDAR ARRAY
var calendarArray = new Array();
//EXAMPLE
//calendarArray[0] = new calendarObject([DATE],[TIME], [NAME],[DESCRIPTION], [E-MAIL]);
calendarArray[0] = new calendarObject("6/19/2008","9:30 AM", "VIP Class Room Series","Two Perspectives on: Short Sales & Foreclosures<br/><br/>Click <a href='calendarfiles/june19VIPClass.pdf' target='_blank'>here</a> to see the class flyer<br/>", "klmurray@firstam.com");
calendarArray[1] = new calendarObject("8/14/2008","8:30 AM to 11:30 AM", "Morning Workshop for Lead Generation","Strategic Real Estate Marketing Tools Workshop for Lead Generation<br/><br/>Click <a href='calendarfiles/aug14Class.pdf' target='_blank'>here</a> to see the class flyer<br/>", "klmurray@firstam.com");
calendarArray[2] = new calendarObject("8/14/2008","12:30 PM to 3:30 PM", "Afternoon Workshop for Lead Generation","Strategic Real Estate Marketing Tools Workshop for Lead Generation, Location: 222 SW Columbia, Suite 400, Portland, OR  97201<br/><br/>Click <a href='calendarfiles/aug14Class.pdf' target='_blank'>here</a> to see the class flyer<br/>", "klmurray@firstam.com");
calendarArray[3] = new calendarObject("9/11/2008","9:00 AM to 11:00 AM", "Subdivisions, Planned Communities & Condos", "2007 & 2008 Legislative Updates, Condominiums vs planned communities, Creating Associations, Association Management, Location: Albernethy Center, 606 15th St, Oregon City, OR 97045<br/><br/>Click <a href='calendarfiles/2008CondoCommunities911.pdf' target='_blank'>here</a> to see the class flyer<br/>", "klmurray@firstam.com");
calendarArray[4] = new calendarObject("9/24/2008","", "Class Canceled", "Tax Updates class has been canceled for September 24th, and has been rescheduled to October 23.", "klmurray@firstam.com");
calendarArray[5] = new calendarObject("10/2/2008","9:30 AM to 11:30 AM", "Subdivisions, Planned Communities & Condos", "2007 & 2008 Legislative Updates, Condominiums vs planned communities, Creating Associations, Association Management, Location: Beaverton Round Executive Suites, 12725 SW Millikan Way, Suite 300, Beaverton, OR 97005<br/><br/>Click <a href='calendarfiles/2008CondoCommunities1002.pdf' target='_blank'>here</a> to see the class flyer<br/>", "klmurray@firstam.com");
calendarArray[6] = new calendarObject("10/23/2008","9:30 AM to 11:00 AM", "Tax Updates", "Location: First American Title, 222 SW Columbia, Ste 400, Portland, OR 97201, <br/><br/>Click <a href='calendarfiles/VIPClass924.pdf' target='_blank'>here</a> to see the class flyer<br/>", "klmurray@firstam.com");
//calendarArray[6] = new calendarObject("10/23/2008","9:30 AM to 11:00 AM", "Encroachments & Boundary Lines", "Definitions, Examples & Solutions Location: First American Title, 222 SW Columbia, Ste 400, Portland, OR 97201, <br/><br/>Click <a href='calendarfiles/VIPClass1023.pdf' target='_blank'>here</a> to see the class flyer<br/>", "klmurray@firstam.com");
calendarArray[7] = new calendarObject("11/12/2008","10:15 AM to 12:15 PM", "2008 Real Estate Form Changes", "Bankruptcy Primer, Location: First American Title, 200 SW Market Street, Building Conference Room on Lobby Level, Portland, OR 97201, <br/><br/>Click <a href='calendarfiles/VIPClass1113.pdf' target='_blank'>here</a> to see the class flyer<br/>", "klmurray@firstam.com");
calendarArray[8] = new calendarObject("12/17/2008","9:30 AM to 11:00 AM", "Urban Reserves & Legislative Update", "Metro 50 year plan for urban growth and updates in Real Estate and Housing, Location: First American Title, 222 SW Columbia, Ste 400, Portland, OR 97201, <br/><br/>Click <a href='calendarfiles/VIPClass1217.pdf' target='_blank'>here</a> to see the class flyer<br/>", "klmurray@firstam.com");
calendarArray[9] = new calendarObject("1/14/2009","9:30 AM to 12:00 noon", "USDA Rural Housing Training ", "Eastside Session<br>Location: Heidis of Gresham, Restaurant Meeting Room, 1230 NE Cleveland Ave, Gresham, OR 97030, <br/><br/>Click <a href='calendarfiles/USDAEast.pdf' target='_blank'>here</a> to see the class flyer<br/>", "hariceaga@firstam.com");
calendarArray[10] = new calendarObject("1/15/2009","9:45 AM to 12:00 noon", "USDA Rural Housing Training ", "Westside Session<br>Location: Hillsboro Main Library, Meeting Room, 2850 NE Brookwood Pkwy, Hillsboro, OR 97124, <br/><br/>Click <a href='calendarfiles/USDA.pdf' target='_blank'>here</a> to see the class flyer<br/>", "hariceaga@firstam.com");
calendarArray[11] = new calendarObject("2/18/2009","9:30 AM to 11:30 AM", "Structured Sales Seminar ", "Location: First American Title Insurance<br>222 SW Columbia, Suite 400<br>Portland, OR 97201 <br/><br/>Click <a href='calendarfiles/2-18-09StructuredSalesClass.pdf' target='_blank'>here</a> to see the class flyer<br/>", "hariceaga@firstam.com");
calendarArray[12] = new calendarObject("3/12/2009","9:30 AM to 11:30 AM", "Changing Landscape in Real Estate Sales ", "Location: First American Title Insurance<br>222 SW Columbia, Suite 400<br>Portland, OR 97201 <br/><br/>Click <a href='calendarfiles/Mar09VIP.pdf' target='_blank'>here</a> to see the class flyer<br/>", "hariceaga@firstam.com");
calendarArray[13] = new calendarObject("4/15/2009","2:00 PM to 4:00 PM", "Structured Sales Seminar ", "Location: Beaverton Public Library<br>12375 SW 5th St<br>Beaverton, OR 97205 <br/><br/>Click <a href='calendarfiles/April 15th class.pdf' target='_blank'>here</a> to see the class flyer<br/>", "hariceaga@firstam.com");
calendarArray[14] = new calendarObject("4/16/2009","9:30 AM to 11:30 AM", "First Time Homebuyer Programs ", "Location: First American Title Insurance<br>222 SW Columbia, Suite 400<br>Portland, OR 97201 <br/><br/>Click <a href='calendarfiles/April16thclass.pdf' target='_blank'>here</a> to see the class flyer<br/>", "hariceaga@firstam.com");
calendarArray[15] = new calendarObject("4/23/2009","9:30 AM to 11:30 AM", "Urban Reserves/Legislative Update ", "Location: First American Title Insurance<br>222 SW Columbia, Suite 400<br>Portland, OR 97201 <br/><br/>Click <a href='calendarfiles/April23class.pdf' target='_blank'>here</a> to see the class flyer<br/>", "hariceaga@firstam.com");
calendarArray[16] = new calendarObject("5/28/2009","9:30 AM to 11:30 AM", "Tax Update ", "Location: First American Title Insurance<br>222 SW Columbia, Suite 400<br>Portland, OR 97201 <br/><br/>Click <a href='calendarfiles/May28VIPClass.pdf' target='_blank'>here</a> to see the class flyer<br/>", "hariceaga@firstam.com");
calendarArray[17] = new calendarObject("6/17/2009","9:30 AM to 11:30 AM", "Oil Tanks ", "Location: First American Title Insurance<br>222 SW Columbia, Suite 400<br>Portland, OR 97201 <br/><br/>Click <a href='calendarfiles/VIP6-17-09.pdf' target='_blank'>here</a> to see the class flyer<br/>", "hariceaga@firstam.com");
calendarArray[18] = new calendarObject("7/23/2009","9:30 AM to 11:30 AM", "Homebuyer Programs ", "Location: First American Title Insurance<br>222 SW Columbia, Suite 400<br>Portland, OR 97201 <br/><br/>Click <a href='calendarfiles/VIP07-23-09.pdf' target='_blank'>here</a> to see the class flyer<br/>", "hariceaga@firstam.com");
calendarArray[19] = new calendarObject("8/20/2009","9:30 AM to 11:30 AM", "Assessments & Collections and Fannie Mae/Association Reserves", "Location: First American Title Insurance<br>222 SW Columbia, Suite 400<br>Portland, OR 97201 <br/><br/>Click <a href='calendarfiles/Aug20VIP.pdf' target='_blank'>here</a> to see the class flyer<br/>", "hariceaga@firstam.com");
calendarArray[20] = new calendarObject("9/23/2009","9:30 AM to 11:30 AM", "New Lender Laws and the Closing Costs", "Location: First American Title Insurance<br>222 SW Columbia, Suite 400<br>Portland, OR 97201 <br/><br/>Click <a href='calendarfiles/Sep23VIPClass.pdf' target='_blank'>here</a> to see the class flyer<br/>", "hariceaga@firstam.com");
calendarArray[21] = new calendarObject("10/29/2009","9:30 AM to 11:30 AM", "OARs Legislative Agenda", "Location: First American Title Insurance<br>222 SW Columbia, Suite 400<br>Portland, OR 97201 <br/><br/>Click <a href='calendarfiles/Oct29VIPClass.pdf' target='_blank'>here</a> to see the class flyer<br/>", "hariceaga@firstam.com");
calendarArray[22] = new calendarObject("11/19/2009","9:30 AM to 11:30 AM", "Bankruptcy and Case Law Updates", "Location: First American Title Insurance<br>222 SW Columbia, Suite 400<br>Portland, OR 97201 <br/><br/>Click <a href='calendarfiles/Nov19VIPClass.pdf' target='_blank'>here</a> to see the class flyer<br/>", "hariceaga@firstam.com");

//CALENDAR OBJECT
function calendarObject(eventDate, eventTime, eventName, eventDescription, eventEmail)
{
    this.eventDate = new Date(eventDate);
    this.eventTime = String(eventTime);
    this.eventName = String(eventName);
    this.eventDescription = String(eventDescription);
    this.eventEmail = String(eventEmail);
        
}

function sortByDate(firstElement, secondElement)
{
    var fElementTime = String(firstElement.eventTime);
    var fElementHour = Number(fElementTime.substr(0, fElementTime.indexOf(":")));
    var fElementMinutes = Number(fElementTime.substr(fElementTime.indexOf(":")+1,2));
    
    if (fElementTime.indexOf("PM") != -1 && fElementHour != 12)
        fElementHour = fElementHour + 12;
    
    var sElementTime = String(secondElement.eventTime);
    var sElementHour = Number(sElementTime.substr(0, sElementTime.indexOf(":")));
    var sElementMinutes = Number(sElementTime.substr(sElementTime.indexOf(":")+1,2));
    if (sElementTime.indexOf("PM") != -1 && sElementHour != 12)
        sElementHour = sElementHour + 12;
    
    if (fElementHour == sElementHour)
        return fElementMinutes - sElementMinutes;
    else
        return fElementHour - sElementHour;    
}
