﻿titleToUse = "Chinese Flashcards";

_cardSides =
[["Pīnyīn","pinyinQuestion","pinyinAnswer"],
 ["漢字","characterQuestion","characterAnswer"],
 ["English","englishQuestion","englishAnswer"]];

function ChineseCardDescription(cardSides)
{
	this.prototype = new CardDescription();
	this.cardSides = cardSides;
}

ChineseCardDescription.prototype.getNumberOfSides = function()
	{
		return this.cardSides.length;
	}

ChineseCardDescription.prototype.getSideDesc = function(i)
	{
		return this.cardSides[i][0];
	}

ChineseCardDescription.prototype.getSideQuestionStyle = function(i)
	{
		return this.cardSides[i][1];
	}

ChineseCardDescription.prototype.getSideAnswerStyle = function(i)
	{
		return this.cardSides[i][2];
	}


cards_lesson1 = [["nǐ","你","you"],["hǎo","好","good, well"]];
cards_lesson2 = [["ma","嗎","yes/no question end"],["wǒ","我","I, me"],["hěn","很","very"],["ne","呢","'And you?' type question"],["yě","也","also,too"]];
cards_lesson3 = [["máng","忙","busy"],["bù","不","not,no"],["gēge","哥哥","elder brother"],["tā (m.)","他","he, him"],["dìdi","弟弟","younger brother"],["tāmen","他們","they"],["dōu","都","all"]];
cards_lesson4 = [["zhè","這","this"],["shì","是","to be"],["bàba","爸爸","father"],["māma","媽媽","mother"],["péngyǒu","朋友","friend"],["nǐmen","你們","you (plural)"]];
cards_lesson5 = [["dàifu","大夫","doctor"],["de","的","possession particle"],["chē","車","car"],["nà","那","that"],["tā (f.)","她","she, her"],["shū","書","book"]];
cards_lesson5_supl = [["bào","報","newspaper"],["zhǐ","纸","paper"],["chǐ","呎","ruler"],["bǐ","筆","pen, pencil, writing brush"]];
cards_lesson6 = [["nǎ","哪","which"],["guó","國","country"],["rén","人","person"],["shéi","誰","who"],["wǒmen","我們","we, us"],["laǒshī","老師","teacher"],["Hànyǔ","漢語","Chinese (language)"],["Zhōngguó","中國","China"],["Déguó","德國","Germany"],["Fǎguó","法國","France"],["Měiguó","美國","USA"],["Rìběn","日本","Japan"]];
cards_lesson7 = [["shénme","甚麼","what"],["dì","地","earth"],["tú","圖","drawing"],["dìtú","地圖","map"]];
cards_lesson7_supl = [["Běijīng","北京","Beijing"],["Shànghǎi","上海","Shanghai"],["Cháng Jiāng","長江","Yangtze River"],["Huáng Hé","黃河","Yellow River"],["Chángchéng","長城","The Great Wall"],["shìjiè","世界","world"],["Oū Zhōu","歐洲","Europe"],["Fēi Zhōu","非洲","Africa"],["Dàyáng Zhōu","大洋洲","Oceania"],["Nán Měi Zhōu","南美洲","South America"]];
cards_lesson8 = [["qǐng","請","please"],["hē","喝","to drink"],["chá","茶","tea"],["nín","您","polite form of 'you'"],["jìn","進","to enter, to come in"],["huānyíng","歡迎","to welcome"],["xièxie","謝謝","to thank"],["kèqi","客氣","polite, courteous"],["xī yān","吸煙","to smoke"]];
cards_lesson8_supl = [["kāfēi","咖啡","coffee"],["píjiǔ","啤酒","beer"],["niúnǎi","牛奶","milk"],["xiānsheng","先生","Mr., sir, gentleman"],["tàitai","太太","Mrs., madame"]];
cards_lesson9 = [["guì xìng","貴姓","honourable name"],["qǐngwèn","請問","May I ask...?"],["wèn","問","to ask"],["liúxuéshēng","留學生","a foreign student"],["xìng","姓","(one's) surname is..., surname"],["jiào","叫","to call, to be called"],["wàiyǔ","外語","foreign language"],["xuéyuàn","學院","college"],["yuàn","院","yard"],["xuésheng","學生","student"],["xuéxí","學習","to study, to learn"]];
cards_lesson9_supl = [["xiǎojiě","小姐","Miss (lady)"],["nǚshì","女士","Ms., polite form of address"],["tóngzhì","統治","comrade"],["Cháoxiǎn","朝鮮","Korea"],["Yīnggúo","英國","Britain"]];
cards_lesson10 = [["zài","在","to be at (a place), in, at"],["zuò","坐","to sit, take a seat"],["nǎr","哪兒","where"],["sùshè","宿舍","dormitory"],["zhù","住","to live"],["duōshao","多少","how many, how much, what"],["hào","號","number"],["sì","四","four"],["céng","層","(a measure word) story, floor"],["èr","二","two"],["sān","三","three"],["líng","零","zero"],["yī","一","one"],["wǔ","五","five"]];
cards_lesson10_supl = [["yīyuàn","醫院","hospital"],["cèsuó","廁所","toilet"],["zhèr","這兒","here"],["nàr","那兒","there"]];
cards_lesson11 = [["huán","還","to return"],["huàbào","畫報","pictorial"],["cídiǎn","詞典","dictionary"],["xiànzài","現在","now, nowadays"],["yòng","用","to use, to make use of"],["yíxiàr","一下兒","a little while"],["zàijiàn","再見","to say good-bye"],["liù","六","six"],["qī","七","seven"],["bā","八","eight"],["jiǔ","九","nine"],["shí","十","ten"]]
cards_lesson11_supl = [["zázhì","雜誌","magazine"],["diànhuà","電話","telephone, telephone call"],["běnzi","本子","notebook"],["yǔsǎn","雨傘","umbrella"]]			
cards_lesson12 = [["nǚ","女","female*"],["xiān","先","first"],["xiānsheng","先生","Mister"],["rènshi","認識","to know (a person)"],["Yīngyu","英語","English (language)"],["Fǎyu","法語","French (language)"],["cháng","常","often"],["qù","去","go"]];
cards_lesson13 = [["míngzi","名字","name"],["wèi","喂","an interjection, hello"],["à","啊","an interjection, oh"],["shāngdiàn","商店","shop"],["mǎi","買","to buy"],["bǐ","筆","pen"],["zhǐ","纸","paper"],["lái","來","to come"],["jièshào","介紹","to introduce"],["nán","男","male (adj.)"],["duì","對","correct"],["le","了","modal particle; indicates change of state"],["hé","和","and, with"],["shuō","說","to speak, to say"],["Yīngguó","英國","Britain"],["Fǎguo","法國","France"],["běnzi","本子","notebook"],["yóujú","郵局","post office"],["yóupiào","郵票","stamp"],["jiàoshòu","教授","professor"]];
cards_lesson13_supl = [["Gǔbō","古波","a personal name (Gubo)"],["Zhōngguó","中國","China"],["Pàlánkǎ","怕蘭卡","a personal name (Palanka)"],["Dīng Yún","丁雲","a personal name (Ding Yun)"]];
cards_lesson14 = [["zuò","作","to do"],["gōngzuò","工作","to work, work"],["xiǎng","想","to want, to think, to miss"],["jiā","家","family, home, house"],["xiǎngjiā","想家","to be homesick"],["yǒu","有","to have, there be"],["méi","沒","not, no"],["méiyǒu","沒有","to not have"],["mèimei","妹妹","younger sister"],["jiějie","姐姐","older sister"],["yínháng","銀行","bank"],["àiren","愛人","husband/wife"],["shūdiàn","書店","bookstore"],["háizi","孩子","child"],["gěi","給","to, for, to give"],["xiě","寫","to write"],["xìn","信","letter"],["gàosu","告訴","to tell"]];
cards_lesson14_supl = [["zhíyuán","職員","office worker, staff member"],["gōngchéngshī","工程師","engineer"],["jīnglǐ","經理","manager, director"],["gōngsī","公司","company (place of business)"]];
cards_lesson15 = [["Zhōngwén","中文","Chinese (language); spoken Chinese (Taiwan)"],["xì","系","department"],["gè","個","a measure word"],["jǐ","幾","how many, how much, several"],["jiāo","教","to teach"],["yǔfǎ","語法","grammar"],["Hànzì","漢字","Chinese character"],["zì","字","character"],["hái","還","else, in addition, still"],["kǒuyǔ","口語","spoken language"],["bù gǎndāng","不敢當","I don't really deserve it; you flatter me"],["hùxiāng","互相","each other, mutually"],["xīn","新","new"],["yuèlǎnshì","閱覽室","reading room"],["zázhì","雜誌","magazine"],["bào","報","newspaper"],["běn","本","a measure word"],["tùshūguǎn","圖書館","library"],["nàr","那兒","there"]];
cards_lesson15_supl = [["bān","班","class, squad"],["jiàoshì","教室","classroom"],["shíyànshì","實驗室","laboratory"],["jiè","借","to borrow, to lend"],["shēngcí","生詞","new word"]];
cards_lesson16 = [["tiáo","條","a measure word (lower body garments)"],["qúnzi","裙子","skirt"],["liǎng","兩","two (with measure word)"],["zhāng","張","a measure word (paper), piece"],["piào","票","ticket"],["jīngjù","京劇","Beijing opera"],["wǎnshang","晚上","evening"],["tài","太","too, too much"],["cóng","從","from"],["zhǎo","找","to look for, to call on (a person)"],["zhèr","這兒","here"],["jiù","舊","old"],["chuān","穿","to put on, to wear"],["jiàn","件","a measure word (upper body garment)"],["chènshān","襯衫","shirt, blouse"],["lǜ","綠","green"],["dà","大","big"],["bái","白","white"],["wǎn","晚","late"],["jù","劇","drama"],["jīng","京","capital*"],["shàng","上","top*"]];
cards_lesson16_supl = [["lán","籃","blue"],["shàngyī","上衣","upper outer garment, jacket"],["kùzi","褲子","trousers"],["dàyī","大衣","overcoat, topcoat"],["hēi","黑","black, dark"],["jùchǎng","劇場","theatre"],["zuòwèi","座位","seat"]];
cards_lesson17 = [["diǎn","點","o'clock, a measure word"],["shítáng","食堂","dining hall"],["chà","差","to lack, to be short of"],["fēn","分","minute, a measure word"],["kè (measure)","刻","quarter (of an hour), a measure word"],["shàng(kè)","上課","to attend (a class), to teach (in a class)"],["kè","課","class, lesson"],["xià(kè)","下課","class is over/dismissed"],["yǐhòu","以後","later on, in the future"],["shìr","事兒","business, thing"],["huí","回","to return, to go back to"],["gēn","跟","with, to follow, to accompany"],["yìqǐ","一起","together"],["diànyǐng","電影","film, movie"],["kāfēiguǎn","咖啡館","café"],["kāfēi","咖啡","coffee"],["bàn","半","half"],["a","啊","a modal particle (a)"],["děng","等","to wait"],["zǒu","走","to depart, to walk"]];
cards_lesson17_supl = [["shàng bān","上班","to go to work, to start working"],["xià bān","下班","to come or go off work"],["diànyǐngyuàn","電影院","movie theater"],["biǎo","錶","watch"],["zhōng","鐘","clock"],["yǐqián","以前","before, in the past, ago"]];
cards_lesson18 = [["tiān","天","day"],["měi","每","every, each"],["měitiān","每天","every day"],["qǐ chuáng","起床","to get (wake) up"],["qǐ","起","to get up, to rise"],["chuáng","床","bed"],["shàngwǔ","上午","morning"],["chī","吃","to eat"],["fàn","飯","meal, cooked rice, food"],["duō","多","many, much"],["xiàwǔ","下午","afternoon"],["xiūxi","休息","to rest, to take a rest"],["yǒu shíhou","有時候","sometimes"],["shíhou","時候","time"],["wèntí","問題","question, problem"],["shuì jiào","睡覺","to go to bed, to sleep"],["péngyoumen","朋友們","friends"],["Běijīng","北京","Beijing"]];
cards_lesson19 = [["yào","要","to want, to be going to, must"],["fúwùyuán","服務員","waiter, waitress, attendant"],["bēi","杯","a measure word (cup)"],["xiǎojiě","小姐","miss, young lady"],["xǐhuān","喜歡","to like, to be fond of"],["huāchá","花茶","jasmine tea"],["hóngchá","红茶","black tea"],["hóng","红","red"],["háishì","還是","or"],["júzishuǐ","橘子水","orange juice"],["júzi","橘子","orange (fruit)"],["shuǐ","水","water"],["píng","甁","a measure word (bottle)"],["píjiǔ","啤酒","beer"],["tīng","聽","to listen"],["míngē","民歌","folk song"],["gǔdiǎn","古典","classical"],["yīnyuè","音樂","music"],["xiàndài","現代","modern"],["chàng","唱","to sing"],["gēr","哥兒","song"],["ràng","讓","to let, to ask"],["bié","別","don't"]];
cards_lesson19_supl = [["zhī","枝","a measure word (branch)"],["píngguǒ","蘋果","apple"],["xiāngjiāo","香蕉","banana"],["pútao","葡萄","grape"],["chàngpiàn","唱片","phonograph record"],["táng","糖","sugar, sweets, candy"],["lǜchá","綠茶","green tea"]];
cards_lesson20 = [["yuè","月","month"],["rì","日","date, day of the month"],["shēngri","生日","birthday"],["jīntiān","今天","today"],["bān","班","class"],["fǔdǎo","輔導","to tutor"],["hào","號","date, day of the month"],["kòngr","空兒","spare time, free time"],["jīnnián","今年","this year"],["suì","歲","a measure word, year/age"],["zhùhè","祝賀","to congratulate, congratulations"],["wǔhuì","舞會","dance, ball"],["cānjiā","參加","to take part in, to attend"],["tóngxué","同學","classmate, schoolmate"],["yídìng","一定","surely, certainly, certain, given, particular"],["yǒu yìsi","有意思","interesting, fun"],["xīngqí","星期","week"],["xīngqírì","星期日","Sunday"],["zhīdao","知道","to know"],["dìzhǐ","地址","address"],["nián","年","year"]];
cards_lesson20_supl = [["qùnián","去年","last year"],["míngnían","明年","next year"],["yīnyuèhuì","音樂會","concert"],["jié hūn","結婚","to get married"],["duì bu qǐ","對不起","(I'm) sorry"],["yuēhuì","約會","appointment, date"],["méi guānxi","沒關係","it doesn't matter"],["tán","談","to talk, to chat"]];
cards_lesson21 = [["shù","束","a measure word (bunch)"],["huār","花兒","flower"],["zhēn","真","real, true, genuine"],["hǎokàn","好看","good-looking"],["zhù","祝","to wish"],["sòng","送","to give as a present, to send"],["fēicháng","非常","extremely, unusually"],["gǎnxiè","感謝","to thank"],["gāoxìng","高興","glad, happy, delighted"],["tàitai","太太","Mrs., madame"],["niánqīng","年輕","young"],["duō","多","how"],["tiào wǔ","跳舞","to dance"],["gūniang","姑娘","girl"],["ba","吧","a modal particle, softens tone"],["piàoliang","漂亮","pretty, beautiful"],["gèng","更","even, still"],["xiàng","像","to be like, to resemble, to take after"],["kāi","開","to open"],["mén","門","door"]];
cards_lesson21_supl = [["liàng","輛","measure word (cars)"],["gānjing","乾淨","clean, neat"],["xīnnián","新年","New Year"],["suìshu","歲數","age (era)"],["lǐwù","禮物","present, gift"],["zhàopiàn","照片","photograph, picture"],["érzi","兒子","son"],["nǚ'ér","女兒","daughter"]];
cards_lesson22 = [["hòubiān","後邊","back, at the back of, behind"],["xiǎo","小","little, small"],["huāyuán","花園","garden"],["fángzi","房子","house"],["kétīng","客廳","drawing room, living room"],["pángbiān","旁邊","side"],["shūfáng","書房","a study"],["yǐzi","椅子","chair"],["shǎo","少","few, little"],["zhuōzi","桌子","table, desk"],["shàngbiān","上邊","top, on, over, above"],["zǒngshì","傯是","always"],["zhěnglǐ","整理","to put in order, to straighten up, to arrange"],["chúfáng","廚房","kitchen"],["duìmiàn","對面","opposite"],["bāngzhu","幫助","to help"],["cāntīng","餐廰","dining room"],["zuǒbiān","左邊","left"],["lǐbiān","裏邊","inside"],["fángjiān","房間","room"],["wòshì","臥室","bedroom"],["xǐzǎojiān","洗澡件","bathroom"],["xǐzǎo","洗澡","to take a bath"],["zěnmeyàng","怎麼樣","how is it that...?, how"]];
cards_lesson22_supl = [[]];
cards_classinstruct = [["wǒ niàn","我唸","I read."],["nǐmen tīng","你們聽","You listen."],["gēn wǒ niàn","跟我唸","Repeat after me."],["qǐng nǐ niàn","請你唸","Please read."],["hěn hǎo","很好","Very good."],["niàn shēngcí","念生詞","Read the new word."],["shūo hányǔ","說漢語","Speak Chinese."],["xiě hànzì","寫漢字","Write (in) Chinese."],["tīng lùyīn","聽錄音","Listen to the tape."],["zuò liànxǐ","作練習","Do the exercise."],["fānyì jùzi","翻譯句子","Translate sentences"],["jiǎng yǔfǎ","講語法","Explain grammar"],["dǒng bùdǒng","懂不懂","Do you understand?"],["tīng bù dǒng","聽不懂","I don't understand what you said."],["fāndaò...yè","翻到...頁","Turn to page..."],["dì...kè","第...課","Lesson #..."],["dúkèwén","讀課文","Read the text."]];			
cards_timewords = [["jīnnián","今年","this year"],["mīngnián","明年","next year"],["qùnián","去年","last year"],["jīntiān","今天","today"],["mīngtiān","明天","tomorrow"],["hòutiān","後天","the day after tomorrow"],["zuótiān","昨天","yesterday"],["qiántiān","前天","the day before yesterday"],["dàqiántiān","大前天","three days ago"],["sìtiánqián","四天前","four days ago"],["sāntiánhòu","三天後","3 days later"],["zǎoshàng","早上","morning (1)"],["shàngwǔ","上午","morning (2)"],["zhōngwǔ","中午","noon"],["xiàwǔ","下午","afternoon"],["wǎnshàng","晚上","evening"],["xiànzài","現在","now"],["yǐqián","以前","before, in the past"],["yǐhoù","以後","later on, in the future"]];
		
