var digit_2_written_number = new Array (
	new Array(0, "zero"),
	new Array(1, "one"),
	new Array(2, "two"),
	new Array(3, "three"),
	new Array(4, "four"),
	new Array(5, "five"),
	new Array(6, "six"),
	new Array(7, "seven"),
	new Array(8, "eight"),
	new Array(9, "nine"),
	new Array(10, "ten"),
	new Array(10, "eleven"),
	new Array(12, "twelve"),
	new Array(13, "thirteen"),
	new Array(14, "fourteen"),
	new Array(15, "fifteen"),
	new Array(16, "sixteen"),
	new Array(17, "seventeen"),
	new Array(18, "eighteen"),
	new Array(19, "nineteen"),
	new Array(20, "twenty"),
	new Array(30, "thirty"),
	new Array(40, "forty"),
	new Array(50, "fifty"),
	new Array(60, "sixty"),
	new Array(70, "seventy"),
	new Array(80, "eighty"),
	new Array(90, "ninety"),
	new Array(100, "hundred"), 
	new Array(1000, "thousand"), 
	new Array(1000000, "million") 
);

var navigation_menu_items = new Array (
	new Array('Home', 'index.asp', 5), 
	new Array('About Us', 'aboutus.asp', 4), 
	new Array('Services', 'services.asp', 4), 
	new Array('Special Offers', 'specialoffers.asp', 4), 
	new Array('Success Stories', 'successstories.asp', 4), 
	new Array('Dental Tips', 'dentaltips.asp', 4), 
	new Array('FAQ', 'faq.asp', 4), 
	new Array('Jobs', 'jobs.asp', 4), 
	new Array('Contact Us', 'contactus.asp', 4)
);

