$(document).ready(function(){
	var setEnhancedBehaviors = function (){
		$("a[rel='close_window']").click(function(){
			window.close();
			return false;
		});
	};
	var setParentLink = function(){
		$("a[rel='parent']").click(function(){
			if(window.opener.location.href.match("flavor") &&  $(this).attr("href").match("flavor")){
				window.opener.location.href = $(this).attr("href");
				window.opener.location.reload();
			}
			else{
				window.opener.location.href = $(this).attr("href");
			}
			return false;
		});
	};
	$("a[rel='external']").attr("target","_blank");
	setEnhancedBehaviors();
	setParentLink();
	
});