function login(type) { var redirect_path=encodeURIComponent($("input[name=redirect_path]").val()); var url = "connect_"+type+".php?hikakuCMSremember_cookie=" + ($("#"+type+"_auto").attr("checked") ? "1" : "0")+"&redirect_path="+redirect_path; location.href=url; }