var location_list = new Array (
	new Array ('Sunrise Dental of Arlington', '3131 Smokey Point Dr. Suite 14 A', 'Arlington', 'WA', '98223', '(360) 658-3131', 'Arlington@sunrisedental.com',  '48.154723', '-122.186635', 'Western Washington', 'North'), 
	// new Array('Sunrise Dental of Auburn', '201 N. Division Street', 'Auburn', 'WA', '98002', '(253) 333-9500', 'auburn@sunrisedental.com',  '47.309122', '-122.229031', 'Western Washington', 'Center'),
	new Array('Sunrise Dental of Bellevue', '1200 112th Ave NE Ste C-222', 'Bellevue', 'WA', '98004', '(425) 450-9500', 'bellevue@sunrisedental.com',  '47.621121', '-122.191034', 'Western Washington', 'Center'),
	new Array ('Sunrise Dental of Bellingham', '102 S. Samish Way, Suite 103', 'Bellingham', 'WA', '98225', '(360) 734-1999', 'Bellingham@sunrisedental.com',  '48.735291', '-122.469404', 'Western Washington', 'North'), 
	new Array ('Sunrise Dental of Bonney Lake', '20071 State Route 410 E', 'Bonney Lake', 'WA', '98391', '(253) 862-1015', 'bonneylake@sunrisedental.com',  '47.169459', '-122.160591', 'Western Washington', 'Center'), 
	new Array ('Sunrise Dental of Bothell/Mill Creek', '18204 Bothell Everett Hwy, Ste. J', 'Bothell', 'WA', '98373', '(425) 806-0077', 'MillCreek@sunrisedental.com',  '47.832702', '-122.209544', 'Western Washington', 'Center'), 
	new Array('Sunrise Dental of Everett', '111 SE Everett Mall Way, Ste B-100', 'Everett', 'WA', '98208', '(425) 513-2000', 'everett@sunrisedental.com',  '47.907527', '-122.231165', 'Western Washington', 'Center'), 
	new Array('Sunrise Dental of Federal Way', '33600 6th Ave Ste 102', 'Federal Way', 'WA', '98003', '(253) 838-3232', 'federalway@sunrisedental.com',  '47.300922', '-122.325533', 'Western Washington', 'Center'), 
	new Array('Sunrise Dental of Issaquah', '5006 E Lk Samm Pk Way SE', 'Issaquah', 'WA', '98029', '(425) 391-7645', 'issaquah@sunrisedental.com',  '47.556460', '-122.046040', 'Western Washington', 'Center'),
	new Array('Sunrise Dental of Kent', '10216 SE 256th St Ste 108', 'Kent', 'WA', '98030', '(253) 856-3384', 'kent@sunrisedental.com',  '47.372663', '-122.203878', 'Western Washington', 'Center'),
	new Array('Sunrise Dental of Lynnwood', '3505 188th Street SW', 'Lynnwood', 'WA', '98037', '(425) 744-1022', 'lynnwood@sunrisedental.com',  '47.828119', '-122.280811', 'Western Washington', 'Center'),
	new Array ('Sunrise Dental of Marysville', '1603 Grove St.', 'Marysville', 'WA', '98270', '(360) 651-1882', 'marysville@sunrisedental.com',  '48.061018', '-122.175401', 'Western Washington', 'Center'), 
	new Array('Sunrise Dental of Monroe', '267 East Main St., unit 201', 'Monroe', 'WA', '98272', '(360) 794-0717', 'monroe@sunrisedental.com',  '47.856607', '-121.968397', 'Western Washington', 'Center'), 
	new Array('Sunrise Dental of Mount Vernon', '2120 Freeway Drive', 'Mount Vernon', 'WA', '98273', '(360) 848-6777', 'mountvernon@sunrisedental.com',  '48.439563', '-122.342177', 'Western Washington', 'North'), 
	new Array('Sunrise Dental of Olympia', '3240 14th Ave NW', 'Olympia', 'WA', '98502', '(360) 866-7669', 'olympia@sunrisedental.com', '47.057318', '-122.942143', 'Western Washington', 'Center'), 
	new Array ('Sunrise Dental of Poulsbo', '19351 8th Ave. NE Ste. 211', 'Poulsbo', 'WA', '98370', '(360) 697-2777', 'poulsbo@sunrisedental.com',  '47.738504', '-122.639932', 'Western Washington', 'Center'), 
	new Array ('Sunrise Dental of Puyallup', '13333 Meridian E, Suite E', 'Puyallup', 'WA', '98373', '(253) 770-4342', 'Puyallup@sunrisedental.com',  '47.135509', '-122.292987', 'Western Washington', 'Center'), 
	new Array('Sunrise Dental of Renton', '3218 NE 12th St. Ste B', 'Renton', 'WA', '98056', '(425) 430-2029', 'renton@sunrisedental.com',  '47.502822', '-122.176280', 'Western Washington', 'Center'),
	new Array('Sunrise Dental of SeaTac/Seattle', '12610 Des Moines Memorial Drive Ste 208', 'Seattle', 'WA', '98168', '(206) 243-7788', 'seatac@sunrisedental.com', '47.491165', '-122.310275', 'Western Washington', 'Center'),
	new Array('Sunrise Dental of Seattle/Downtown', '509 Olive Way, Suite 1122', 'Seattle', 'WA', '98101', '(206) 623-2666', 'seattle@sunrisedental.com', '47.612831', '-122.337115', 'Western Washington', 'Center'),
	new Array('Sunrise Dental of Shoreline', '18532 Firlands Way North Ste B', 'Seattle', 'WA', '98133', '(206) 542-4444', 'shoreline@sunrisedental.com',  '47.763359', '-122.346350', 'Western Washington', 'Center'),
	new Array ('Sunrise Dental of Snohomish', '2709 Bickford Ave., Suite A', 'Snohomish', 'WA', '98290', '(425) 374-8451', 'Snohomish@sunrisedental.com',  '47.95276', '-122.117966', 'Western Washington', 'Center'), 
	new Array('Sunrise Dental of Tacoma', '1530 South Union Ave Suite 7', 'Tacoma', 'WA', '98405', '(253) 759-9291', 'tacoma@sunrisedental.com',  '47.246445', '-122.483335', 'Western Washington', 'Center'), 	
	// new Array('Sunrise Dental of Tukwila/South Center', '7100 Fun Center Way Ste. 110', 'Tukwila', 'WA', '98188', '(425) 291-9555', 'tukwila@sunrisedental.com',  '47.465661', '-122.246529', 'Western Washington', 'Center'), 	

	new Array ('Sunrise Dental of  N. Spokane', '7307 N. Division St., Suite 102', 'Spokane', 'WA', '99208', '(509) 468-0866', 'NorthSpokane@sunrisedental.com',  '47.723984', '-117.411257', 'Eastern Washington', 'East'), 
	new Array ('Sunrise Dental of Pasco', '5701 N. Bedford Street', 'Pasco', 'WA', '99301', '(509) 544-6188', 'Pasco@sunrisedental.com',  '46.2790510', '-119.2169360', 'Eastern Washington', 'East'), 
	new Array ('Sunrise Dental of Spokane Valley', '15701 E. Sprague Avenue, Ste. F', 'Spokane Valley', 'WA', '99037', '(509) 924-0055', 'spokanevalley@sunrisedental.com',  '47.657061', '-117.193682', 'Eastern Washington', 'East'), 
	new Array ('Sunrise Dental of Spokane', '104 South Freya St. Suite#127<br/>Turquoise Flag Building', 'Spokane', 'WA', '99202', '(509) 536-9999', 'Spokane@sunrisedental.com',  '47.656151', '-117.357644', 'Eastern Washington', 'East'), 
	new Array ('Sunrise Dental of Sunnyside', '110 W. Yakima Valley Hwy', 'Sunnyside', 'WA', '98944', '(509) 837-6202', 'Sunnyside@sunrisedental.com',  '46.330243', '-120.019989', 'Eastern Washington', 'East'), 
	new Array ('Sunrise Dental of Wenatchee', '645 Valley Mall Parkway, Unit 100', 'East Wenatchee', 'WA', '98802', '(509) 886-0500', 'Wenatchee@sunrisedental.com',  '47.412682', '-120.291767', 'Eastern Washington', 'East'), 
	new Array ('Sunrise Dental of Yakima', '3408 W. Nob Hill Blvd.', 'Yakima', 'WA', '98902', '(509) 457.5050', 'yakima@sunrisedental.com',  '46.585448', '-120.554066', 'Eastern Washington', 'East'), 

	new Array('Sunrise Dental of Battle Ground', '1401 nw 1st street', 'Battle Ground', 'WA', '98604', '(360) 666-5700', 'battleground@sunrisedental.com', '45.793039', '-122.538113', 'S.Washington & Oregon', 'South'), 
	new Array('Sunrise Dental of Beaverton', '12755 SW 2nd St.', 'Beaverton', 'OR', '97005', '(503) 641-4207', 'beaverton@sunrisedental.com', '45.485639', '-122.807961', 'S.Washington & Oregon', 'South'), 
	new Array('Sunrise Dental of Clackamas', '12100 SE Stevens Ct Suite 102', 'Happy Valley', 'OR', '97086', '(503) 655-2780', 'clackamas@sunrisedental.com', '45.447526', '-122.559191', 'S.Washington & Oregon', 'South'), 
	new Array('Sunrise Dental of E. Vancouver', '19301 SE 34th street', 'Camas', 'WA', '98607', '(360) 369-6420', 'camas@sunrisedental.com', '45.59692', '-122.4713063', 'S.Washington & Oregon', 'South'), 
	new Array('Sunrise Dental of Gresham', '13908 SE Stark Space B', 'Portland', 'OR', '97233', '(503) 253-4979', 'gresham@sunrisedental.com', '45.519245', '-122.520697', 'S.Washington & Oregon', 'South'), 
	new Array('Sunrise Dental of W. Vancouver', '10009 NE Hazel Dell', 'Vancouver', 'WA', '98685', '(360) 574-8181', 'vancouver@sunrisedental.com', '45.694109', '-122.668785', 'S.Washington & Oregon', 'South'), 
	new Array('Sunrise Dental of Lake Oswego', '3975 SW Mercantile Dr., Ste 167', 'Lake Oswego', 'OR', '97035', '(503) 675-7333', 'lakeoswego@sunrisedental.com', '45.414835', '-122.717030', 'S.Washington & Oregon', 'South'), 
	new Array('Sunrise Dental of Salem', '482 Lancaster Dr. NE', 'Salem', 'OR', '97301', '(503) 391-8920', 'salem@sunrisedental.com', '44.936084', '-122.982942', 'S.Washington & Oregon', 'South'), 	
	new Array('Sunrise Dental of Portland', '2850 SE 82nd Avenue', 'Portland', 'OR', '97267', '(503) 788-1415', 'portland@sunrisedental.com', '45.501110', '-122.578504', 'S.Washington & Oregon', 'South')
);

