var ms = new Array();

function insertCell(t,s) {
    t.insertRow(t.rows.length).insertCell(0).innerHTML = s;
}

var M = Class.create({ 
    initialize: function Master(table, m) {
        this.id = m[0];
        this.coords = m[1];
        this.name = m[2];
        this.date = m[3];
        this.text = m[4].replace("^","'");
        if (m[5] != undefined && m[5] != '') {
            if (/^http/.test(m[5]))
                this.href = m[5];
            else if (/^\d+$/.test(m[5]))
                this.href = 'http://www.kagyuoffice.org/kagyulineage.karmapa' + m[5] + '.html';              
            else if (/#/.test(m[5]))
                this.href = 'http://www.kagyuoffice.org/kagyulineage.' + m[5];
            else   
                this.href = 'http://www.kagyuoffice.org/kagyulineage.' + m[5] + '.html';
        }
        else {
            this.href = 'http://www.kagyuoffice.org';
            //console.log('No HREF for ' + this.id + '-' + this.name);
        }
        this.generation = m[6];
        this.assoc = m[7];
        this.karmapa = m[8];
        this.deity = m[9];
 
        var area = 
            '<area target="_blank" href="' + this.href + '" shape="rect" coords="' + this.coords + 
            '" title="' + this.name;
        if (this.date != '')
            area += ' (' + this.date + ')';
        area +=
            '" onmouseover="javascript:showTextForID(' + this.id + ');"' +
            '"></area>\n';
        document.write(area);
        var link = '<a href="javascript:showTextForID(' + this.id + ');">' + this.name + '</a>';        
        insertCell(table, link);
    },
        
    toString: function() {
        if (!document.treeForm.freeze.checked) {
            var info = this.name;
            if (this.date != '')
            info += ' (' + this.date + ')';
            info += '\n' + this.text;
            $('info').innerHTML = info;
            $('hrefLink').innerHTML =
                '<a target="_blank" href="' + this.href + '>' + this.name + '</a>';
        }
    }
});

function writeMap() {
    ms = new Array();
    document.write('<map name="lineage_tree">\n');
    [
        [0, '136,0,170,40', 'Tilopa', '989-1069', '"The Sesame Grinder". Tilopa received the the transmission of enlightened wisdom directly from the source of enlightenment itself, Vajradhara.', 'tilopa', ''],
        [1, '330,0,370,40', 'Naropa', '1016-1100', 'The great mahasiddha of India, chief disciple of Tilopa and the guru of Marpa in the Kagy&uuml; Lineage.', 'naropa', ''],
        [2, '66,0,105,35', 'Padmasambhava', 'ca 700^', '"Lotus-born", "Guru Rinpoche". Fully enlightened master who established the teachings in Tibet in the eighth century.', 'http://www.rangjung.com/authors/padmasambhava.htm', ''],
        [3, '26,0,65,35', 'Atisha', '983-1054', 'Indian pandita from Vikramashila who spent the last twelve years of his life in Tibet.', 'http://en.wikipedia.org/wiki/Atisha', ''],
        [4, '0,0,25,35', 'Phagmo Drupa', '1110 - 1170', 'Founder of the Padma Kagyus. His disciples founded eight lineages, of which three still exist.', 'http://www.drukpa.org/eng/lineage/phagdru.htm', ''],
        [5, '38,35,70,80', 'Barom Tarma Wangchuk', 'ca 1100', 'Close disciple of Gampopa; originator of Barom Kagyu, one of the four great schools of the Kagyu.', 'http://rywiki.tsadra.org/index.php/Barom_Darma_Wangchuk', ''],
        [6, '0,35,25,70', 'Tsondru Trakpa', '1123-1194', 'More commonly known as Guru Shang; founder of Tsalpa Kagyu, and a disciple of, among others, Takpo Gomtsul, Gampopa^s nephew.', 'http://en.wikipedia.org/wiki/Gampopa', ''],
        [7, '0,75,35,125', 'Machik Lapdronma', '1055-1149 1031 - 1124', 'Yidam and historical figure - the founder of Ch&ouml;d.', 'http://www.sakyadhita.org/deities.html#Machig', ''],
        [8, '400,0,430,40', 'Dakini Sukhasiddhi', '', 'One of Tilopa^s teachers who taught him ejection of consciousness (phowa).', 'http://members.tripod.com/~Lhamo/9deity.htm#Sukkhasiddhi', ''],
        [9, '431,0,465,40', 'Niguma', '', 'Naropa^s consort and a famous teacher of her own system of the six yogas.', 'http://members.tripod.com/~Lhamo/9deity.htm#Niguma', ''],
        [10, '472,0,505,40', 'Khyungpo Naljor', '978-1079?', 'A siddha who first introduced the six yogas of Niguma to Tibet and who founded the Shangpa Kagyu.', 'http://rywiki.tsadra.org/index.php/Khyungpo_Naljor', ''],
        [11, '431,41,470,80', 'Kunkhyen Tolpopa Sherap Gyaltsen', '1292-1361', 'Founder of the Jonangpa school which mainly emphasized the Kalachakra tantra and the teaching of Tathagatagarbha as well as the Shentong view of Madhyamika.', 'http://jonangfoundation.org/tradition/masters.shtml', ''],
        [12, '472,41,505,80', 'Sakyapa Kunga Nyingpo', '1092-1158', 'Son of Khon Konchok Gyalpo, founder of Sakya Lineage; became lineage holder as well as a great scholar and siddha.', 'http://www.palsakya.org/articles/bio_skn1.html', ''],
        [13, '472,81,505,125', 'Jamgon Khyentse Wangpo', '1820-1892', 'The first or great Khyentse; one of the leaders of the 19th century Rime movement; was root guru of Jamgon Kongtrul Lodro Thaye.', 'http://www.lotsawahouse.org/id18.html', ''],
        [14, '176,208,330,365', 'Vajradhara', '', '(Tibetan: Dorje Chang). The primordial buddha, the dharmakaya buddha, and source of the Kagyu lineage. Depicted as dark blue in color, expresses the quintessence of buddhahood itself.', 'vajradhara', ''],
        [15, '236,0,270,36', 'Vajradhara', '', '(Tibetan: Dorje Chang). The primordial buddha, the dharmakaya buddha. Depicted as dark blue in color, expresses the quintessence of buddhahood itself.', 'vajradhara', ''],
        [16, '236,37,270,66', 'Ratnamati (Lodr&ouml; Rinchen)', '', ' A bodhisattva who transmitted from Vajradhara to Saraha the Arrow-maker.', 'http://www.samye.org/ratnamat.htm', ''],
        [17, '187,26,222,66', 'Saraha', '', '(Tibetan: mDa-snun). "The Arrow Shooter". Mahasiddha who wrote three famous cycles of Dohas on mahamudra.', 'http://www.dharmafellowship.org/biographies/historicalsaints/saraha.htm', ''],
        [18, '290,28,318,59', 'Nagarjuna', '', '(Tibetan: klu grub). An Indian master of philosophy at Nalanda university, master of Mahayana, and a tantric siddha.', 'http://en.wikipedia.org/wiki/Nagarjuna', ''],
        [19, '187,67,222,104', 'Shawaripa', '', 'Mahasiddha, disciple of Saraha, who introduced the practice of Vajrayogini into the Kagyu lineage.', 'http://www.simhas.org/kl3.html', ''],
        [20, '290,60,318,99', 'Maitripa', '', 'Mahasiddha, who was Marpa^ second main teacher.', 'http://www.samyeling.org/Buddhism/Tibetan_Buddhism/maitripa.htm#maitripa', ''],
        [21, '236,67,270,103', 'Marpa', '1012-1097', 'Marpa travelled to India from Tibet at great personal peril across the Himalayas to study with his principal teachers, Naropa and Maitripa.', 'marpa', ''],
        [22, '236,104,270,137', 'Milarepa', '1040-1123', 'The chief disciple of Marpa. The most renowned and accomplished of Tibet^s tantric yogis, who achieved enlightenment in one lifetime.', 'milarepa', ''],
        [23, '236,138,272,166', 'Gampopa', '1079-1153', 'Unified Milarepa^s Mahamudra lineage with the stages of the path tradition of the Kadampa lineage.', 'gampopa', ''],
        [24, '236,167,272,207', 'D&uuml;sum Khyenpa, Karmapa I', '1110-1193', 'The first Karmapa made predictions about future hrefs. In particular, he was the first Karmapa to present a prediction letter, detailing his future incarnation.', '1', ''],
        [25, '187,105,222,141', 'Drog&ouml;n Rechen', '1148-1218', 'Starting with the "great cotton-clad yogi", the relationship between the hrefs and Tai Situpa have been without any interruption.', 'karmapa1.html#DrogonRechen', ''],
        [26, '290,100,318,140', 'Pomdrakpa', '1170-1249', 'The first href^s principal disciple, who passed on the lineage transmission to the Second href.', 'karmapa1.html#Pomdrakpa', ''],
        [27, '187,142,222,182', 'Karma Pakshi, Karmapa II', '1204-1283', 'The second Karmapa spent much of the first half of his life in meditation retreat. He is famous for having introduced the melodious chanting of the Om Mani Padme Hung, the mantra of compassion, to the Tibetan people.', '2', ''],
        [28, '285,141,323,180', 'Orgyenpa', '1230-1312', 'A famous disciple of G&ouml;tsangpa Gonpo Dorje and Karma Pakshi, the second href.', 'karmapa2.html#Orgyenpa', ''],
        [29, '187,183,228,222', 'Rangjung Dorje, Karmapa III', '1284-1339', 'The third Karmapa learned and mastered nearly all of the Buddhist teachings brought to Tibet from India.', '3', ''],
        [30, '285,181,320,220', 'Gyalwa Yungt&ouml;npa', '1296-1376', 'Disciple of the third Karmapa and teacher of the fourth.', 'karmapa3.html#GyalwaYungtonpa', ''],
        [31, '138,110,172,152', 'Rolpe Dorje, Karmapa IV', '1340-1383', 'The third Karmapa composed many wonderful dohas, or songs of realization.', '4', ''],
        [32, '337,80,362,152', 'Khach&ouml; Wangpo, Shamarpa II', '1350-1405', 'Disciple of the fourth disciple; enthroned the fifth.', 'karmapa4.html#KachoWangpo', ''],
        [33, '138,153,172,192', 'Deshin Shekpa, Karmapa V', '1384-1415', 'The Fifth Karmapa is said to have manifested 100 days of miracles in response to the extraordinary devotion of the Emperor of China.', '5', ''],
        [34, '337,153,362,196', 'Rikpe Raldri, Shamarpa III (1406-1452)', 'Ratnabhadra, Chopal Yeshe 1406-1452', 'Disciple of the fifth Karmapa and teacher of the sixth.', 'karmapa5.html#Ratnabhadra', ''],
        [35, '138,193,172,234', 'Thongwa D&ouml;nden, Karmapa VI', '1416-1453', 'The Sixth Karmapa is well-known for the body of liturgies he composed for the Kamtsang lineage, and for joining Ch&ouml;d ("cutting through egotism") into the main Kagyu lineage transmissions.', '6', ''],
        [36, '331,197,364,232', 'Jampal Zangpo', 'Pengar Kukhyen 15th - 16th century', 'Disciple of the sixth Karmapa and principal teacher of the seventh.', 'karmapa6.html#BengarJampalSangpo', ''],
        [37, '138,235,174,278', 'Goshir Paljor Dh&ouml;ndrup, Gyaltsap I', '1427-1489', 'Disciple of the sixth Karmapa and teacher of the seventh.', 'karmapa6.html#GoshirPaljorDhondrup', ''],
        [38, '331,233,364,277', 'Ch&ouml;drak Gyatso, Karmapa VII', '1454-1506', 'The seventh Karmapa dedicated much of his life to retreat, and is known for his text The Ocean Of Reasoning.', '7', ''],
        [39, '94,160,127,202', 'Sangye Nyenpa Tashi Paljor', '1457 - 1525', 'Disciple of the seventh Karmapa and principal teacher of the eighth.', 'karmapa7.html#TashiPaljor', ''],
        [40, '387,153,414,198', 'Miky&ouml; Dorje (Ch&ouml;drak Palzang), Karmapa VIII', '1507-1554', 'The Eighth Karmapa realized the activity of the hrefs and Guru Rinpoche as the activity-aspect of all thousand Buddhas of our universe.', '8', ''],
        [41, '92,203,127,242', 'K&ouml;nchok Yenlak, Shamarpa V', '1526-1583', 'Disciple of the eighth Karmapa and principal teacher of the ninth.', 'karmapa8.html#KonchokYenlak', ''],
        [42, '387,199,416,237', 'Wangchuk Dorje, Karmapa IX', '1556-1603', 'The Ninth Karmapa wrote three mahamudra treatises which have played a major role on the teaching and transmission of mahamudra.', '9', ''],
        [43, '43,203,77,251', 'Ch&ouml;kyi Wangchuk, Shamarpa VI', '1584-1629', 'Disciple of the ninth Karmapa and principal teacher of the tenth.', 'karmapa9.html#ChokyiWangchuk', ''],
        [44, '433,199,464,242', 'Ch&ouml;ying Dorje, Karmapa X', '1604-1674', 'The Tenth Karmapa anticipated the disturbances in central Tibet and traveled, living more than three years in the wilds of Bhutan, and then going to what is today northern Yunnan, Burma and Nepal.', '10', ''],
        [45, '92,243,127,284', 'Yeshe Nyingpo, Shamarpa VII', '1631-1694', 'Disciple of the tenth Karmapa and principal teacher of the eleventh.', 'karmapa10.html#YesheNyingpo', ''],
        [46, '384,238,416,272', 'Yeshe Dorje, Karmapa XI', '1676-1702', 'The Eleventh Karmapa blended both the Kagyu and Nyingma teachings.', '11', ''],
        [47, '138,279,174,320', 'Palchen Ch&ouml;kyi Dondrup (Dhonnyi Lhundrup), Shamarpa VIII', '1695-1732', 'Disciple of the eleventh Karmapa and principal teacher of the twelfth.', 'karmapa11.html#PalchenChokyiDhondrup', ''],
        [48, '331,278,364,319', 'Changchub Dorje, Karmapa XII', '1703-1732', 'The Twelfth Karmapa made pilgrimage to the sacred places of the Buddha in India and Nepal.', '12', ''],
        [49, '43,252,75,298', 'Ch&ouml;kyi Jungney (Tenpay Nyinje), Situ VIII', '1700-1774', 'Disciple of the twelfth Karmapa and teacher of the thirteenth.', 'karmapa12.html#ChokyiJungney', ''],
        [50, '433,243,464,285', 'Dudul Dorje, Karmapa XIII', '1733-1797', 'The thirteenth Karmapa consecrated a distant monastery by throwing blessing grains in the air which showered down from the heavens at the monastery hundreds of kilometres away.', '13', ''],
        [51, '92,285,127,320', 'Mipham Ch&ouml;drup Gyatso, Shamarpa X', '1742-1793', 'Studied many years with Situ Ch&ouml;kyi Jungney; was a great scholar and meditation master.', 'karmapa13.html#MiphamChodrupGyatso', ''],
        [52, '384,273,416,310', 'Pema Nyinje Wangpo, Situ IX', '1774-1853', 'Disciple of the thirteenth Karmapa and principal teacher of the fourteenth.', 'karmapa13.html#PemaNyinjeWangpo', ''],
        [53, '43,299,75,347', 'Thekchok Dorje, Karmapa XIV', '1798-1868', 'The Fourteenth Karmapa lived very simply and exemplified the ideal monk.', '14', ''],
        [54, '433,286,466,334', 'Lodr&ouml; Thaye, Jamgon Kongtrul I (Yonton Gyatso)', '1813-1899', 'Disciple of the fourteenth Karmapa and principal teacher of the fifteenth. Co-founded the non-sectarian Rime movement.', 'karmapa14.html#LodroThaye', ''],
        [55, '92,321,125,360', 'Khakhyap Dorje, Karmapa XV', '1871-1922', 'The fifteenth Karmapa was the first Karmapa to get married, and had three sons, one of whom was recognized as the second Jamgon Kongtrul Palden Khyentse Öser. His life exemplified the bodhisattva with an insatiable desire for learning in order to help sentient beings.', '15', ''],
        [56, '384,311,416,354', 'Pema Wangchok Gyalpo, Situ XI', '1886-1953', 'Studied with Jamgon Kongtrul Lodr&ouml; Thaye and the fifteenth href, teacher of the sixteenth.', 'karmapa15.html#PemaWangchokGyalpo', ''],
        [57, '138,321,174,363', 'Palden Khyentse Öser, Jamgon Kongtrul II', '1904-1953', 'Second incarnation of Jamgon Kongtrul Lodr&ouml; Thaye, studied with the fifteenth href, teacher of the sixteenth.', 'karmapa15.html#PaldenKhyentseOser', ''],
        [58, '331,320,364,374', 'Rangjung Rikpe Dorje, Karmapa XVI', '1923-1981', 'The Sixteenth Karmapa oversaw the establishment of his exile seat in Rumtek, and visited North America and Europe.', '16', ''],
        [59, '224,400,290,483', 'Chakrasamvara', '', '(Tibetan: Khorlo Demchog). Principal meditation deity of the Chakrasamvara cycle of tantras.', 'http://www.khandro.net/deity_Chakrasamvara.htm', ''],
        [60, '147,425,196,481', 'Gyalwa Gyatso', '', 'A red, four-armed form of Chenrezig.', 'http://www.lamayeshe.com/otherteachers/hhdl/gyalwa_gyatso.shtml', ''],
        [61, '320,425,360,476', 'Guhyasamaja', '', 'Literally, "Assembly of Secrets." One of the major tantras and yidams of the New School.', 'http://www.geocities.com/lena_liu2000/guhyasamaja.htm', ''],
        [62, '139,482,196,548', 'Hayagriva', '', '(Tibetan: rta mgrin). One of the Great Protectors. Wrathful aspect of Amitabha.', 'http://en.wikipedia.org/wiki/Hayagriva#Buddhism', ''],
        [63, '200,484,254,554', 'Mahamaya', '', 'Yidam of Highest Yoga Tantra. Shares her name with mother of Prince Gautama, who became Shakaymuni Buddha.', 'http://members.tripod.com/~Lhamo/9deity.htm#Mahamaya', ''],
        [64, '255,484,309,554', 'Hevajra', '', 'A deity of lightning (vajra) considered to represent the eternal. In Tantric Buddhism, the fearful aspect of Vajrasattva.', 'http://rywiki.tsadra.org/index.php/Hevajra', ''],
        [65, '310,480,365,548', 'Vajravarahi', '', '(Tibetan:Dorje Naljorma, Adamantine Female Practitioner). principal female yidam of Highest Yoga Tantra of the New Translation schools of Tibetan Buddhism.', 'http://www.sakyadhita.org/deities.html#Vajra', ''],
        [66, '0,400,140,505', 'Buddhas', '', 'Sakyamuni is in the center, surrounded by the buddhas of the ten directions and the three times (the 1,022 Buddhas of the good kalpas).', 'http://www.kagyuoffice.org/buddhism.lifeofthebuddha.html', ''],
        [67, '415,422,460,478', 'Avalokitesvara', '', '(Tibetan: Chenrezig). Emanated from the eye of Buddha Amitabha when he was moved to tears by the plight of sentient beings. An embodiment of compassion. The famous 6-syllable mantra of Chenrezi: Om mani padme hum.', 'http://www.khandro.net/deities_bodhisattvas.htm', ''],
        [68, '374,461,400,502', 'Samantabhadra', '', '(Tibetan: Kuntuzangpo), "All Good." The primordial Buddha associated with original wisdom and compassion.', 'http://en.wikipedia.org/wiki/Samantabhadra', ''],
        [69, '387,426,414,460', 'Sarva-nivarana-viskambhin', '', 'Guide-to-Liberation-Obstacle-clearer (Tibetan: Dripa Namsal), is usually invoked to clear the way. Nivarana means hindrances and refers to the 5 kleshas.', 'http://www.khandro.net/deities_bodhisattvas.htm', ''],
        [70, '397,385,425,420', 'Maitreya', '', 'From maitri, loving-kindness. Tibetan: Jampa. The Buddha To Come, prophesied to be the Teacher of the next age. He resides in Ganden (S. Tushita) a heavenly paradise until his incarnation.', 'http://en.wikipedia.org/wiki/Maitreya', ''],
        [71, '426,378,454,419', 'Akasagarbha', '', '(Tibetean: Namkai Nyingpo) or "Matrix of Space". His wisdom is boundless as space.', 'http://en.wikipedia.org/wiki/Akasagarbha', ''],
        [72, '455,392,475,420', 'Ksitigarbha', '', '(Tib. Sai.nyingpo) Earth-store or Great Vow deity. He is said to be the god of death, Yama himself, who vowed to work on behalf of sentient beings until all the different hells are emptied.', 'http://en.wikipedia.org/wiki/Ksitigarbha', ''],
        [73, '461,421,496,460', 'Vajrapani', '', 'A wrathful Bodhisattva. Vajrapani embodies skillful means. The tantric aspect of the enlightened mind, transforming the energy of negative emotion into active wisdom and perfection. He symbolizes the indestructible vajra mind of a Buddha.', 'http://en.wikipedia.org/wiki/Vajrapani', ''],
        [74, '470,461,500,502', 'Manjusri', '', '"He who is noble and gentle." The Bodhisattva of Transcendent Wisdom.', 'http://en.wikipedia.org/wiki/Manjusri', ''],
        [75, '452,486,479,528', 'Maudgalyayana', '', 'One of the Buddha^s two chief disciples, said to excel in attainments.', 'http://en.wikipedia.org/wiki/Maudgalyayana', ''],
        [76, '426,479,451,525', 'Ananda', '', 'The Buddha^s cousin and personal attendant, who recited the Sutras at the First Council and served as the second patriarch in the oral transmission of Dharma.', 'http://en.wikipedia.org/wiki/Ananda', ''],
        [77, '400,486,425,528', 'Shariputra', '', 'One of the ten great disciples and right hand attendant to Shakyamuni Buddha, renowned for his deep wisdom.', 'http://en.wikipedia.org/wiki/Shariputra', ''],
        [78, '0,506,24,558', 'Vaishramana', '', 'Lord of wealth.', '', ''],
        [79, '25,519,50,558', 'Kharnak', '', 'a naga king', '', ''],
        [80, '51,532,87,575', 'Sringon', '', '', '', ''],
        [81, '88,533,135,588', 'Shing Kyong', '', 'Protector of Dewachen, the pure realm of the buddha Amitabha.', 'http://rywiki.tsadra.org/index.php/Shing_Kyong_Kunga_Zhonnu', ''],
        [82, '136,549,177,605', 'Vajrasadhu', '', '', '', ''],
        [83, '178,558,222,610', 'Six-armed Mahakala', '', 'An emanation of Chenrezig (Skt. Avalokitesvara), Mahakala is the wrathful deity that destroys mind chatter and brings our minds back into attentive focus.', 'http://www.khandro.net/deity_Mahakala.htm', ''],
        [84, '223,558,275,610', 'Dorje Bernachen', '', '"The black cloaked one," he is the main protector of the Karma Kagyu lineage.', 'http://rywiki.tsadra.org/index.php/Dorje_Bernagchen', ''],
        [85, '276,558,320,610', 'Four-armed Mahakala', '', 'An emanation of Chenrezig (Skt. Avalokitesvara), Mahakala is the wrathful deity that destroys mind chatter and brings our minds back into attentive focus.', 'http://www.khandro.net/deity_Mahakala.htm', ''],
        [86, '321,558,360,610', 'Rangjung Gyalmo', '', '(Tibetan: rang byung rgyal mo). A mahakali, consort of Bernachen), the central mahakala of the Karma Kagyu.', 'http://rywiki.tsadra.org/index.php/R', ''],
        [87, '361,558,400,607', 'Ekajati', '', '"One Plait". Dharma protector - protectress of mantras; also a Yidam: wrathful Black Tara', 'http://members.tripod.com/~Lhamo/9deity.htm#Ekajati1', ''],
        [88, '401,545,440,606', 'Drakpa Tsen', '', '', '', ''],
        [89, '441,534,475,602', 'Tseringma', '', 'A female mountain deity who bestows long life.', 'http://www.sakyadhita.org/deities.html#Tseringma', ''],
        [90, '476,526,515,568', 'Achi Udronma', '', 'Dharma protector of the Drikung Kagyu tradition.', 'http://members.tripod.com/~Lhamo/9deity.htm#Achi', ''],         
].each(function(m) {ms.push(new M($('masterListTable'), m))});
    
    document.write('</map>\n');
    
    [
        15, 16, 17, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
        31, 32, 33, 35, 36, 37, 38, 39, 40, 42, 44, 45, 46, 48,
        47, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58
    ].each(function (id) {
        insertCell($('guruYogaListTable'),
            (/^\d+$/.test(id))
                ? '<a href="javascript:showTextForID(' + id + ');">' + ms[id].name + '</a>'
                : id);
        //if (!/^\d+$/.test(id)) console.log('No id for ' + id);
    });
}

function showTextForID(id) {
    ms[id].toString();
}

function showHide(id, linkID, title) {
    var visibility =  ($(id).style.visibility == 'visible' ? 'hidden' : 'visible');
    $(id).style.visibility = visibility;
    $(linkID).innerHTML =
        (visibility == 'visible')
            ? 'Hide ' + title.charAt(0).toLowerCase() + title.substr(1)
            : title;
}

function showHideMasterList() {
    showHide('masterList','masterListLink','List of the Karma Kagyu Lineage');
}

function showHideGuruYogaList() {
    showHide('guruYogaList','guruListLink','List of gurus in Ng&ouml;ndro Guru Yoga');
}

function showHideLineageTreeLinks() {
    showHide('lineageTreeLinks','lineageTreeLink','Links');
}
