$(document).ready(function() {
	
	$("#nav > li").hover(function(){$(this).addClass("hover");}, function(){$(this).removeClass("hover");});
	
	$('#f_col4 img').poshytip({
		className: 'tip-twitter',
		showTimeout: 1,
		alignTo: 'target',
		alignX: 'center',
		offsetY: 5,
		allowTipHover: false,
		fade: false,
		slide: false
	});
	
	/* ------------ GOOGLE MAP for Driving Directions page ------------ */
		
	function gmap_init() {
	 	//console.log('map');
		
	    var latlng = new google.maps.LatLng(39.4134879, -76.63385749999998);
	    var myOptions = {
	      zoom: 18,
	      center: latlng,
	      mapTypeId: google.maps.MapTypeId.SATELLITE
	    };
	   var map = new google.maps.Map(document.getElementById("map_canvas"),myOptions);

		var marker = new google.maps.Marker({
		      position: latlng, 
		      map: map
		  });	  
		}
	
	$('#map_canvas').each(function(index, value) {gmap_init();});
	
	
	/* ------------ Request a Proposal Form ------------ */
	$('.sec3 input:not(.ch_grp), .sec3 select, .sec3 input[type="text"]').attr('disabled', true);
	
	$('.ch_grp').click(function() {
		var grp = 'input.' + this.id;
		if ($(this).is(':checked')){ 
			$(grp +'[type="checkbox"]').removeAttr('disabled');
			}
		else {
			$(grp).attr('disabled', true);
			$('select.' + this.id).attr('disabled', true);
		}
		
	});
	
	$('.ch_row').click(function() {
		var row = '.' + this.id;
		if ($(this).is(':checked')){$(row).removeAttr('disabled');}
		else {
			$(row).attr('disabled', true);
		}
	});
	
	
	/* ------------ Thank You - Form Submissions ------------ */
	var url = window.location.pathname;
	var hash = window.location.hash;
	
	// for thanks messages on contact forms
	$('.contact_form').each(function(){
		if (hash == '#thanks'){
			$(this).hide().html('<h1> Thanks for your submission</h1>').fadeIn();
		}
	});

	$('#request_proposal').each(function(){
		if (hash == '#thanks'){
			$(this).hide().html('<h1> Thanks for your submission</h1>').fadeIn();
		}
	});
	
	/* ------------ Join general / spanish / medical ------------ */
	
	
});
