/**
 *  Courses.js
 *
 *  TTC Courses and International Courses are edited here.
 *  This file acts as a 'data' file for all courses and program schedules,
 *  and may be edited accordingly. All courses are automatically sorted by
 *  the date.
 *
 *  TTC Courses appear in the first half;
 *  International Courses appear in the second half;
 *
 *  It does not matter what order you place each course section, they
 *  will be sorted according to the date.
 *  
 *  Please copy the format for an existing course, and change the values
 *  accordingly. The program syntax is extremely important, follow it 
 *  very carefully or the page may not display correctly.
 *
 *  Dates: 
 *  Since the courses are sorted by Date, it is also very important that
 *  the date format be followed or else the course may display out of order.
 *  The date format is: 
 *      Mmm [d]d - Mmm [d]d
 *      Explanation:
 *          Mmm: 3-letter Month, first is capital, followed by two lowercase.
 *
 *          [d]d: The numeric date, either 1 or two digits
 *          
 *          A space should exist between the first date and the hyphen, and also
 *          between the hyphen and the second date
 *
 *      Examples:
 *          GOOD:
 *          "Jan 5 - Feb 1"
 *          "Aug 31 - Sep 27"
 *
 *          BAD:
 *          "January 5 - February 1"
 *          "jan 5 - feb 1"
 *          "JAN 5 - FEB 1"
 *          "Jan 5-Feb 1"
 *
 *
 *  Locations:
 *  For convenience, most of the Sivananda Locations have been created as variables,
 *  these have been created in the file named /js/sivananda.js Javascript file.
 *  They have been included here for reference purposes. This makes it easier to
 *  create the course entries, since you don't have to always specify the name
 *  and url of the course every time.
 *
 *  These are the URL's and the displayed names for each of the variables used. 
 *  This is for reference purposes only. See the /js/sivananda.js file if you
 *  ever need to change any of these, or add new ones.
 *  
 *  var camp        = new Location ( "Val Morin, Canada",       "/camp/" );    
 *  var dorset      = new Location ( "England",         "/london/ukttc.html" );
 *  var farm        = new Location ( "Grass Valley,California", "/farm/" );
 *  var ranch       = new Location ( "Woodbourne, NY, USA",     "/ranch/" );
 *  var meissen     = new Location ( "Meissen, Germany",        "/ttceurope/meissen.html" );
 *  var nassau      = new Location ( "Nassau, Bahamas",         "/nassau/" );
 *  var netala      = new Location ( "Netala, U' Kashi, India", "/uttarkashi/" );
 *  var neyyardam   = new Location ( "Neyyar Dam, India",       "/neyyardam/" );
 *  var orleans     = new Location ( "Orleans, France",         "/orleans/" );
 *  var reith       = new Location ( "Reith, Tyrol, Austria",   "/tyrol/" );
 *  var mittersill  = new Location ( "Mittersill, Austria",     "/tyrol/" );
 *  var spain       = new Location ( "Spain",                   "/madrid/ttc/introduction_en.html" );
 *  var cuenca      = new Location ( "Cuenca, Spain",           "/madrid/ttc/introduction_en.html" );
 *  var uruguay     = new Location ( "Uruguay",                 "/montevideo/" );
 *  var garopaba    = new Location ( "Brasil",        	        "/montevideo/garopaba/info_garopaba.htm" );
 *  var santillana  = new Location ( "Spain", 			"madrid/ttc/introduction_en.html" );
 *  var lithuania   = new Location ( "Lithuania", 		"/ttc_europe");
 *  var austria     = new Location ( "Austria",                 "/ayurveda-europe");
 */

    
/**
 * TTC Courses Listing
 *
 *  Add or remove courses for the TTC.
 *  If adding, copy one section and edit the values.
 *  The order each section is listed here does not matter,
 *  as the courses will be sorted by date.
 *
 *  Note that Ttc contains a 'language' setting, 
 *  and that International contains a 'type' setting.
 *
 *  Please use caution that the precise code syntax is adhered to.
 */    
    var Ttc = new Array();
    var entry;



