var ESETTests = { init: function () { this.addSurveyMonkey(); }, /** * Add SurveyMonkey floating feedback button / form */ addSurveyMonkey: function () { var kbNames = [ "support", "suporte", "soporte" ]; if ($(document).width() >= 768 && kbNames.indexOf(window.location.host.split(".")[0]) === -1) { // create button var surveyMonkeyButton = $("", { id: "survey-monkey-button", html: "Tell us what you think ▲" }); // create form var surveyMonkeyForm = $("
", { id: "survey-monkey-form" }); // header to form div, closes form on click surveyMonkeyForm.prepend( $("
", { class: "survey-header", html: "Please rate your experience with our website", click: function () { $(this).parent().hide(); surveyMonkeyButton.show(); } }) ); // add iframe to form div surveyMonkeyForm.append(""); //open form upon button click surveyMonkeyButton.click(function () { $(this).hide(); surveyMonkeyForm.show(); }); // add button and form to body $("body").append(surveyMonkeyButton); $("body").append(surveyMonkeyForm); } } } $(function () { ESETTests.init(); });