$(document).ready(function() {

$(document).pngFix(); 

$('h1').text('');
$('h2').text('');

// extract information from url
url = window.location.href.split("/");
server = url[2];
section = url[3];
page = url[4];
	switch( section )
	{
	case '':
		$("li#your_dental_home_sub a").attr("class", "target");
		break;
	case 'meet_dr_firshein':
		$("li#meet_dr_firshein_sub a").attr("class", "target");
		break;
	case 'testimonials':
		$("li#testimonials_sub a").attr("class", "target");
		break;
	case 'dental_services':
		//$("li#dental_services_sub a").attr("class", "target");
		break;
	case 'ask_dr_firshein':
		$("li#ask_dr_firshein_sub a").attr("class", "target");
		break;
	case 'contact':
		//$("li#location_contact_sub a").attr("class", "target");
		break;
	case 'location':
		//$("li#location_contact_sub a").attr("class", "target");
		break;
	case 'appointment':
		break;
	case 'library':
		break;
	default:
		$("ul#default").css("visibility","visible");
		break;
	}

$("ul#navigation a").mouseover(function() {
	imghref = $(this).attr("href").replace(/\//g,"");
	$(this).attr("class", "current");
	switch( imghref )
	{
	case '':
		$("li#your_dental_home_sub a").attr("class", "target");
		break;
	case 'meet_dr_firshein':
		$("li#meet_dr_firshein_sub a").attr("class", "target");
		break;
	case 'testimonials':
		$("li#testimonials_sub a").attr("class", "target");
		break;
	case 'dental_services':
		if( section != 'dental_services' ) {
			$("li#dental_services_sub a").attr("class", "target");
		}
		break;
	case 'ask_dr_firshein':
		$("li#ask_dr_firshein_sub a").attr("class", "target");
		break;
	case 'contact':
		if( section != 'contact' && section != 'location' ) {
			$("li#location_contact_sub a").attr("class", "target");
		}
		break;
	case 'location':
		if( section != 'location' ) {
			$("li#location_contact_sub a").attr("class", "target");
		}
		break;
	case 'appointment':
		break;
	case 'library':
		break;
	default:
		$("ul#default").css("visibility","visible");
		break;
	}
});

$("ul#navigation a").mouseout(function() {
	if( section != $(this).attr("href").replace(/\//g,"") ) {
		$(this).attr("class", "");
	}
	$("ul#default a").attr("class", "");
});

/*
$('body').flash(
	{ src: '/flash/manhattanbeachdental.swf',
	  width: 900,
	  height: 700 },
	{ version: 8 }
);
*/

});