// TTC	farm	English	Oct 4	Nov 2	2300	2860  3025 3575
// Start course data
    entry = new Course( farm );
    entry.dates = "Oct 4 - Nov 2";
    entry.year = 2008;
    entry.language = "<span class='footer'>English</span>";
    Ttc[ Ttc.length ] = entry;  // add course entry to TTC Array
	

// TTC	netala	English	Oct 5	Nov 2		2125  2450 
// Start course data
    entry = new Course( netala );
    entry.dates = "Oct 5 - Nov 2";
    entry.year = 2008;
    entry.language = "<span class='footer'>English</span>";	
    Ttc[ Ttc.length ] = entry;  // add course entry to TTC Array
	

// TTC	vrindavan	English, Français, Deutsch, Español	Oct 11	Nov 8		1350 1550 1800 
// Start course data
    entry = new Course( vrindavan );
    entry.dates = "Oct 11 - Nov 8";
    entry.year = 2008;
    entry.language = "<span class='footer'>English, Français, Deutsch, Español</span>";	
    Ttc[ Ttc.length ] = entry;  // add course entry to TTC Array
	

// TTC	buenosaires	Español	Oct 26	Nov 22		  2160 
// Start course data
    entry = new Course( mardelplata );
    entry.dates = "Oct 26 - Nov 22";
    entry.year = 2008;
    entry.language = "<span class='footer'>Español</span>";	
    Ttc[ Ttc.length ] = entry;  // add course entry to TTC Array
	

// TTC	telaviv		Nov 1	Nov 28	TBA	   
// Start course data
    entry = new Course( telaviv );
    entry.dates = "Nov 1 - Nov 28";
    entry.year = 2008;
    Ttc[ Ttc.length ] = entry;  // add course entry to TTC Array

	
	

// TTC	neyyardam	English	Nov 16	Dec 14	1900	2125  2450 
// Start course data
    entry = new Course( neyyardam );
    entry.dates = "Nov 16 - Dec 14";
    entry.year = 2008;
    entry.language = "<span class='footer'>English</span>";	
    Ttc[ Ttc.length ] = entry;  // add course entry to TTC Array
	

// TTC	camp	English 	Nov 16	Dec 14		2860  3025 3575
// Start course data
    entry = new Course( camp );
    entry.dates = "Nov 16 - Dec 14";
    entry.year = 2008;
    entry.language = "<span class='footer'>English</span>";	
    Ttc[ Ttc.length ] = entry;  // add course entry to TTC Array
	

// TTC	maduraiashram	English	Nov 30	Dec 28	1600	1800 2000  
// Start course data
    entry = new Course( maduraiashram );
    entry.dates = "Nov 30 - Dec 28";
    entry.year = 2008;
    entry.language = "<span class='footer'>English</span>";	
    Ttc[ Ttc.length ] = entry;  // add course entry to TTC Array
	

// TTC	reith	English, Français, Deutsch, Español	Dec 20	Jan 17		2350 2600 3250 3550
// Start course data
    entry = new Course( reith );
    entry.dates = "Dec 20 - Jan 17";
    entry.year = 2008;
    entry.language = "<span class='footer'>English, Français, Deutsch, Español</span>";	
    Ttc[ Ttc.length ] = entry;  // add course entry to TTC Array






/*
 * 2009 Dates
 */



// TTC	garopaba	Español, Portuguese, English	Jan 4	Feb 1		2650  2950 
// Start course data
    entry = new Course( garopaba );
    entry.dates = "Jan 4 - Feb 1";
    entry.year = 2009;
    entry.language = "<span class='footer'>Español, Portuguese, English</span>";	
    Ttc[ Ttc.length ] = entry;  // add course entry to TTC Array
	

// ATTC	nassau	English, Français, Deutsch, Español	Jan 4	Jan 31	2400	3290   
// Start course data
    entry = new Course( nassau );
    entry.dates = "Jan 4 - Jan 31";
    entry.year = 2009;
    entry.language = "<span class='footer'>English, Français, Deutsch, Español</span>";	
    Ttc[ Ttc.length ] = entry;  // add course entry to TTC Array
	