/*
var locations = new Array (
	new Array ('12610 Des Moines Memorial Drive Ste 208, Seattle, WA 98168', '47.491165', '-122.310275', 'Sunrise Dental of Sea-Tac'), 
	new Array ('3218 NE 12th St. Ste B, Renton, WA 98056',  '47.502822', '-122.176280', 'Sunrise Dental of Renton'), 
	new Array ('1200 112th Ave NE Ste C-222, Bellevue, WA 98004',  '47.621121', '-122.191034', 'Sunrise Dental of Bellevue'), 
	new Array ('18532 Firlands Way North Ste B, Shoreline, WA 98133',  '47.763359', '-122.346350', 'Sunrise Dental of Shoreline'), 
	new Array ('5006 East Lake Sammamish Pkwy SE, Issaquah, WA 98029',  '47.556460', '-122.046040', 'Sunrise Dental of Issaquah (aka - Aspen Dental)'), 
	new Array ('3505 188th Street SW, Lynnwood, WA 98037',  '47.828119', '-122.280811', 'Sunrise Dental of Lynnwood'), 
	new Array ('33600 6th Ave Ste 102, Federal Way, WA 98003',  '47.300922', '-122.325533', 'Sunrise Dental of Federal Way'), 
	new Array ('10216 SE 256th St Ste 108, Kent, WA 98030',  '47.372663', '-122.203878', 'Sunrise Dental of Kent'), 
	new Array ('111 SE Everett Mall Way Suite B-200, Everett, WA 98028',  '47.907527', '-122.231165', 'Sunrise Dental of Everett'), 
	new Array ('1530 South Union Ave Suite 7, Tacoma, WA 98405',  '47.246445', '-122.483335', 'Sunrise Dental of Tacoma'), 
	new Array ('3240 14th Ave NW, Olympia, WA 98502', '47.057318', '-122.942143', 'Sunrise Dental of Olympia')
);
*/