_cardDeck =
	[
	 ["Lesson 1",cards_lesson1],["Lesson 2",cards_lesson2],
	 ["Lesson 3",cards_lesson3],["Lesson 4",cards_lesson4],
	 ["Lesson 5",cards_lesson5],["Lesson 5 (Supl.)",cards_lesson5_supl],
	 ["Lesson 6",cards_lesson6],
	 ["Lesson 7",cards_lesson7],["Lesson 7 (Supl.)",cards_lesson7_supl],
	 ["Lesson 8",cards_lesson8],["Lesson 8 (Supl.)",cards_lesson8_supl],
	 ["Lesson 9",cards_lesson9],["Lesson 9 (Supl.)",cards_lesson9_supl],
	 ["Lesson 10",cards_lesson10],["Lesson 10 (Supl.)",cards_lesson10_supl],
	 ["Lesson 11",cards_lesson11],["Lesson 11 (Supl.)",cards_lesson11_supl],
	 ["Lesson 12",cards_lesson12],
	 ["Lesson 13",cards_lesson13],["Lesson 13 (Supl.)",cards_lesson13_supl],
	 ["Lesson 14",cards_lesson14],["Lesson 14 (Supl.)",cards_lesson14_supl],
	 ["Lesson 15",cards_lesson15],["Lesson 15 (Supl.)",cards_lesson15_supl],
	 ["Lesson 16",cards_lesson16],["Lesson 16 (Supl.)",cards_lesson16_supl],
	 ["Lesson 17",cards_lesson17],["Lesson 17 (Supl.)",cards_lesson17_supl],
	 ["Lesson 18",cards_lesson18],
	 ["Lesson 19",cards_lesson19],["Lesson 19 (Supl.)",cards_lesson19_supl],
	 ["Lesson 20",cards_lesson20],["Lesson 20 (Supl.)",cards_lesson20_supl],
	 ["Lesson 21",cards_lesson21],["Lesson 21 (Supl.)",cards_lesson21_supl],
	 ["Lesson 22",cards_lesson22],["Lesson 22 (Supl.)",cards_lesson22_supl],
	 ["Class Instructions",cards_classinstruct],
	 ["Time Words",cards_timewords]
	];