// TTC	neyyardam	English, Français, Deutsch, Español	Jan 4	Feb 1	1900	2125  2450 
// Start course data
    entry = new Course( neyyardam );
    entry.dates = "Jan 4 - Feb 1";
    entry.year = 2009;
    entry.language = "<span class='footer'>English, Français, Deutsch, Español</span>";	
    Ttc[ Ttc.length ] = entry;  // add course entry to TTC Array
	

// TTC	vrindavan	English, Français, Deutsch, Español	Jan 31	Mar 1		1350 1550 1800 
// Start course data
    entry = new Course( vrindavan );
    entry.dates = "Jan 31 - Mar 1";
    entry.year = 2009;
    entry.language = "<span class='footer'>English, Français, Deutsch, Español</span>";	
    Ttc[ Ttc.length ] = entry;  // add course entry to TTC Array
	

// TTC	nassau	English	Feb 1	Feb 28	2400	3290   
// Start course data
    entry = new Course( nassau );
    entry.dates = "Feb 1 - Feb 28";
    entry.year = 2009;
    entry.language = "<span class='footer'>English</span>";	
    Ttc[ Ttc.length ] = entry;  // add course entry to TTC Array
	

// ATTC	maduraiashram	English, Français, Deutsch, Español	Feb 8	Mar 8		1800 2000  
// Start course data
    entry = new Course( maduraiashram );
    entry.dates = "Feb 8 - Mar 8";
    entry.year = 2009;
    entry.language = "<span class='footer'>English, Français, Deutsch, Español</span>";	
    Ttc[ Ttc.length ] = entry;  // add course entry to TTC Array
	

// TTC	neyyardam	English	Feb 8	Mar 8	1900	2125  2450 
// Start course data
    entry = new Course( neyyardam );
    entry.dates = "Feb 8 - Mar 8";
    entry.year = 2009;
    entry.language = "<span class='footer'>English</span>";	
    Ttc[ Ttc.length ] = entry;  // add course entry to TTC Array
	

// TTC	nassau	English, Français, Deutsch, Español	Mar 5	Apr 1	2400	3290   
// Start course data
    entry = new Course( nassau );
    entry.dates = "Mar 5 - Apr 1";
    entry.year = 2009;
    entry.language = "<span class='footer'>English, Français, Deutsch, Español</span>";	
    Ttc[ Ttc.length ] = entry;  // add course entry to TTC Array
	

// TTC	neyyardam	English	Mar 15	Apr 12	1900	2125  2450 
// Start course data
    entry = new Course( neyyardam );
    entry.dates = "Mar 15 - Apr 12";
    entry.year = 2009;
    entry.language = "<span class='footer'>English</span>";	
    Ttc[ Ttc.length ] = entry;  // add course entry to TTC Array
	

// TTC	nassau	English	Apr 5	May 2	2400	3290   
// Start course data
    entry = new Course( nassau );
    entry.dates = "Apr 5 - May 2";
    entry.year = 2009;
    entry.language = "<span class='footer'>English</span>";	
    Ttc[ Ttc.length ] = entry;  // add course entry to TTC Array
	

// TTC	netala	English	Apr 19	May 17		2125  2450 
// Start course data
    entry = new Course( netala );
    entry.dates = "Apr 19 - May 17";
    entry.year = 2009;
    entry.language = "<span class='footer'>English</span>";	
    Ttc[ Ttc.length ] = entry;  // add course entry to TTC Array
	

// TTC	farm	English 	May 2	May 31	2300	2860  3025 3575
// Start course data
    entry = new Course( farm );
    entry.dates = "May 2 - May 31";
    entry.year = 2009;
    entry.language = "<span class='footer'>English</span>";	
    Ttc[ Ttc.length ] = entry;  // add course entry to TTC Array
	

