// Create breadcrumbs
Event.observe(window, 'load', function() {
	cururi = window.location.toString();
	
	ind = (cururi.indexOf(curlocation) < 0 ? 0 : cururi.indexOf(curlocation) + curlocation.length);
	rootpath = curlocation.substr(0, ind);
	curlocation = cururi.substr(ind, cururi.length);	

	pages = curlocation.split('/');

	$('breadcrumbs').insert(new Element('a', {'href': rootpath}).insert('Home'));
			
	curroot = '';
	for (i = 0; i < pages.length; i++)
	{
		if (pages[i] != '')
		{
			if (pages[i] == 'property-owner-services')
			{
				linktext = 'Property Owner Services';
			}else if (pages[i] == 'overview')
			{
				linktext = 'Overview';
			}else if (pages[i] == 'our-services')
			{
				linktext = 'Our Services';
			}else if (pages[i] == 'brokerage-services')
			{
				linktext = 'Brokerage Services';
			}else if (pages[i] == 'buy-a-property')
			{
				linktext = 'Buy a Property';
			}else if (pages[i] == 'sell-a-property')
			{
				linktext = 'Sell a Property';
			}else if (pages[i] == 'resident-information')
			{
				linktext = 'Resident Information';
			}else if (pages[i] == 'prospective-resident-faq')
			{
				linktext = 'Prospective Resident FAQ';
			}else if (pages[i] == 'application-process')
			{
				linktext = 'Application Process';
			}else if (pages[i] == 'current-resident-faq')
			{
				linktext = 'Current Resident FAQ';
			}else if (pages[i] == 'available-properties')
			{
				linktext = 'Available Properties';
			}else if (pages[i] == 'single-family-homes')
			{
				linktext = 'Single Family Homes';
			}else if (pages[i] == 'apartments')
			{
				linktext = 'Apartments';
			}else if (pages[i] == 'condos')
			{
				linktext = 'Condominiums';
			}else if (pages[i] == 'for-sale')
			{
				linktext = 'For Sale';
			}else if (pages[i] == 'about-us')
			{
				linktext = 'About Us';
			}else if (pages[i] == 'company')
			{
				linktext = 'Company';
			}else if (pages[i] == 'our-team')
			{
				linktext = 'Our Team';
			}else if (pages[i] == 'testimonials')
			{
				linktext = 'Testimonials';
			}else if (pages[i] == 'contact-us')
			{
				linktext = 'Contact Us';
			}else{
				linktext = '';
			}

			curroot = curroot + pages[i];
	
			if (i < (pages.length - 2))
			{
				$('breadcrumbs').insert(new Element('a', {'href': rootpath+curroot}).insert(linktext))
						.insert(' &gt; ');
			}else{
				$('breadcrumbs').insert(linktext);
			}
		}
	}

});