// Initialize the scripts when the site loads

$(document).ready(function() {
	
	$('#menu li a').hover(function() {
		$(this).parent().addClass('over');
	}, function() {
		$(this).parent().removeClass('over');
	});
	
	$('a.bookAppointment').each(function() {
		var currentHref = $(this).attr('href');
		$(this).attr('href', currentHref + '?bookappointment=true');
	});
	
	// Dynamically insert the Google Reviews link since inserting it into the HTML prevents the site from validating.
	if ($('.reviewsLink').length >0) {
		//alert('i exist!');
		//$('.reviewsLink').html('<a href="http://maps.google.com/maps/place?cid=6075551011922004280&q=tigard%2Bsuv%2B%26%2Bauto%2Brepair%2Breviews&hl=en&gl=us&view=feature&mcsrc=detailed_reviews&num=10&start=0&ved=0CCUQuAU&sa=X&ei=Y_6NS6CJDKf2iwOhxJHIBg"><img src="/images/tigard-suv-google-reviews.png" width="118" height="118" alt="See Reviews of Tigard SUV and Auto Repair on Google" /></a>');
	}
	
	$('.reviewsLink a').click(function() {
		window.open($(this).attr('href'), 'reviews', 'statusbar=no,menubar=no,toolbar=no,scrollbars=yes,resizable=yes,width=540, height=575,left=570,top=200,screenX=570,screenY=150');
		return false;
	});
	
	$('.linkBlank').click(function() {
		window.open($(this).attr('href'), 'newWindow', '');
		return false;
	});
});