$(document).ready(function() { $("#navigation li").ahover({ toggleSpeed: 200, toggleEffect: 'width' }); $("select:not(#ctl00_main_content_loggedout select)").sSelect() }); function createOverlay() { doc_height = $(document).height(); overlay = $("
").addClass("overlay"); overlay.css("height", doc_height + "px"); $("body").append(overlay); overlay.fadeIn("fast") } function createErrorOverlay() { doc_height = $(document).height(); overlay = $("
").addClass("erroroverlay"); overlay.css("height", doc_height + "px"); $("body").append(overlay); overlay.show(); $(document).unbind("keypress"); $(document).bind("keypress", function(e) { closeErrorOverlayByESC(e) }) } function createOverlayContainer() { if (arguments[0] == undefined) { container_height = 350 } else { container_height = arguments[0] } window_width = $(window).width(); window_height = $(window).height(); ol_container = $("
").addClass("container"); $(".overlay").append(ol_container); ol_container_bottom = $("
").addClass("container_bottom"); $(".overlay").append(ol_container_bottom); top_pos = ((window_height / 2 - (container_height / 2)) - 30); left_pos = (window_width / 2 - (ol_container.width() / 2)); ol_container.css({ "height": container_height + "px", "top": top_pos + "px", "left": left_pos + "px" }); ol_container_bottom.css({ "top": (top_pos + container_height + 36) + "px", "left": left_pos + "px" }); close_button = $("").addClass("close"); close_button.attr({ "src": "/images/button_close.png", "alt": "Sluiten (ESC)" }); close_button.bind("click", function() { closeOverlay() }); close_button.qtip({ content: { text: false }, position: { corner: { target: 'rightTop', tooltip: 'leftBottom'} }, style: { name: 'cream'} }); ol_container.append(close_button); ol_subcontainer = $("
").addClass("subcontainer"); ol_container.append(ol_subcontainer); $(document).bind("keypress", function(e) { closeOverlayByESC(e) }); return ol_subcontainer } function closeOverlayByESC(e) { $("div.qtip").qtip("hide"); e = e.charCode || e.keyCode; if (e == 27) { closeOverlay() } } function closeErrorOverlayByESC(e) { e = e.charCode || e.keyCode; if (e == 27) { $(".erroroverlay").hide(function() { $(this).remove() }); $(document).unbind("keypress"); if ($(".overlay").length > 0) { $(document).bind("keypress", function(e) { closeOverlayByESC(e) }) } } } function closeOverlay() { setTimeout(function() { $("div.qtip").qtip("hide") }, 350); $(".overlay").fadeOut("fast", function() { $(this).remove() }); $(document).unbind("keypress") } function btEscape(input) { return input.replace("&", "%26").replace("=", "%3D") } function createAjaxPost(form_id) { var querystring = ""; $("#" + form_id + " input[type=text], #" + form_id + " input[type=hidden]:not(#__VIEWSTATE):not(#__EVENTVALIDATION):not(#__EVENTTARGET):not(#__EVENTARGUMENT):not(#__PREVIOUSPAGE), #" + form_id + " input[type=password]").each(function() { querystring += $(this).attr("name") + "=" + btEscape($(this).val()) + "&" }); $("#" + form_id + " input[type=radio]:checked").each(function() { querystring += $(this).attr("name") + "=" + $(this).val() + "&" }); $("#" + form_id + " select").each(function() { querystring += $(this).attr("name") + "=" + escape($(this).val().substr(0, 25)) + "&" }); $("#" + form_id + " textarea:not(.tinymce)").each(function() { querystring += $(this).attr("name") + "=" + escape($(this).val().substr(0, 25)) + "&" }); $("#" + form_id + " textarea.tinymce").each(function() { querystring += $(this).attr("name") + "=" + escape($(this).tinymce().getContent({ format: 'text' }).substr(0, 25)) + "&" }); $("#" + form_id + " input[type=checkbox]:checked").each(function() { querystring += $(this).attr("name") + "=1&" }); return querystring.slice(0, -1) } function checkAjaxError(xhr) { createErrorOverlay(); $(".erroroverlay").html(xhr.responseText) } function markErrorField(elm) { do_element = $("#" + elm); $(".tinymce").each(function() { tinyMCE.execInstanceCommand(elm, "mceSetCSSClass", false, do_element.attr("class") + " errorfield", false) }); if (do_element.is("select")) { $("label[for=" + elm + "]").addClass("errorlabel"); $("#ss_" + elm).addClass("errorfield") } else { do_element.addClass("errorfield"); do_element.prev("label").addClass("errorlabel") } $(".errorfield").eq(0).focus() } function clearErrors() { $(".tinymce").each(function() { new_class = $(this).attr("class").replace("errorfield", ""); tinyMCE.execInstanceCommand($(this).attr("id"), "mceSetCSSClass", false, new_class, focus) }); $(".errorfield").removeClass("errorfield"); $(".errorlabel").removeClass("errorlabel") } function disableSubmitButton(form_id) { s_btn = $("#" + form_id + " input[type=submit]"); s_btn.attr("disabled", true); s_btn.addClass("disabled") } function enableSubmitButton(form_id) { s_btn = $("#" + form_id + " input[type=submit]:not('#frm_basket input[type=submit]')"); s_btn.attr("disabled", false); s_btn.removeClass("disabled") }