// TTC	reith	Deutsch	May 23	Jun 21	2100	   
// Start course data
    entry = new Course( reith );
    entry.dates = "May 23 - Jun 21";
    entry.year = 2009;
    entry.language = "<span class='footer'>Deutsch</span>";	
    Ttc[ Ttc.length ] = entry;  // add course entry to TTC Array
	

// ATTC	reith	Deutsch	May 23	Jun 21	2100	   
// Start course data
    entry = new Course( reith );
    entry.dates = "May 23 - Jun 21";
    entry.year = 2009;
    entry.language = "<span class='footer'>Deutsch</span>";	
    Ttc[ Ttc.length ] = entry;  // add course entry to TTC Array
	

// TTC	ranch	English	May 31	Jun 28	2400	2960  3125 3675
// Start course data
    entry = new Course( ranch );
    entry.dates = "May 31 - Jun 28";
    entry.year = 2009;
    entry.language = "<span class='footer'>English</span>";	
    Ttc[ Ttc.length ] = entry;  // add course entry to TTC Array
	

// TTC	camp	English, Français, Deutsch, Español	Jul 5	Aug 1	2300	2860  3025 3575
// Start course data
    entry = new Course( camp );
    entry.dates = "Jul 5 - Aug 1";
    entry.year = 2009;
    entry.language = "<span class='footer'>English, Français, Deutsch, Español</span>";	
    Ttc[ Ttc.length ] = entry;  // add course entry to TTC Array
	

// ATTC	ranch	English	Jul 5	Aug 2	2400	2960  3125 3675
// Start course data
    entry = new Course( ranch );
    entry.dates = "Jul 5 - Aug 2";
    entry.year = 2009;
    entry.language = "<span class='footer'>English</span>";	
    Ttc[ Ttc.length ] = entry;  // add course entry to TTC Array
	

// TTC	reith	English, Français, Deutsch, Español	Aug 1	Aug 29	2100	   
// Start course data
    entry = new Course( reith );
    entry.dates = "Aug 1 - Aug 29";
    entry.year = 2009;
    entry.language = "<span class='footer'>English, Français, Deutsch, Español</span>";	
    Ttc[ Ttc.length ] = entry;  // add course entry to TTC Array
	

// ATTC	camp	English, Français, Deutsch, Español	Aug 2	Aug 29	2300	2860  3025 3575
// Start course data
    entry = new Course( camp );
    entry.dates = "Aug 2 - Aug 29";
    entry.year = 2009;
    entry.language = "<span class='footer'>English, Français, Deutsch, Español</span>";	
    Ttc[ Ttc.length ] = entry;  // add course entry to TTC Array
	

// TTC	reith	English, Français, Deutsch, Español	Aug 30	 	2100	   
// Start course data
    entry = new Course( reith );
    entry.dates = "Sep 5 - Oct 4";
    entry.year = 2009;
    entry.language = "<span class='footer'>English, Français, Deutsch, Español</span>";	
    Ttc[ Ttc.length ] = entry;  // add course entry to TTC Array
	

// TTC	camp	English 	Aug 30	Sep 26	2400	2960  3125 3675
// Start course data
    entry = new Course( camp );
    entry.dates = "Aug 30 - Sep 26";
    entry.year = 2009;
    entry.language = "<span class='footer'>English</span>";	
    Ttc[ Ttc.length ] = entry;  // add course entry to TTC Array
	

// TTC	ranch	English	Sep 11	Oct 9	2400	2960  3125 3675
// Start course data
    entry = new Course( ranch );
    entry.dates = "Sep 11 - Oct 9";
    entry.year = 2009;
    entry.language = "<span class='footer'>English</span>";	
    Ttc[ Ttc.length ] = entry;  // add course entry to TTC Array
	

// TTC	farm	English	Oct 3	Oct 31	2300	2860  3025 3575
// Start course data
    entry = new Course( farm );
    entry.dates = "Oct 3 - Oct 31";
    entry.year = 2009;
    entry.language = "<span class='footer'>English</span>";	
    Ttc[ Ttc.length ] = entry;  // add course entry to TTC Array
	

