// JavaScript Document

function getTestCase() {
	document.write('<hr>printing this</hr>');
}

function getTitle() {
	document.write('<h1>2nd Annual</h1><h1>Huntsville Hospital Auxiliary</h1><h1>Golf Classic</h1>');
}

function getHeader() {
	var sgOut = '<div id="header"><table><tr>';
	sgOut += '<td width="333px" align="center"><img src="images/HHAGC-logo.jpg" align="middle" title=" " width="155px" height="63px" /></td>';
	sgOut += '<td width="333px" align="center"><img src="images/BMOBM_T2RB_E.png" width="266px" height="65px" /></td>';
	sgOut += '<td width="333px" align="center"><img src="images/DeerHurst-logo.jpg" width="108px" height="81px"/></td>';
	sgOut += '</tr></table></div>';
	document.write(sgOut);
} // function getHeader()

function getMenu(rows) {
	// rows => Index: 1234, Sponsors: 0234, Reg: 0134, Vol: 0124, Menu: 0123
	var nLoop = rows.length;
	if (rows[0] == '1') {
		var sgOut = '<div id="leftcol"><div id="menu-side"><br /><div class="nav20">';
	} else {
		var sgOut = '<br /><div class="nav20">';
	}
	var arrMenu = new Array();
	arrMenu[0] = '<a href="index.html" title="Link to Home page" target="_parent">Home</a><br />';
	arrMenu[1] = '<a href="sponsors.html" title="Link to Sponsor page" target="_parent">Sponsors</a><br />';
	arrMenu[2] = '<a href="images/GolferRegistrationForm2011ES.doc" title="Registration Form for Huntsville Hospital Auxiliary Golf Classic" target="_parent">Registration Form</a><br />';
	arrMenu[3] = '<a href="volunteers.html" title="Link to Volunteer page" target="_parent">Volunteers</a><br />';
	arrMenu[4] = '<a href="dinner-menu.html" title="Link to Dinner Menu" target="_parent">Dinner Menu</a>';
	var pos = 0;
	while (pos < nLoop) {
		sgOut += arrMenu[rows[pos]];
		pos += 1;
	}
	if (rows[0] == '1') {
		sgOut += '</div></div></div>';
	} else {
		sgOut += '</div>';
	}
	document.write(sgOut);
} //function getMenu(rows);



function getCopyright() {
	document.write('<div class="copyright">Superior View Housing 2003</div>');
}

function Validate(theForm) {
    if (Trim(theForm.first_name1.value).length==0) {
        alert("Please provide Golfer 1's \"First Name\".");
        theForm.FirstName1.focus();
        return (false);
    }
    if (Trim(theForm.last_name1.value).length==0) {
        alert("Please provide Golfer 1's \"Last Name\".");
        theForm.LastName1.focus();
        return (false);
    }
//    if (Trim(theForm.Phone1.value).length==0 && Trim(theForm.DayPhone.value).length==0 && Trim(theForm.EveningPhone.value).length==0 && Trim(theForm.Email.value).length==0)
    if (Trim(theForm.phone1.value).length==0) {
        //alert("Please provide one of the following: \n \"Cell Phone\" \n \"Daytime Phone\" \n \"Evening Phone\" or \n \"Email\"");
		alert("Please provide Golfer 1's \"Phone\".");
        theForm.Phone1.focus();
        return (false);
    }
    if (Trim(theForm.email1.value).length==0){
        alert("Please Provide Golfer 1's \"E-mail\".");
        theForm.Email1.focus();
        return (false);
    }
    return (true);
}

function addSponsor(psNum, psUrl, psTitle, psImage, psWidth, psHeight, psInfo) {
	this.Num = psNum;
	this.URL = psUrl;
	this.Title = psTitle;
	this.ImgName = psImage;
	this.Width = psWidth;
	this.Height = psHeight;
	this.Info = psInfo;
	return this;
	}
	
arrSponsors = new Array();

