/* This file is a JavaScript that populates the "selection box" on the HTML file articles.html.
To add an article, add a "menuItem" and a "url" for the listing */

function populateMenu(group) {
title = new Array()
url = new Array()

//---------------------------------------------------------------------
//                 Adding A MenuItem                                   
//---------------------------------------------------------------------

//---------------------------------------------------------------------
title[0] = new Array() //Starting with: A,B,C,D,E
title[0][0] = "A home inspections is a good investment"
title[0][1] = "Are you in the market for a Home?"
title[0][2] = "Before you sign on the dotted Line"
title[0][3] = "Burglar-proofing your home"
title[0][4] = "Buying a home: What can you afford?"
title[0][5] = "Buying Your First Home"
title[0][6] = "Buying Your First Home(2)"
title[0][7] = "Closing A Real Estate Deal"
title[0][8] = "Code of Ethics and Standards of Business Practice"
title[0][9] = "Choosing a REALTORŪ Who\'s right for you"
title[0][10] = "Consider Hidden Costs When Buying a Home"
title[0][11] = "Could you sell your own home?"
title[0][12] = "Do you qualify for the GST rebate?"
title[0][13] = "Does a career in Real Estate interest you?"
title[0][14] = "Don\'t let Carbon Monoxide threaten your home"
title[0][15] = "Education keeps Realtor Standards High"


title[1] = new Array() //Starting with: F,G,H,I,J
title[1][0] = "Fireplace and Chimney Safety"
title[1][1] = "Flooring Options"
title[1][2] = "Free 'how to' books loaded with information for home buyers or sellers"
title[1][3] = "Fresh Paint"
title[1][4] = "Getting your home ready for Sale"
title[1][5] = "Glossary of Real Estate Terms"
title[1][6] = "Helpful hints on buying a home"
title[1][7] = "How to cut years off your mortgage"

title[2] = new Array() //Starting with: K,L,M,N,O
title[2][0] = "Kitchen Renovations - Costs and Ideas"
title[2][1] = "Listing Agreement"
title[2][2] = "Listing your home means more than placing an ad"

title[3] = new Array() //Starting with: P,Q,R,S,T
title[3][0] = "Real Estate board benefits buyers and sellers"
title[3][1] = "REALTORS help smooth the home buying process"
title[3][2] = "Save Energy This Winter"
title[3][3] = "Selling or buying: When to call the experts"
title[3][4] = "Selling your Home: Why it pays to use a REALTORŪ"
title[3][5] = "Standards you can expect from a REALTORŪ"
title[3][6] = "Start your spring garden indoors"
title[3][7] = "Storage Space, Maximizing your"
title[3][8] = "Ten good reasons why you should use a REALTORŪ"
title[3][9] = "The \"Why\'s\" and \"When\'s\" of selling your home"
title[3][10] = "Time To Close Up The Cottage?"
title[3][11] = "Tougher Education Standards Mean Better REALTORSŪ"
title[3][12] = "Trying to sell: It doesn't pay to go alone"

title[4] = new Array() //Starting with: U,V,W,X,Y,Z
title[4][0] = "Understanding Real Estate Terminology"
title[4][1] = "Use a REALTORŪ Or Go It Alone?"
title[4][2] = "Why REALTORSŪ don\'t grow on trees!"
title[4][3] = "Why you should use a REALTORŪ to buy or sell"
title[4][4] = "Your REALTORŪ and the MLS service"
title[4][5] = "Your REALTORŪ: The best source for tips"


//---------------------------------------------------------------------
//                 Adding The URL for the menu item
//---------------------------------------------------------------------

//---------------------------------------------------------------------

url[0] = new Array() //Starting with: A,B,C,D,E
url[0][0] = "article_HomeInspectionGoodInvestment.php"
url[0][1] = "article_AreYouInMarket.php"
url[0][2] = "article_BeforeYouSign.php"
url[0][3] = "article_BurglarProofHome.php"
url[0][4] = "article_WhatCanYouAfford.php"
url[0][5] = "article_BuyingYourFirstHome.php"
url[0][6] = "article_BuyingYourFirstHome2.php"
url[0][7] = "article_ClosingRealEstateDeal.php"
url[0][8] = "http://www.crea.ca/public/realtor_codes/realtorcodejan08.pdf"
url[0][9] = "article_ChoosingRightRealtor.php"
url[0][10] = "article_ConsiderHiddenCosts.php"
url[0][11] = "article_SellHome.php"
url[0][12] = "article_QualifyForGST.php"
url[0][13] = "article_RealEstateCareer.php"
url[0][14] = "article_CarbonMonoxide.php"
url[0][15] = "article_EducationStandards.php"


url[1] = new Array() //Starting with: F,G,H,I,J
url[1][0] = "article_FireplaceAndChimneySafety.php"
url[1][1] = "article_FlooringOptions.php"
url[1][2] = "article_FreeHowToBooks.php"
url[1][3] = "article_FreshPaint.php"
url[1][4] = "article_GettingHomeReady.php"
url[1][5] = "article_GlossaryOfRealEstateTerms.php"
url[1][6] = "article_HelpfulHints.php"
url[1][7] = "article_CutYearsFromMortgage.php"

url[2] = new Array() //Starting with: K,L,M,N,O
url[2][0] = "article_KitchenRenovationsCostsAndIdeas.php"
url[2][1] = "article_ListingAgreement.php"
url[2][2] = "article_listHome.php"

url[3] = new Array() //Starting with: P,Q,R,S,T
url[3][0] = "article_REBBenefits.php"
url[3][1] = "article_SmoothBuying.php"
url[3][2] = "article_SaveEnergy.php"
url[3][3] = "article_BuySellExperts.php"
url[3][4] = "article_WhyUseRealtor.php"
url[3][5] = "article_RealtorStandards.php"
url[3][6] = "article_StartSpringGarden.php"
url[3][7] = "article_StorageSpace.php"
url[3][8] = "article_TenGoodReasons.php"
url[3][9] = "article_WhysAndWhens.php"
url[3][10] = "article_TimeToCloseCottage.php"
url[3][11] = "article_TougherEducationStandards.php"
url[3][12] = "article_DontGoAlone.php"

url[4] = new Array() //Starting with: U,V,W,X,Y,Z
url[4][0] = "article_Terminology.php"
url[4][1] = "article_UseARealtorOrGoItAlone.php"
url[4][2] = "article_GrowOnTrees.php"
url[4][3] = "article_WhyUseRealtor.php"
url[4][4] = "article_MLSMarketing.php"
url[4][5] = "article_RealtorTips.php"




//-------------------Do not edit below this line-----------------------


document.articles.chooser.length = title[group].length
document.articles.chooser.size = title[group].length

if (title[group].length == 0) {
	alert("There are currently no articles in this section")
	}
else {
	for (i=0; i < title[group].length; i++) {
		document.articles.chooser[i].value = url[group][i]
		document.articles.chooser[i].text = title[group][i]
		}
	}

document.articles.section[0].text = ("A-E (" + title[0].length + ")")
document.articles.section[1].text = ("F-J (" + title[1].length + ")")
document.articles.section[2].text = ("K-O (" + title[2].length + ")")
document.articles.section[3].text = ("P-T (" + title[3].length + ")")
document.articles.section[4].text = ("U-Z (" + title[4].length + ")")

}

function loadArticle() {
if (document.articles.chooser.selectedIndex == -1) {
	alert("Please select an article")
	}
else if (document.articles.chooser.options[document.articles.chooser.selectedIndex].value == "http://www.crea.ca/public/realtor_codes/realtorcodejan08.pdf"){
	window.location="http://www.crea.ca/public/realtor_codes/realtorcodejan08.pdf";
}
	else {
window.location=("http://www.vireb.com/" + document.articles.chooser.options[document.articles.chooser.selectedIndex].value)
	}
}