// TTC	buenosaires	Español	Oct 4	Oct 31		  2360 
// Start course data
    entry = new Course( buenosaires );
    entry.dates = "Oct 4 - Oct 31";
    entry.year = 2009;
    entry.language = "<span class='footer'>Español</span>";	
    Ttc[ Ttc.length ] = entry;  // add course entry to TTC Array
	

// TTC	netala	English	Oct 4	Nov 1		2125  2450 
// Start course data
    entry = new Course( netala );
    entry.dates = "Oct 4 - Nov 1";
    entry.year = 2009;
    entry.language = "<span class='footer'>English</span>";	
    Ttc[ Ttc.length ] = entry;  // add course entry to TTC Array
	

// TTC	vrindavan	English, Français, Deutsch, Español	Oct 10	Nov 8		1350 1550 1800 
// Start course data
    entry = new Course( vrindavan );
    entry.dates = "Oct 10 - Nov 8";
    entry.year = 2009;
    entry.language = "<span class='footer'>English, Français, Deutsch, Español</span>";	
    Ttc[ Ttc.length ] = entry;  // add course entry to TTC Array
	

// ATTC	vrindavan	English, Français, Deutsch, Español	Oct 10	Nov 8		1350 1550 1800 
// Start course data
    entry = new Course( vrindavan );
    entry.dates = "Oct 10 - Nov 8";
    entry.year = 2009;
    entry.language = "<span class='footer'>English, Français, Deutsch, Español</span>";	
    Ttc[ Ttc.length ] = entry;  // add course entry to TTC Array
	

// TTC	camp	English 	Nov 14	Dec 12		2860  3025 3575
// Start course data
    entry = new Course( camp );
    entry.dates = "Nov 14 - Dec 12";
    entry.year = 2009;
    entry.language = "<span class='footer'>English</span>";	
    Ttc[ Ttc.length ] = entry;  // add course entry to TTC Array
	

// TTC	neyyardam	English	Nov 15	Dec 13	1900	2125  2450 
// Start course data
    entry = new Course( neyyardam );
    entry.dates = "Nov 15 - Dec 13";
    entry.year = 2009;
    entry.language = "<span class='footer'>English</span>";	
    Ttc[ Ttc.length ] = entry;  // add course entry to TTC Array
	

// TTC	maduraiashram	English	Dec 6	Jan 3		1800 2000  
// Start course data
    entry = new Course( maduraiashram );
    entry.dates = "Dec 6 - Jan 3";
    entry.year = 2009;
    entry.language = "<span class='footer'>English</span>";	
    Ttc[ Ttc.length ] = entry;  // add course entry to TTC Array
	

// TTC	reith	English, Français, Deutsch, Español	Dec 19	Jan 17	2100	   
// Start course data
    entry = new Course( reith );
    entry.dates = "Dec 19 - Jan 17";
    entry.year = 2009;
    entry.language = "<span class='footer'>English, Français, Deutsch, Español</span>";	
    Ttc[ Ttc.length ] = entry;  // add course entry to TTC Array
	


    
/**
 * International Courses
 *
 *  Add or remove International courses.
 *  If adding, copy one section and edit the values.
 *  The order each section is listed here does not matter,
 *  as the courses will be sorted by date.
 *
 *  Note that Ttc contains a 'language' setting, 
 *  and that International contains a 'type' setting.
 *
 *  Please use caution that the precise code syntax is adhered to.
 */    
    
    var International = new Array();

    // copy Ttc Courses into International Courses
    // since we include TTC courses in it
    for ( course in Ttc ) {
        International[ course ] = Ttc[ course ];
    }

// the International contains the listing of all TTC courses, 
// now just add in the other courses
     	 
	 
	 

/***** 2007 *****/



//Kids Camp	camp	English, Français, Deutsch, Español	Aug 1	Aug 15	600	   
// Start course data
    entry = new Course( camp );
    entry.type = "Kids Camp International";
    entry.dates = "Aug 1 - Aug 15";
    entry.year = 2008;
    International[ International.length ] = entry;  // add course entry to International Array 


	