function hm_click(pagename, id) {
    var oname = "hn" + id;
    var obj = document.getElementById(oname);
	obj.src = './Images/' + id + '_on.jpg';
}

function hm_over(pagename, id) {
    var oname = "hn" + id;
    var obj = document.getElementById(oname);
	obj.src = './Images/' + id + '_on.jpg';
}

function hm_out(pagename, id) {
	//alert(pagename + '|' + id);
	var oname = "hn" + id;
	var obj = document.getElementById(oname);
	obj.src = './Images/' + id + '_off.jpg';
	
	var ocurrentname = "hn" + pagename;
	var objcurrent = document.getElementById(ocurrentname);
	objcurrent.src = './Images/' + pagename + '_on.jpg';
}

function gen_nav_theme(pagename, fadein) 
{
	var match_found = false;
	var theme_image_no = 0;
	var tempArray = pagename.split(' ');
	var pagename_prefix = tempArray.join('').toLowerCase();
	var temp_pagename_prefix = '';
	var htmlstr = '';
	var temphtmlstr = '';
	var temp_banner_prefix = 'home';

	//alert('pagename_prefix: ' + pagename_prefix);
	// get the naigation menu for later use
	for (var i = 0; i < navigation_menu_items.length; i++) {
		tempArray = navigation_menu_items[i][0].split(' ');
		temp_pagename_prefix = tempArray.join('').toLowerCase();

		temphtmlstr += '<td id="hnav' + temp_pagename_prefix + '" valign="top">';
		temphtmlstr += '<a  onmouseout="hm_out(\'' + pagename_prefix + '\', \'' + temp_pagename_prefix + '\')" onmouseover="hm_over(\'' + pagename_prefix + '\', \'' + temp_pagename_prefix + '\')" href="./' + navigation_menu_items[i][1] + '">';
		if (navigation_menu_items[i][0].toLowerCase() == pagename.toLowerCase())
		{
			temphtmlstr += '<img id="hn' + temp_pagename_prefix + '" border="0" src="./Images/' + temp_pagename_prefix + '_on.jpg" name="hn' + temp_pagename_prefix + '"/>';
			theme_image_no = navigation_menu_items[i][2];
			match_found = true;
			temp_banner_prefix = pagename_prefix;
			//alert('temp_banner_prefix: ' + temp_banner_prefix);
		}
		else
		{
			temphtmlstr += '<img id="hn' + temp_pagename_prefix + '" border="0" src="./Images/' + temp_pagename_prefix + '_off.jpg" name="hn' + temp_pagename_prefix + '"/>';
		}

		temphtmlstr += '</a>';
		temphtmlstr += '</td>';
	}

	//alert('temp_banner_prefix final: ' + temp_banner_prefix);
	htmlstr += '<map name="logo_map">';
	htmlstr += '<area href="./index.asp" alt="Sunrise Dental Home" coords="5,5,210,100">';
	htmlstr += '</map>';
	htmlstr += '<img src="./Images/bgheader_' + temp_banner_prefix + '.gif" border="0" usemap="#logo_map">';

	htmlstr += '<div id="navigation_menu">';

	htmlstr += '<table width="100%" cellspacing="0" cellpadding="0" border="0" ID="Table1">';
	htmlstr += '<tbody>';
	htmlstr += '<tr>';	
	htmlstr += '<td valign="top">';
	htmlstr += '<img width="224" height="18" src="./Images/spacer.gif"/>';
	htmlstr += '</td>';
	
	htmlstr += temphtmlstr;

	htmlstr += '</tr>';
	htmlstr += '</tbody>';
	htmlstr += '</table>';
	htmlstr += '<br/>';

	if (theme_image_no > 0)
	{
		htmlstr += '<table rules="none" frame="void" cellspacing="0" cellpadding="0" border="0" summary="" style="border-style: none; background-image: none; text-align: center; width: 100%; vertical-align: top;" ID="Table2">';
		htmlstr += '<tbody>';
		htmlstr += '<tr>';
		htmlstr += '<td>';
		for (var j = 0; j < theme_image_no; j++)
		{
			if (fadein == true)
				htmlstr += '<div class="fadein_wrapper"><img align="baseline" class="fadein" id="' + pagename_prefix + (j + 1) + '" src="./Images/' + pagename_prefix + (j + 1) + '.gif"/></div>';
			else
				htmlstr += '<img align="baseline" id="' + pagename_prefix + (j + 1) + '" src="./Images/' + pagename_prefix + (j + 1) + '.gif"/>';
		}
		
		htmlstr += '</td>';
		htmlstr += '</tr>';
		htmlstr += '</tbody>';
		htmlstr += '</table>';
	}
	else
	{
		document.getElementById("logo").style.height = "200px";
	}

	htmlstr += '</div>';

	document.write(htmlstr);
}
