$(document).ready(function() {
	$("a[rel*=facebox]").facebox();
	
	$("#contactImages img.contact").click(function() {
		var who = $(this).attr("alt");
		var subj = $("#kuubd-contactus-contact-form #SubjectId option");
		
		subj.each(function() {
			var el = $(this);
			
			if ( el.text() == who ) {
				el.attr("selected","selected");
			} else {
				el.removeAttr("selected");
			}
		});
	});
	
	$("a").click(
		function() {
			var cls = $(this).attr('class');
			var href = $(this).attr('href');
			var a = href.search(/bikefellowship\.(org|dev)/);
			if ( (cls != "close" && cls != "no-open" && cls != "jqmClose" && a < 0) || (cls == "do-open") ) {
				window.open(href, 'wmbfPopup');
				return false;
			}
		}
	);
});