//Sadhana Intensive	netala	English	May 25	Jun 6		660  880 
// Start course data
    entry = new Course( netala );
    entry.type = "Valley of the Flowers Trek";
    entry.dates = "Aug 01 - Aug 07";
    entry.year = 2008;
    International[ International.length ] = entry;  // add course entry to International Array 






//Sadhana Intensive	orleans	English, Français, Deutsch, Español	Aug 9	Aug 24	950	1125  1400 1600
// Start course data
    entry = new Course( orleans );
    entry.type = "Sadhana Intensive International";
    entry.dates = "Aug 9 - Aug 24";
    entry.year = 2008;
    International[ International.length ] = entry;  // add course entry to International Array 
	




			

		
//Sadhana Intensive	netala	English	Sep 14	Sep 28		660  880 
// Start course data
    entry = new Course( netala );
    entry.type = "Sadhana Intensive English";
    entry.dates = "Sep 14 - Sep 28";
    entry.year = 2008;
    International[ International.length ] = entry;  // add course entry to International Array 

			
			
			
			
// Start course data
    entry = new Course( netala );
    entry.type = "Chardham Yatra";
    entry.dates = "Oct 10 - Oct 22";
    entry.year = 2008;
    International[ International.length ] = entry;  // add course entry to International Array 
				



// Start course data
    entry = new Course( neyyardam );
    entry.type = "Fasting Programme";
    entry.dates = "Dec 16 - Dec 30";
    entry.year = 2008;
    International[ International.length ] = entry;  // add course entry to International Array 









//////////////
//////////////
//////
////// 2009 Dates
//////



//Sadhana Intensive	maduraiashram	English	Jan 4	Jan 19		660 740  
// Start course data
    entry = new Course( maduraiashram );
    entry.type = "Sadhana Intensive English";
    entry.dates = "Jan 4 - Jan 19";
    entry.year = 2009;
    International[ International.length ] = entry;  // add course entry to International Array 
	

//Kids Camp	neyyardam	English	Apr 19	May 17		500   
// Start course data
    entry = new Course( neyyardam );
    entry.type = "Kids Camp English";
    entry.dates = "Apr 19 - May 17";
    entry.year = 2009;
    International[ International.length ] = entry;  // add course entry to International Array 
	

//Sadhana Intensive	netala	English	May 24	Jun 8		660  880 
// Start course data
    entry = new Course( netala );
    entry.type = "Sadhana Intensive English";
    entry.dates = "May 24 - Jun 8";
    entry.year = 2009;
    International[ International.length ] = entry;  // add course entry to International Array 
	

//Sadhana Intensive	camp	English	Jun 14	Jun 27	1100	   1750
// Start course data
    entry = new Course( camp );
    entry.type = "Sadhana Intensive English";
    entry.dates = "Jun 14 - Jun 27";
    entry.year = 2009;
    International[ International.length ] = entry;  // add course entry to International Array 
	

//Sadhana Intensive	netala	English	Sep 13	Sep 28		660  880 
// Start course data
    entry = new Course( netala );
    entry.type = "Sadhana Intensive English";
    entry.dates = "Sep 13 - Sep 28";
    entry.year = 2009;
    International[ International.length ] = entry;  // add course entry to International Array 
	
    
    
/**
 *  Course Generation Functions,
 *  Please do not edit this section
 */
    
     
 
function Course ( Location ) {

    if ( typeof( Location ) != "object" ) {
        this.title = "";
        this.href = "";
        this.type = "";
    } else {
        this.title = Location.name;
        this.href = Location.makeLink();
        this.type = "TTC"; // default unless over-ridden
    }
    
    this.dates = "";
    this.tentprice = "";
    this.dormprice = "";
    this.singleprice = "";
    this.doubleprice = "";
    this.language = "";
    
    return this;
}
 

