YUI().use("node", "cookie", function (Y) { var bar; var arrPrompts = ["Enter your name", "Enter your e-mail address"]; var DoNotShow = Y.Cookie.get("DoNotShow"); function OnTextBoxFocus(e, arg) { if (this.get("value") == arrPrompts[arg]) this.set("value", "") } function OnTextBoxBlur(e, arg) { if (this.get("value") == "") this.set("value", arrPrompts[arg]) } function CloseBar() { bar.setStyle("display", "none"); document.body.style.paddingBottom = "2px" } function OnDoNotShow(e) { if (DoNotShow == null) { var expiryDate = new Date(); expiryDate.setDate(expiryDate.getDate() + 60); Y.Cookie.set("DoNotShow", "true", { expires: expiryDate }) } CloseBar() } Y.on("available", function () { bar = this; if (DoNotShow != null) CloseBar() }, "#fixed-foot-bar"); Y.on("domready", function () { Y.on("focus", OnTextBoxFocus, "#txtName", null, 0); Y.on("focus", OnTextBoxFocus, "#txtEmail", null, 1); Y.on("blur", OnTextBoxBlur, "#txtName", null, 0); Y.on("blur", OnTextBoxBlur, "#txtEmail", null, 1); Y.on("click", CloseBar, "#hlCloseBar"); Y.on("click", OnDoNotShow, "#hlDoNotShow") }) });