function createSponsors() {
	arrSponsors[ 0] = new addSponsor(100, 'www.muskokacosmeticdentist.ca', "Dr. Drew Markham's website", 'DrDrewMarkham_logo.jpg', 303, 78, '');
	arrSponsors[ 1] = new addSponsor(101, 'www.deerhurstresort.com/golf_highlands.html', "Deerhurst Highlands Golf's website", 'DeerHurst-logo.jpg', 108, 81, '');
	arrSponsors[ 2] = new addSponsor(102, 'www.metroland.com/Communities/100314/Huntsville_Forester', "Huntsville Forester's website", 'Huntsville-Forester-logo-1.jpg', 283, 60, '');
	arrSponsors[ 3] = new addSponsor(103, 'www.hyundaiofmuskoka.com', "Jason Armstrong's Hyundai of Muskoka's website", 'JasonHyundai-sm-logo.jpg', 260, 51, '');
	arrSponsors[ 4] = new addSponsor(104, 'www.surenet.net', "SureNet Communications Group Inc's website", 'surenettext_logo.gif', 201, 42, '');
	arrSponsors[ 5] = new addSponsor(105, 'www.rbc.com', "Royal Bank of Canada's website", 'rbc_royalbank_en.gif', 210, 47, '');
	arrSponsors[ 6] = new addSponsor(106, 'www.huntsvillehonda.com', "Jason Armstrong's Huntsville Honda's website", 'HuntsvilleHonda.gif', 220, 60, '');
	arrSponsors[ 7] = new addSponsor(107, 'www.mpinsurance.ca/main', "McIlroy & Payne's website", 'McIlroyPayne.jpg', 212, 73, '');
	arrSponsors[ 8] = new addSponsor(108, 'www.lakeofbaysbrewing.ca', "Lake of Bays Brewing Company's website", 'LakeofBays.jpg', 175, 175, '');
	arrSponsors[ 9] = new addSponsor(109, 'www.ctv.ca', "CTV's website", 'ctv.bmp', 195, 126, '');
	arrSponsors[10] = new addSponsor(110, 'www.moosefm.com/cfbk/', "New FM 105.5's website", 'FM105.5-LOGO.jpg', 182, 97, '');
	arrSponsors[11] = new addSponsor(111, 'www.brokerlink.ca', "Canada Brokerlink Insurance's website", 'CanadaBrokerlinkInsurance.gif', 243, 52, '');
	arrSponsors[12] = new addSponsor(112, 'www.muskokaonline.com/HuntersBayRadio.aspx', "Hunters Bay Radio's website", 'HuntersBayRadio.jpg', 101, 139, '');
	arrSponsors[13] = new addSponsor(113, 'www.meganmcleod.com', "Chestnut Park Real Estate and broker Megan McLeod's website", 'ChestnutPark-logo.jpg', 168, 141, '<span>Megan McLeod, Broker</span>');
	arrSponsors[14] = new addSponsor(114, 'www.muskokabrewery.com/php/home.php', "Muskoka Cottage Brewery's website", 'muskokabrewery.gif', 219, 194, '');
	arrSponsors[15] = new addSponsor(115, 'www.bracebridgegolfclub.com', "Bracebridge Golf Club's website", 'BBgolfcourse.jpg', 197, 108, '');
//	arrSponsors[16] = new addSponsor(116, 'www.bmo.com/home?nav=top', "Bank of Montreal's website", 'BMO-logo.jpg', 300, 52, '');
	arrSponsors[16] = new addSponsor(116, 'www.bmo.com/home?nav=top', "Bank of Montreal's website", 'BMOBM_T2RB_E.png', 266, 65, '');
	arrSponsors[17] = new addSponsor(117, 'bruins.nhl.com/', "Boston Bruins' website", 'BostonBruins.JPG', 195, 196, '');
	arrSponsors[18] = new addSponsor(118, 'www.mbrp.com', "MBRP Inc. Performance Exhaust's website", 'mbrp-big.jpg', 200, 200, '');
	arrSponsors[19] = new addSponsor(119, 'www.walmart.ca', "Walmart's website", 'walmart.jpg', 203, 202, '');
	arrSponsors[20] = new addSponsor(120, 'www.eastsidemarios.com/?utm_source=canpages', "East Side Mario's website", 'east-side-marios-restaurants-logo.jpg', 200, 200, '');
	arrSponsors[21] = new addSponsor(121, 'www.hhof.com', "Hockey Hall of Fame's website", 'Hockey-Hall-of-Fame.JPG', 241, 243, '');
	arrSponsors[22] = new addSponsor(122, 'www.muskokamedispa.ca', "Muskoka Medispa and Vein Centre's website", 'Muskoka-Medispa.png', 207, 150, '');
	arrSponsors[23] = new addSponsor(123, 'www.rockyislandtire.com', "The Rocky Island Tire Co. Inc's website", 'Rocky-Island.jpg', 391, 129, '');
	arrSponsors[24] = new addSponsor(124, 'www.highlandestates.ca', "Higland Estates' website", 'HighlandEstates.png', 275, 86, '');
	arrSponsors[25] = new addSponsor(125, 'www.muskokaalgonquinvillage.ca/', "Muskoka Algonquin Village's website", 'MuskokaAlgonquinVillage.jpg', 329, 70, '');
	arrSponsors[26] = new addSponsor(126, 'mapleleafs.nhl.com/club/page.htm?bcid=tea_alumni', "Toronto Maple Leafs Alumni Association's web page", 'TML-Alumnae.gif', 125, 150, '');
	arrSponsors[27] = new addSponsor(127, 'www.autoproservice.com', "NAPA Autopro's website", 'autopro.gif', 220, 128, '');
	arrSponsors[28] = new addSponsor(128, 'www.huntsvilleshometownida.ca', "Huntsville's Hometown I.D.A Drugstore's website", 'Hometown-Rexall.jpg', 675, 122, '');
	arrSponsors[29] = new addSponsor(129, 'pview.findlaw.com/view/1205602_1', "Thoms & Currie's contact information", 'ThomsandCurrie.jpg', 239, 72, '');
	arrSponsors[30] = new addSponsor(130, 'tint-it.ca/', "Tint-It Graphics' website", 'Tint-It.jpg', 300, 202, '');
	arrSponsors[31] = new addSponsor(131, 'www.festingtoyota.com/', "Festing Toyota's website", 'FestingToyota.jpg', 300, 202, '');
	arrSponsors[32] = new addSponsor(132, 'www.huntsvillewindow.ca/', "Huntsville Window and Door's website", 'HuntsWinandDoor.jpg', 316, 160, '');
	arrSponsors[33] = new addSponsor(133, '', "Armstrong Automotive's website", 'ArmstrongAuto.jpg', 216, 80, '');
	arrSponsors[34] = new addSponsor(134, 'www.lindacrammondinteriors.com', "Linda Crammond Interiors' website", 'CrammondInteriors.jpg', 138, 104, '');
	arrSponsors[35] = new addSponsor(135, 'www.dwightgardencentre.com/', "Dwight Garden Centre's website", 'DwightGarden.bmp', 120, 112, '');
	arrSponsors[36] = new addSponsor(135, 'www.royallepagemuskoka.com/menuagent.asp?officefilter=12', "Royal LePage Lakes of Muskoka (Dwight)'s website", 'DwightLepage.jpg', 240, 106, '');
	arrSponsors[37] = new addSponsor(137, 'www.jfenterprises.ca', "J & F Enterprises' website", 'JandF.jpg', 186, 81, '');
	arrSponsors[38] = new addSponsor(138, 'www.rolstonhomebuildingcentre.com', "Rolston Home Building Centre's website", 'Rolston.jpg', 216, 120, '');
	arrSponsors[39] = new addSponsor(139, 'www.vacationlandontario.com/rolodex/id/11', "Michael A. Hardy & Associates' contact information", 'MAHardy.bmp', 273, 136, '');
	arrSponsors[40] = new addSponsor(140, 'www.mpinsurance.ca/main', "McIlroy & Payne Insurance Brobers' website", 'McIlroy.jpg', 324, 59, '');
	arrSponsors[41] = new addSponsor(141, 'tulloch.ca', "Tulloch Geomatics Inc's website", 'Tulloch.jpg', 280, 107, '');
	arrSponsors[42] = new addSponsor(142, 'www.lakesofhaliburton.ca/', "Royal LePage Lakes of Haliburton's website", 'HaliburtonLePage.jpg', 214, 126, '');
	arrSponsors[43] = new addSponsor(143, 'www.muskokarentall.com', "Muskoka Rent-All Ltd's website", 'Muskoka-Rent-All.jpg', 105, 86, '');
	arrSponsors[44] = new addSponsor(144, 'mobilemarine.com/', "Mobile Marine's website", 'MobileMarine.bmp', 166, 54, '');
	
	arrSponsors[45] = new addSponsor(145, 'www.bickleyford2005.ca', "The New Bickley Ford's website", 'dealer_2714_adv_header.jpg', 450, 101, '');
	arrSponsors[46] = new addSponsor(146, 'www.northgraniteridge.com', "North Granite Ridge Golf Club's website", 'north-granite.png', 223, 126, '');
	arrSponsors[47] = new addSponsor(147, 'greenshaulage.com', "Green's Haulage's website", 'greens-haulage.jpg', 179, 61, '');
	arrSponsors[48] = new addSponsor(148, 'en.clublink.ca/golf/golfcourse/overview.cfm?GOLF_COURSE_ID=1002', "ClubLink Mark O'Meara Golf Course's website", 'gcb_1002-omeara.png', 142, 143, '');
	arrSponsors[49] = new addSponsor(149, 'www.bigwinisland.com/index.cfm?ID=105', "Bigwin Island Golf Club's website", 'bigwin-island.png', 181, 94, '');
	
}

