var $ = j = jQuery;

var leftNavHighlighter = new tbelt.url.Highlighter({
	links:"ul#secondary-nav a[href!='#']",
	url:document.location.href,
	alterElements:{element:"each.closest('li')", className:"mmhide_active"}
});

$("document").ready(function(){
	inputStyles();	
	
	$("p#location-categories").remove();
	
	if($("p.mmhide_hours-info").text().trim().length==0){
		$("h3.mmhide_hours-title").remove();
		$("p.mmhide_hours-info").remove();
	}
	
	$("select#selCategoryFilter").change(function(evt){
		window.location = window.location.pathname+"?category="+$(evt.target).val();										  
    });	
	
});


function inputStyles(){
	$("input[type='text']").addClass("input-text");
	$("select").addClass("input-select");
	$("textarea").addClass("input-textarea");
	$("input[type='button'],input[type='submit'],input[type='reset']").addClass("input-button");
}


// generate the feedback url
function generateFeedbackUrl( ) {	
	location = "mailto:feedback@energycorridor.org?subject=Web site feedback about " + location.href + "&body=To provide feedback on this page, please enter your message below: ";
}

// generate the feedback url
function generateUpdateUrl( ) {	
	location = "mailto:updates@energycorridor.org?subject=Web site update information about " + location.href + "&body=Thank you for helping us keep this page up-to-date. Please enter your corrections below. If you have an updated photograph, please attached it to this email as a JPEG (1 Mb maximum size).";
}