function fcGenerateEmbedCode(id) { var feeds = ""; var users = ""; var smedias = ""; $("input:checkbox").each(function() { if ($(this).attr("id").indexOf("fcFeedSelected_") == 0 && $(this).is(":checked")) { feeds += $(this).attr("id").replace("fcFeedSelected_", "")+","; } if ($(this).attr("id").indexOf("fcUserSelected_") == 0 && $(this).is(":checked")) { users += $(this).attr("id").replace("fcUserSelected_", "")+","; } if ($(this).attr("id").indexOf("fcFeedSMTypes_") == 0 && $(this).is(":checked")) { smedias += $(this).attr("id").replace("fcFeedSMTypes_", "")+","; } }); feeds = feeds.substring(0, feeds.length - 1); users = users.substring(0, users.length - 1); smedias = smedias.substring(0, smedias.length - 1); if ($("#fcEmbedShowMenus").is(":checked")) { show_menus = "true"; } else { show_menus = "false"; } if ($("#fcEmbedHideBackButton").is(":checked")) { hide_back_button = "true"; } else { hide_back_button = "false"; } if (parseInt($("#fcThemeSelected").val()) > 0) { var theme = $("#fcThemeSelected").val(); } else { var theme = ""; } if ($("#fcEmbedReferer").val() != "") { $("#"+id).val(""); } else { $("#"+id).val(""); } }