function getSponsor(inNum) {
/*<a href="http://www.metroland.com/Communities/100314/Huntsville_Forester" title="Logo and link for the Huntsville Forester website" target="_blank">
	<img src="images/Huntsville-Forester-logo.jpg" width="146" height="38"/></a>
*/	
	var sgImage = '<img src="images/'+arrSponsors[inNum].ImgName+'" width="'+arrSponsors[inNum].Width+'" height="'+arrSponsors[inNum].Height+'"/>';
	if (arrSponsors[inNum].URL == '') {
		document.write (sgImage);
	} else {
		var sgOut = '<a href="http://' + arrSponsors[inNum].URL + '" title="Logo and link for the ' + arrSponsors[inNum].Title + '" target="_blank">';
		sgOut += sgImage+arrSponsors[inNum].Info+'</a>';
		document.write (sgOut);
	}
}

function displaySponsors() {
	getSponsor(16); getSponsor(4); getSponsor(9); getSponsor(1); 	
	getSponsor(18); getSponsor(5); getSponsor(31); getSponsor(22);
	getSponsor(32); getSponsor(41); getSponsor(45); getSponsor(46);
	getSponsor(47); getSponsor(48); getSponsor(49); getSponsor(8); getSponsor(10);
	
	getSponsor(19); getSponsor(12); getSponsor(20);	getSponsor(38);
	getSponsor(14); getSponsor(30); getSponsor(21); getSponsor(37);	
	  getSponsor(2); 
	
	getSponsor(23);	getSponsor(24); 	
	getSponsor(11); getSponsor(44); getSponsor(7); 
	getSponsor(25);  getSponsor(13); getSponsor(26); 
	getSponsor(27); getSponsor(35);
	getSponsor(29);
	 
	getSponsor(33); getSponsor(34); getSponsor(36); getSponsor(43);	
	getSponsor(39); getSponsor(42);
	getSponsor(40); getSponsor(17);	
}

