// addTo RSS module - convert links to form (home page)
function addTo() {
    $(".addTo").each(function(){
        if ($(this).find(".getRSSList a").length > 0) {
            var str = "";
            $(this).find(".getRSSList a").each(function() {
                str += "<option value='" + $(this).attr("href") + "'>" + $(this).text() + "</option>";
            });
            $(this).find(".getRSSList").after("<form target='_top' action='#' method='post'><label for='reader'>Add Dinner Tonight Recipes to:</label> <select name='reader' id='reader'>" + str + "</select> <input type='image' src='http://img.timeinc.net/recipes/static/i/btn_add.png' alt='Add' /></form>");
            $(this).find("form").bind("submit", function(){
                $(this).attr("action", $(this).find("option:selected").val());
            });
            $(this).find(".getRSSList").remove();
        }
    });
}

$(document).ready(function(){
	//initialize popup links
	$("a.popup").addClass("pop").attr("title", "[Opens in new window]").bind("click", function(){
		var popup = window.open($(this).attr("href"), "_blank", "height=700,width=750,scrollbars=yes");
		popup.focus();
		return false;
	});
});