function ChineseCardDeck(cardDeck)
{
	this.prototype = new CardDeck();
	this.cardDeck = cardDeck;
}

ChineseCardDeck.prototype.getLessonCount = function()
{
	return this.cardDeck.length;
}

ChineseCardDeck.prototype.getLessonDesc = function(i)
{
	return this.cardDeck[i][0];
}

ChineseCardDeck.prototype.getLessonDeck = function(i)
{
	return new ChineseLessonDeck(this.cardDeck[i][1]);
}



function ChineseLessonDeck(lesson)
{
	this.prototype = new LessonDeck();
	this.lesson = lesson;
}
ChineseLessonDeck.prototype.getCardCount = function()
{
	return this.lesson.length;
}

ChineseLessonDeck.prototype.getCard = function(i)
{
	return new ChineseCard(this.lesson[i]);
}



function ChineseCard(cardArray)
{
	this.prototype = new Card();
	this.cardArray = cardArray;
}

ChineseCard.prototype.getSide = function(i)
{
	return this.cardArray[i];
}



function ChineseCards()
{
	this.prototype = new Cards();
	this.cardDeck = new ChineseCardDeck(_cardDeck);
	this.cardDesc = new ChineseCardDescription(_cardSides);
}

ChineseCards.prototype.getCardDesc = function()
{
	return this.cardDesc;
}

ChineseCards.prototype.getCardDeck = function()
{
	return this.cardDeck;
}	