function getSponsorOfWeek(inNum, inScale) {
	var sgOut = '<a href="http://' + arrSponsors[inNum].URL + '" target="_blank">';
	sgOut += '<img src="images/'+arrSponsors[inNum].ImgName+'" width="'+(inScale * arrSponsors[inNum].Width)+'" height="'+(inScale * arrSponsors[inNum].Height);
//	sgOut += '<img src="images/' +arrSponsors[inNum].ImgName+ '" width="' +arrSponsors[inNum].Width+ '" height="' +arrSponsors[inNum].Height;
//<img src="images/FM105.5-LOGO.jpg" width="273" height="146" alt="Logo and link for the New FM 105.5's website"/></a>
	sgOut += 'alt="Logo and link for the '+ arrSponsors[inNum].Title +'"/></a>';
	document.write(sgOut);
}

function getPicture(ipFolder, ipPicture) {
	var sgOut = '<td class="cell-pict" width="50%">';
    sgOut += '<a target="_blank" href="/images/'+ipFolder+'/'+ipPicture+'_full.jpg">';
    sgOut += '<img src="/images/'+ipFolder+'/'+ipPicture+'_small.jpg" border="1" width="250" height="167"></a></td>';
	document.write(sgOut);
}

function getApplication() {
	var sgFirstName1 = document.feedback.first_name1;
	var sgLastName1 = document.feedback.last_name1;
	var sgAddress1 = document.feedback.address1;
/*	
	var sgCity1 = Request.Form("city1");
	var sgProvince1 = Request.Form("province1");
	var sgPostal1 = Request.Form("PostalCode1");
	var sgPhoneHome1 = Request.Form("phone_home1");
	var sgPhoneWork1 = Request.Form("phone_work1");
	var sgEmail1 = Request.Form("email1");
	var sgDepend1 = Request.Form("dependents1");
	var sgBedRoom = Request.Form("bdrms");
	var sgMainFloor = Request.Form("mnflr"); 
	var sgRentGear = Request.Form("rgi");
	var sgComments = Request.Form("comments"); 
*/	
	document.write(sgFirstNam1+" "+sgLastName1);
}

function getApplication001() {
	var sgFirstName1 = Request.Form("first_name1");
	var sgLastName1 = Request.Form("last_name1");
	var sgAddress1 = Request.Form("address1");
	var sgCity1 = Request.Form("city1");
	var sgProvince1 = Request.Form("province1");
	var sgPostal1 = Request.Form("PostalCode1");
	var sgPhoneHome1 = Request.Form("phone_home1");
	var sgPhoneWork1 = Request.Form("phone_work1");
	var sgEmail1 = Request.Form("email1");
	var sgDepend1 = Request.Form("dependents1");
	var sgBedRoom = Request.Form("bdrms");
	var sgMainFloor = Request.Form("mnflr"); 
	var sgRentGear = Request.Form("rgi");
	var sgComments = Request.Form("comments"); 
	document.write(sgFirstNam1+" "+sgLastName1);
}