function sortByDate (a,b) {
    
    var monthOrder = new Array();
    monthOrder.Jan = 0;
    monthOrder.Feb = 1;
    monthOrder.Mar = 2;
    monthOrder.Apr = 3;
    monthOrder.May = 4;
    monthOrder.Jun = 5;
    monthOrder.Jul = 6;
    monthOrder.Aug = 7;
    monthOrder.Sep = 8;
    monthOrder.Oct = 9;
    monthOrder.Nov = 10;
    monthOrder.Dec = 11;
    
    var a_arr = a.dates.split( ' - ' );
    var b_arr = b.dates.split( ' - ' );
    
    var date_a = a_arr[0].split(/\s+/);
    var month_a = date_a[0];
    var day_a = date_a[1];
    
    var date_b = b_arr[0].split(/\s+/);
    var month_b = date_b[0];
    var day_b = date_b[1];
    
    var sort_value = 0; //initialize
    
    if ( a.year == b.year ) {
        
        if ( month_a != month_b ) {
            sort_value = monthOrder[ month_a ] - monthOrder[ month_b ];
        } else {
            sort_value = parseInt( day_a ) - parseInt( day_b );
        }
    } else {
        sort_value = parseInt( a.year ) - parseInt ( b.year );
    }
    
    return sort_value;
}
    
function getCourseTable( table ) {
    
    var course_table = '';   
    var bgcolor = '#faecd0';  
    var Table = eval( table );
	var start_table = '<table>'; // initialize
    var course_title = "";
    var comma = ", ";
    var course_year = 0; // initialize
    var year_row = "";
    
    // sort the array by beginning date
    Table.sort( sortByDate );
    
	

				
 	if ( table == "Ttc" ) {
			
		start_table = (
					  	'<table cellspacing="1" cellpadding="6" border="0">'
					+		'<tr>'
					+			'<td class="row-header1" bgcolor="#6E3A06">LOCATION</td>'
					+			'<td class="row-header1" bgcolor="#6E3A06">COURSE DATES</td>'
					+			'<td class="row-header1" bgcolor="#6E3A06" colspan="4">PRICE (in US $ unless otherwise specified)</td>'
					+			'<td class="row-header1" bgcolor="#6E3A06">LANGUAGE</td>'
					+		'</tr>'
		);
	
	} else if ( table == "International" ) {
		
		start_table = (
                        '<table width="100%" cellspacing="1" cellpadding="6" border="0">'
					+		'<tr>'
					+			'<td class="row-header1" bgcolor="#6E3A06">COURSE</td>'
					+			'<td class="row-header1" bgcolor="#6E3A06">LOCATION</td>'
					+			'<td class="row-header1" bgcolor="#6E3A06">DATES</td>'
					+			'<td class="row-header1" colspan="4" bgcolor="#6E3A06">PRICE (in US $ unless otherwise specified)</td>'
					+		'</tr>'
		);
		
	}
	
	
	
	
    for ( course in Table ) {
    
        bgcolor == '#faecd0' ? bgcolor = '#ffffee' : bgcolor = '#faecd0';
        if ( course_year != Table[ course ].year ) {
            if ( course_year == 0 ) {
                
				course_year = Table[ course ].year;		
				
                if ( table == "Ttc" ) {		
					year_row = (
								'<tr>'
						+			'<td class="row-header-sm" bgcolor="#ffffee">&nbsp;</td>'
						+			'<td class="row-header-sm" bgcolor="#faecd0" align="center">' + course_year + '</td>'
						+			'<td class="row-header-sm" bgcolor="#faecd0">Tent</td>'
						+			'<td class="row-header-sm" bgcolor="#faecd0">Dorm</td>'
						+			'<td class="row-header-sm" bgcolor="#faecd0">Single</td>'
						+			'<td class="row-header-sm" bgcolor="#faecd0">Double</td>'
						+			'<td class="row-header-sm" bgcolor="#ffffee">&nbsp;</td>'
						+		'</tr>'
					);
					
                } else if ( table == "International" ) {	
					year_row = (
                            	'<tr>'
						+			'<td class="row-header-sm" bgcolor="#ffffee">&nbsp;</td>'
						+			'<td class="row-header-sm" bgcolor="#ffffee">&nbsp;</td>'
						+			'<td class="row-header-sm" bgcolor="#faecd0" align="center">' + course_year + '</td>'
						+			'<td class="row-header-sm" bgcolor="#faecd0">Tent</td>'
						+			'<td class="row-header-sm" bgcolor="#faecd0">Dorm</td>'
						+			'<td class="row-header-sm" bgcolor="#faecd0">Single</td>'
						+			'<td class="row-header-sm" bgcolor="#faecd0">Double</td>'
						+		'</tr>'
					);
				}
					
				
            } else {
                course_year = Table[ course ].year;
                
                if ( table == "Ttc" ) {
                    year_row = (
                               '<tr><td bgcolor="#ffffee"></td><td class="row-header-sm" bgcolor="#faecd0" align="center">'
                             + Table[course].year
                             + '</td><td bgcolor="#ffffee"></td><td bgcolor="#ffffee"></td><td bgcolor="#ffffee"></td><td bgcolor="#ffffee"></td><td bgcolor="#ffffee"></td></tr>'
                    );
                } else if ( table == "International" ) {
                    year_row = (
                               '<tr><td bgcolor="#ffffee"></td><td bgcolor="#ffffee"></td><td class="row-header-sm" bgcolor="#faecd0" align="center">'
                             + Table[course].year
                             + '</td><td bgcolor="#ffffee"></td><td bgcolor="#ffffee"></td><td bgcolor="#ffffee"></td><td bgcolor="#ffffee"></td></tr>'
                    );
                }
            }
        } else {
            year_row = "";
        }
        
        for ( entry in Table[ course ] ) {
            if ( Table[ course ][ entry ] == "" && entry != "language" ) {
                Table[ course ][ entry ] = " - ";
            }
        }
        
        // set properties for Ttc Courses
        if ( table == "Ttc" ) {                                           
            course_table += (
                  year_row
                + '<tr>'
                + '<td class="row-header" bgcolor="' + bgcolor + '">' + Table[ course ].href + '</td>'
                + '<td class="table-body" bgcolor="' + bgcolor + '">' + Table[ course ].dates + '</td>'
                + '<td class="table-body" bgcolor="' + bgcolor + '" align="center">' + Table[ course ].tentprice + '</td>'
                + '<td class="table-body" bgcolor="' + bgcolor + '" align="center">' + Table[ course ].dormprice + '</td>'
                + '<td class="table-body" bgcolor="' + bgcolor + '" align="center">' + Table[ course ].singleprice + '</td>'
                + '<td class="table-body" bgcolor="' + bgcolor + '" align="center">' + Table[ course ].doubleprice + '</td>'
                + '<td class="table-body" bgcolor="' + bgcolor + '">' + Table[ course ].language + '</td>'
                + '</tr>'
            );            
        }
        
        // set properties for International Courses
        if ( table == "International" ) {        
            Table[ course ].language != "" ? comma = ", " : comma = "";
            course_title = Table[ course ].type + comma + Table[ course ].language;
            
            course_table += (
                  year_row
                + '<tr>'
                + '<td class="row-header" bgcolor="' + bgcolor + '">' + course_title + '</td>'
                + '<td class="table-body" bgcolor="' + bgcolor + '">' + Table[ course ].href + '</td>'
                + '<td class="table-body" bgcolor="' + bgcolor + '">' + Table[ course ].dates + '</td>'
                + '<td class="table-body" bgcolor="' + bgcolor + '" align="center">' + Table[ course ].tentprice + '</td>'
                + '<td class="table-body" bgcolor="' + bgcolor + '" align="center">' + Table[ course ].dormprice + '</td>'
                + '<td class="table-body" bgcolor="' + bgcolor + '" align="center">' + Table[ course ].singleprice + '</td>'
                + '<td class="table-body" bgcolor="' + bgcolor + '" align="center">' + Table[ course ].doubleprice + '</td>'
                + '</tr>'
            );           
        }
    }
    
    return start_table + course_table + '</table>'
}

