$(document).ready(function() { if (!showReceipt()) { resetChosenModules(); ifFirstTab() } $("#tabPanel").tabs(); $("#tabPanel").bind("tabsselect", function(event, ui) { if ($("#isValidNavigation").val() == "1") { $("#isValidNavigation").val("0") } else { return false } if (ui.index == 2 && (hasNewsletter() == false && hasSurvey() == false)) { var style = 'style="border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px;"'; var pStyle = 'style="background: url(img/icons/warning.png) no-repeat 0px 3px; padding: 0px 0px 0px 40px"'; $.modal("<h2>" + priserOchBestall_moduleWarningHeader + "</h2><div " + style + "><p " + pStyle + ">" + priserOchBestall_moduleWarning + "</p></div>"); return false } }); var theTabs = $("#tabPanel").tabs(); $(".packageBox").click(function() { $("#isValidNavigation").val("1"); var thePackage = $(this).attr("title"); $("#chosenPackage").val(thePackage); $(".priceBox .left").show(); $(".priceBox .right").show(); $("#pricePerTimeUnit").hide(); $("#oneOffPayments").hide(); $("#chosenModulesHolder").hide(); $("#professionalPanelStep2").hide(); $("#flexPanelStep2").hide(); $("#starterPanelStep2").hide(); $("#enterprisePanelStep2").hide(); $("#Panel2 .mainContainer .middle .leftContent .infoBox .content").css("background-image", "none"); $("#Panel3 .mainContainer .middle .leftContent .infoBox .content").css("background-image", "none"); $("#chosenPackageHolder").hide(); $("#creditsAmountHolder").hide(); $("#chosenModulesAndExtrasDiv").hide(); $("#allExtrasIncludedDiv").hide(); switch (thePackage) { case "Professional": resetChosenModules(); hideAllModuleInfo(); $(".professionalPackage").show(); $("#professionalPanelStep2").show(); viewProfessionalModules(); theTabs.tabs("select", 1); $("#Panel2 .mainContainer .middle .leftContent .infoBox .content").css("background", "url(img/professionalIcons/packageIcon.png) no-repeat 225px 7px"); $("#Panel3 .mainContainer .middle .leftContent .infoBox .content").css("background", "url(img/professionalIcons/packageIcon.png) no-repeat 225px 7px"); $("#Panel4 .mainContainer .middle .leftContent .infoBox .content").css("background", "url(img/professionalIcons/packageIcon.png) no-repeat 225px 7px"); $("#Panel4 .mainContainer .middle .leftContent .packageLabel").html(priserOchBestall_packageProfessional); $("#chosenPackageHolder").show(); $("#chosenModulesAndExtrasDiv").show(); break; case "Flex": resetChosenModules(); hideAllModuleInfo(); $(".flexPackage").show(); $("#flexPanelStep2").show(); $("#panel2Message").html(priserOchBestall_chooseModulesToOrder); $("#Panel2 .mainContainer .middle .leftContent .infoBox .content").css("background", "url(img/flexIcons/flexIcon.png) no-repeat 228px 2px"); $("#Panel3 .mainContainer .middle .leftContent .infoBox .content").css("background", "url(img/flexIcons/flexIcon.png) no-repeat 228px 2px"); $("#Panel4 .mainContainer .middle .leftContent .infoBox .content").css("background", "url(img/flexIcons/flexIcon.png) no-repeat 228px 2px"); $("#chosenModulesHolder").show(); checkNewsletter(); theTabs.tabs("select", 1); $("#Panel4 .mainContainer .middle .leftContent .packageLabel").html(priserOchBestall_packageFlex); $("#chosenModulesAndExtrasDiv").show(); break; case "Starter": resetChosenModules(); resetCredits(); hideAllModuleInfo(); $(".starterPackage").show(); $("#starterPanelStep2").show(); $("#creditsAmountHolder").show(); viewStarterModules(); theTabs.tabs("select", 1); $(".priceBox .left").hide(); $("#Panel2 .mainContainer .middle .leftContent .infoBox .content").css("background", "url(img/creditsBackgrounds/creditsNewsLetterIcon.png) no-repeat 225px 7px"); $("#Panel3 .mainContainer .middle .leftContent .infoBox .content").css("background", "url(img/creditsBackgrounds/creditsNewsLetterIcon.png) no-repeat 225px 7px"); $("#Panel4 .mainContainer .middle .leftContent .infoBox .content").css("background", "url(img/creditsBackgrounds/creditsNewsLetterIcon.png) no-repeat 225px 7px"); $("#Panel4 .mainContainer .middle .leftContent .packageLabel").html(priserOchBestall_packageStarter); $("#chosenModulesAndExtrasDiv").show(); break; case "Enterprise": resetChosenModules(); hideAllModuleInfo(); $(".enterprisePackage").show(); $("#enterprisePanelStep2").show(); viewEnterpriseModules(); theTabs.tabs("select", 1); $("#Panel2 .mainContainer .middle .leftContent .infoBox .content").css("background", "url(img/enterpriseIcons/starIcon.png) no-repeat 227px 7px"); $("#Panel3 .mainContainer .middle .leftContent .infoBox .content").css("background", "url(img/enterpriseIcons/starIcon.png) no-repeat 227px 7px"); $("#Panel4 .mainContainer .middle .leftContent .infoBox .content").css("background", "url(img/enterpriseIcons/starIcon.png) no-repeat 227px 7px"); $("#Panel4 .mainContainer .middle .leftContent .packageLabel").html(priserOchBestall_packageEnterprise); $("#chosenPackageHolder").show(); $("#allExtrasIncludedDiv").show(); break } $("#chosenPackageSpan").html("Valt paket: " + thePackage); calculatePrice(); ifFirstTab() }); $(".ui-tabs-nav li a").click(function() { $(".forward").show(); $("#orderButtonDiv").hide(); ifFirstTab(); ifLastTab() }); $(".back").live("click", function() { $("#isValidNavigation").val("1"); var theTabs = $("#tabPanel").tabs(); var selectedTab = theTabs.tabs("option", "selected"); if (selectedTab > 0) { var gotoTab = (selectedTab - 1) } theTabs.tabs("select", gotoTab); ifFirstTab(); if (selectedTab == 4) { $(".forward").hide(); $("#orderButtonDiv").show() } else { $(".forward").show(); $("#orderButtonDiv").hide() } return false }); $(".forward").live("click", function() { $("#isValidNavigation").val("1"); var theTabs = $("#tabPanel").tabs(); var selectedTab = theTabs.tabs("option", "selected"); if (selectedTab < 3) { var gotoTab = (selectedTab + 1) } theTabs.tabs("select", gotoTab); ifLastTab(); return false }); $("#acceptTermsBox").click(function() { if ($(this).val() == "1") { $(this).addClass("checkBoxUncheckedCss"); $(this).removeClass("checkBoxCheckedCss"); $(this).val("0") } else { $(this).removeClass("checkBoxUncheckedCss"); $(this).addClass("checkBoxCheckedCss"); $(this).val("1") } if (isContactFormValid()) { enableButton($("#orderButtonDiv")) } else { disableButton($("#orderButtonDiv")) } }); $("#acceptTermsSpan").click(function() { if ($("#acceptTermsBox").val() == "1") { $("#acceptTermsBox").addClass("checkBoxUncheckedCss"); $("#acceptTermsBox").removeClass("checkBoxCheckedCss"); $("#acceptTermsBox").val("0") } else { $("#acceptTermsBox").removeClass("checkBoxUncheckedCss"); $("#acceptTermsBox").addClass("checkBoxCheckedCss"); $("#acceptTermsBox").val("1") } if (isContactFormValid()) { enableButton($("#orderButtonDiv")) } else { disableButton($("#orderButtonDiv")) } }); $("#seperateBillingAddressBox").click(function() { if ($(this).val() == "1") { $(this).addClass("checkBoxUncheckedCss"); $(this).removeClass("checkBoxCheckedCss"); $("#seperateBillingAddressTable").css("display", "none"); $(this).val("0"); $("#wantsSeperateBillingAddress").val("0") } else { $(this).removeClass("checkBoxUncheckedCss"); $(this).addClass("checkBoxCheckedCss"); $("#seperateBillingAddressTable").css("display", "block"); $(this).val("1"); $("#wantsSeperateBillingAddress").val("1") } if (isContactFormValid()) { enableButton($("#orderButtonDiv")) } else { disableButton($("#orderButtonDiv")) } }); $("#seperateBillingAddressSpan").click(function() { if ($("#seperateBillingAddressBox").val() == "1") { $("#seperateBillingAddressBox").addClass("checkBoxUncheckedCss"); $("#seperateBillingAddressBox").removeClass("checkBoxCheckedCss"); $("#seperateBillingAddressTable").css("display", "none"); $("#seperateBillingAddressBox").val("0"); $("#wantsSeperateBillingAddress").val("0") } else { $("#seperateBillingAddressBox").removeClass("checkBoxUncheckedCss"); $("#seperateBillingAddressBox").addClass("checkBoxCheckedCss"); $("#seperateBillingAddressTable").css("display", "block"); $("#seperateBillingAddressBox").val("1"); $("#wantsSeperateBillingAddress").val("1") } }); $("#startPackageBox").click(function() { if ($("#startPackageCheckBox").val() == "1") { $("#startPackageCheckBox").addClass("checkBoxUncheckedCss"); $("#startPackageCheckBox").removeClass("checkBoxCheckedCss"); $("#startPackageCheckBox").val("0"); $("#hasStartPackage").val("0") } else { $("#startPackageCheckBox").removeClass("checkBoxUncheckedCss"); $("#startPackageCheckBox").addClass("checkBoxCheckedCss"); $("#startPackageCheckBox").val("1"); $("#hasStartPackage").val("1") } var selectedTab = theTabs.tabs("option", "selected"); if (selectedTab == 2) { calculatePrice() } }); $(".creditsBoxesDiv .creditsBox").hover(function() { $(this).css("background-image", "url(img/creditsBackgrounds/creditsBGhover.png)") }, function() { if ($(this).val() == "1") { $(this).css("background-image", "url(img/creditsBackgrounds/creditsBGchosen.png)") } else { $(this).css("background-image", "none") } }); $(".creditsBoxesDiv .creditsBox").click(function() { $(".creditsBoxesDiv .creditsBox").each(function() { $(this).val("0"); $(this).css("background-image", "none"); $(this).find(".radioButton").css("background-image", "url(img/creditsBackgrounds/creditsRadioUnSelected.png)") }); $(this).css("background-image", "url(img/creditsBackgrounds/creditsBGhover.png)"); $(this).find(".radioButton").css("background-image", "url(img/creditsBackgrounds/creditsRadioSelected.png)"); $(this).val("1"); switch ($(this).attr("id")) { case "creditsChoise1": $("#numberOfCredits").val(eval(creditsAmount1)); break; case "creditsChoise2": $("#numberOfCredits").val(eval(creditsAmount2)); break; case "creditsChoise3": $("#numberOfCredits").val(eval(creditsAmount3)); break; case "creditsChoise4": $("#numberOfCredits").val(eval(creditsAmount4)); break; default: $("#numberOfCredits").val(eval(creditsAmount1)); break } calculatePrice() }); $("#startPackageBox").hover(function() { $(this).find(".topSection .upperLeftCorner").css({ "background-image": "url(img/packageCornersAndEdges/packageUpperLeftCornerOff.png)" }); $(this).find(".topSection .upperEdge").css({ "background-image": "url(img/packageCornersAndEdges/packageUpperEdgeOff.png)" }); $(this).find(".topSection .upperRightCorner").css({ "background-image": "url(img/packageCornersAndEdges/packageUpperRightCornerOff.png)" }); $(this).find(".middleSection .leftEdge").css({ "background-image": "url(img/packageCornersAndEdges/packageLeftEdgeOff.png)" }); $(this).find(".middleSection .contentArea").css({ "background-color": "#E1F4FC", cursor: "pointer" }); $(this).find(".middleSection .rightEdge").css({ "background-image": "url(img/packageCornersAndEdges/packageRightEdgeOff.png)" }); $(this).find(".bottomSection .bottomLeftCorner").css({ "background-image": "url(img/packageCornersAndEdges/packageBottomLeftCornerOff.png)" }); $(this).find(".bottomSection .bottomEdge").css({ "background-image": "url(img/packageCornersAndEdges/packageBottomEdgeOff.png)" }); $(this).find(".bottomSection .bottomRightCorner").css({ "background-image": "url(img/packageCornersAndEdges/packageBottomRightCornerOff.png)" }) }, function() { $(this).find(".topSection .upperLeftCorner").css({ "background-image": "none" }); $(this).find(".topSection .upperEdge").css({ "background-image": "none" }); $(this).find(".topSection .upperRightCorner").css({ "background-image": "none" }); $(this).find(".middleSection .leftEdge").css({ "background-image": "none" }); $(this).find(".middleSection .contentArea").css({ "background-color": "Transparent", cursor: "default" }); $(this).find(".middleSection .rightEdge").css({ "background-image": "none" }); $(this).find(".bottomSection .bottomLeftCorner").css({ "background-image": "none" }); $(this).find(".bottomSection .bottomEdge").css({ "background-image": "none" }); $(this).find(".bottomSection .bottomRightCorner").css({ "background-image": "none" }) }); $(".moduleBox").click(function() { var hiddenField; if ($("#chosenPackage").val() == "Flex") { switch ($(this).attr("id")) { case "moduleStatistic": hiddenField = $("#hasStatistic"); break; case "moduleNewsletter": hiddenField = $("#hasNewsletter"); break; case "moduleSurvey": hiddenField = $("#hasSurvey"); break; case "moduleSms": hiddenField = $("#hasSms"); break; case "moduleTracking": hiddenField = $("#hasTracking"); break; case "moduleSupport": hiddenField = $("#hasSupport"); break; case "moduleDynamic": hiddenField = $("#hasDynamic"); break; default: break } if ($(this).val() == "1") { $(this).val("0"); hiddenField.val("0"); $(this).find(".checkBoxDiv").css({ "background-image": "url(img/checkBoxUnchecked.png)" }) } else { $(this).val("1"); hiddenField.val("1"); $(this).find(".checkBoxDiv").css({ "background-image": "url(img/checkBoxChecked.png)" }) } calculatePrice() } }); $(".moduleBox").hover(function() { setFocusedModuleFrame($(this)) }, function() { if ($(this).val() == "1") { setSelectedModuleFrame($(this)) } else { clearModuleFrame($(this)) } }); $(".packageBox").hover(function() { $(this).find(".topSection .upperLeftCorner").css({ "background-image": "url(img/packageCornersAndEdges/packageUpperLeftCornerOn.png)" }); $(this).find(".topSection .upperEdge").css({ "background-image": "none" }); $(this).find(".topSection .upperRightCorner").css({ "background-image": "url(img/packageCornersAndEdges/packageUpperRightCornerOn.png)" }); $(this).find(".middleSection .leftEdge").css({ "background-image": "none" }); $(this).find(".middleSection .contentArea").css({ "background-color": "#C4EAFA", cursor: "pointer" }); $(this).find(".middleSection .contentArea .infoBox .middle .content .containerLine").css({ "background-color": "#C4EAFA" }); $(this).find(".middleSection .rightEdge").css({ "background-image": "none" }); $(this).find(".bottomSection .bottomLeftCorner").css({ "background-image": "url(img/packageCornersAndEdges/packageBottomLeftCornerOn.png)" }); $(this).find(".bottomSection .bottomEdge").css({ "background-image": "none" }); $(this).find(".bottomSection .bottomRightCorner").css({ "background-image": "url(img/packageCornersAndEdges/packageBottomRightCornerOn.png)" }) }, function() { $(this).find(".topSection .upperLeftCorner").css({ "background-image": "url(img/packageCornersAndEdges/packageUpperLeftCornerOff.png)" }); $(this).find(".topSection .upperEdge").css({ "background-image": "url(img/packageCornersAndEdges/packageUpperEdgeOff.png)" }); $(this).find(".topSection .upperRightCorner").css({ "background-image": "url(img/packageCornersAndEdges/packageUpperRightCornerOff.png)" }); $(this).find(".middleSection .leftEdge").css({ "background-image": "url(img/packageCornersAndEdges/packageLeftEdgeOff.png)" }); $(this).find(".middleSection .contentArea").css({ "background-color": "#E1F4FC", cursor: "default" }); $(this).find(".middleSection .contentArea .infoBox .middle .content .containerLine").css({ "background-color": "#E1F4FC" }); $(this).find(".middleSection .rightEdge").css({ "background-image": "url(img/packageCornersAndEdges/packageRightEdgeOff.png)" }); $(this).find(".bottomSection .bottomLeftCorner").css({ "background-image": "url(img/packageCornersAndEdges/packageBottomLeftCornerOff.png)" }); $(this).find(".bottomSection .bottomEdge").css({ "background-image": "url(img/packageCornersAndEdges/packageBottomEdgeOff.png)" }); $(this).find(".bottomSection .bottomRightCorner").css({ "background-image": "url(img/packageCornersAndEdges/packageBottomRightCornerOff.png)" }) }); $("#orderButtonDiv").click(function() { if ($(this).val() == "1") { if ($("#wantsSeperateBillingAddress").val() == "1") { $(".seperateBillingAddressRow").css({ display: "none" }) } $("#showReceipt").val("1"); eval(getOrderButtonPostBack) } }); $("#contactFormTable input").blur(function() { var cellID = $(this).parent().attr("id"); var textBoxString = jQuery.trim($(this).val()); var errorString = getErrorString(cellID, textBoxString); if (errorString != "") { turnInvalidTextField($(this)); $(this).css("color", "#e41111"); showErrorBox(cellID, errorString) } else { turnValidTextField($(this)); $(this).css("color", "#333333"); hideErrorBox(cellID) } if (isContactFormValid()) { enableButton($("#orderButtonDiv")) } else { disableButton($("#orderButtonDiv")) } }); $("#contactFormTable input").keyup(function(event) { var cellID = $(this).parent().attr("id"); var textBoxString = jQuery.trim($(this).val()); if (getErrorString(cellID, textBoxString) == "") { turnValidTextField($(this)); $(this).css("color", "#333333"); hideErrorBox(cellID) } if (isContactFormValid()) { enableButton($("#orderButtonDiv")) } else { disableButton($("#orderButtonDiv")) } }); $("input[name='radioPaymentType']").click(function() { calculatePrice() }); $("#tabPanel").show() }); var globalEvent; var globalUi; function resetCredits() { $(".creditsBoxesDiv .creditsBox").each(function() { $(this).val("0"); $(this).css("background-image", "none"); $(this).find(".radioButton").css("background-image", "url(img/creditsBackgrounds/creditsRadioUnSelected.png)") }); $("#creditsChoise1").css("background-image", "url(img/creditsBackgrounds/creditsBGchosen.png)"); $("#creditsChoise1").find(".radioButton").css("background-image", "url(img/creditsBackgrounds/creditsRadioSelected.png)"); $("#creditsChoise1").val("1"); $("#numberOfCredits").val(eval(creditsAmount1)) } function downloadPdf() { eval(getPdfButtonPostBack); return false } function enableButton(a) { $(a).find("table").removeClass("disabledButtonTable"); $(a).find("table").addClass("enabledButtonTable"); $(a).find(".disabledButtonLeftCell").addClass("enabledButtonLeftCell"); $(a).find(".disabledButtonLeftCell").removeClass("disabledButtonLeftCell"); $(a).find(".disabledButtonMiddleCell").addClass("enabledButtonMiddleCell"); $(a).find(".disabledButtonMiddleCell").removeClass("disabledButtonMiddleCell"); $(a).find(".disabledButtonRightCell").addClass("enabledButtonRightCell"); $(a).find(".disabledButtonRightCell").removeClass("disabledButtonRightCell"); $(a).val("1") } function disableButton(a) { $(a).find("table").removeClass("enabledButtonTable"); $(a).find("table").addClass("disabledButtonTable"); $(a).find(".enabledButtonLeftCell").addClass("disabledButtonLeftCell"); $(a).find(".enabledButtonLeftCell").removeClass("enabledButtonLeftCell"); $(a).find(".enabledButtonMiddleCell").addClass("disabledButtonMiddleCell"); $(a).find(".enabledButtonMiddleCell").removeClass("enabledButtonMiddleCell"); $(a).find(".enabledButtonRightCell").addClass("disabledButtonRightCell"); $(a).find(".enabledButtonRightCell").removeClass("enabledButtonRightCell"); $(a).val("0") } function ifExtraTab() { var b = $("#tabPanel").tabs(); var a = b.tabs("option", "selected"); if (a == 2) { $(".priceBox").hide() } else { $(".priceBox").show() } } function ifFirstTab() { var b = $("#tabPanel").tabs(); var a = b.tabs("option", "selected"); if (a == 0) { $(".priceBox").hide() } else { $(".priceBox").show() } } function ifLastTab() { var b = $("#tabPanel").tabs(); var a = b.tabs("option", "selected"); viewChosenModules(); if (a == 3) { $(".forward").hide(); $("#orderButtonDiv").show() } else { $(".forward").show(); $("#orderButtonDiv").hide() } } function viewChosenModules() { var a = $("#orderedModules"); if (hasNewsletter()) { $(".confirmSubscribeDiv").show() } else { $(".confirmSubscribeDiv").hide() } if (hasStatistic()) { $(".confirmStatisticsDiv").show() } else { $(".confirmStatisticsDiv").hide() } if (hasSurvey()) { $(".confirmPollDiv").show() } else { $(".confirmPollDiv").hide() } if (hasSms()) { $(".confirmSmsDiv").show() } else { $(".confirmSmsDiv").hide() } if (hasTracking()) { $(".confirmTrackingDiv").show() } else { $(".confirmTrackingDiv").hide() } if (hasDynamic()) { $(".confirmDynamicFunctionsDiv").show() } else { $(".confirmDynamicFunctionsDiv").hide() } if (hasSupport()) { $(".confirmSupportDiv").show() } else { $(".confirmSupportDiv").hide() } } function hideAllModuleInfo() { $(".professionalPackage, .flexPackage, .starterPackage, .enterprisePackage").hide() } function resetChosenModules() { $("#hasNewsletter, #hasStatistic, #hasSurvey, #hasSms, #hasTracking, #hasDynamic, #hasSupport, #hasStartPackage").val("0"); $("#chosenNewsletter, #chosenStatistic, #chosenSurvey, #chosenSms, #chosenTracking, #chosenDynamic, #chosenSupport, #chosenStartPackage").hide(); $("#moduleSurvey, #moduleDynamic, #moduleSms, #moduleTracking, #moduleNewsletter, #moduleStatistic, #moduleSupport").show(); $("#moduleNewsletter, #moduleStatistic, #moduleSupport, #moduleSurvey, #moduleDynamic, #moduleSms, #moduleTracking").removeClass("disabled").addClass("checked"); $("#payMonth").attr("checked", true); $("#discountHolder").hide(); $("#discountText").html(""); $("#discountPrice").html(""); $("#startPackageHolder").hide(); $("#startPackageText").html(""); $("#startPackagePrice").html(""); $("#startPackageCheckBox").addClass("checkBoxUncheckedCss"); $("#startPackageCheckBox").removeClass("checkBoxCheckedCss"); $(".moduleBox").val("0"); $(".moduleBox .checkBoxDiv").css({ "background-image": "url(img/checkBoxUnchecked.png)" }); clearModuleFrame($(".moduleBox")) } function setFocusedModuleFrame(a) { $(a).find(".top .upperLeftCorner").css({ "background-image": "url(img/moduleBoxCornersAndEdges/onLeftTopCorner.png)" }); $(a).find(".top .upperEdge").css({ "background-image": "url(img/moduleBoxCornersAndEdges/onTopEdge.png)" }); $(a).find(".top .upperRightCorner").css({ "background-image": "url(img/moduleBoxCornersAndEdges/onRightTopCorner.png)" }); $(a).find(".middle .leftEdge").css({ "background-image": "url(img/moduleBoxCornersAndEdges/onLeftEdge.png)" }); $(a).find(".middle .content").css({ "background-color": "#e1f4fb" }); $(a).find(".middle .rightEdge").css({ "background-image": "url(img/moduleBoxCornersAndEdges/onRightEdge.png)" }); $(a).find(".bottom .bottomLeftCorner").css({ "background-image": "url(img/moduleBoxCornersAndEdges/onLeftBottomCorner.png)" }); $(a).find(".bottom .bottomEdge").css({ "background-image": "url(img/moduleBoxCornersAndEdges/onBottomEdge.png)" }); $(a).find(".bottom .bottomRightCorner").css({ "background-image": "url(img/moduleBoxCornersAndEdges/onRightBottomCorner.png)" }) } function clearModuleFrame(a) { $(a).find(".top .upperLeftCorner").css({ "background-image": "none" }); $(a).find(".top .upperEdge").css({ "background-image": "none" }); $(a).find(".top .upperRightCorner").css({ "background-image": "none" }); $(a).find(".middle .leftEdge").css({ "background-image": "none" }); $(a).find(".middle .content").css({ "background-color": "Transparent" }); $(a).find(".middle .rightEdge").css({ "background-image": "none" }); $(a).find(".bottom .bottomLeftCorner").css({ "background-image": "none" }); $(a).find(".bottom .bottomEdge").css({ "background-image": "none" }); $(a).find(".bottom .bottomRightCorner").css({ "background-image": "none" }) } function setSelectedModuleFrame(a) { $(a).find(".top .upperLeftCorner").css({ "background-image": "url(img/moduleBoxCornersAndEdges/offLeftTopCorner.png)" }); $(a).find(".top .upperEdge").css({ "background-image": "url(img/moduleBoxCornersAndEdges/offTopEdge.png)" }); $(a).find(".top .upperRightCorner").css({ "background-image": "url(img/moduleBoxCornersAndEdges/offRightTopCorner.png)" }); $(a).find(".middle .leftEdge").css({ "background-image": "url(img/moduleBoxCornersAndEdges/offLeftEdge.png)" }); $(a).find(".middle .content").css({ "background-color": "Transparent" }); $(a).find(".middle .rightEdge").css({ "background-image": "url(img/moduleBoxCornersAndEdges/offRightEdge.png)" }); $(a).find(".bottom .bottomLeftCorner").css({ "background-image": "url(img/moduleBoxCornersAndEdges/offLeftBottomCorner.png)" }); $(a).find(".bottom .bottomEdge").css({ "background-image": "url(img/moduleBoxCornersAndEdges/offBottomEdge.png)" }); $(a).find(".bottom .bottomRightCorner").css({ "background-image": "url(img/moduleBoxCornersAndEdges/offRightBottomCorner.png)" }) } function checkNewsletter() { $("#hasNewsletter").val("1"); $("#moduleNewsletter").val("1"); $("#moduleNewsletter .checkBoxDiv").css({ "background-image": "url(img/checkBoxChecked.png)" }) } function viewProfessionalModules() { resetChosenModules(); $("#hasNewsletter, #hasStatistic, #hasSupport, #hasSurvey").val("1"); $("#moduleDynamic, #moduleSms, #moduleTracking").hide(); $("#moduleNewsletter, #moduleStatistic, #moduleSupport, #moduleSurvey").removeClass("checked").addClass("disabled"); $("#panel2Message").html("Professional innehåller följande moduler:") } function viewStarterModules() { resetChosenModules(); $("#hasNewsletter").val("1"); $("#moduleSurvey, #moduleDynamic, #moduleSms, #moduleSupport, #moduleStatistic, #moduleTracking").hide(); $("#moduleNewsletter").removeClass("checked").addClass("disabled"); $("#panel2Message").html("Starter innehåller följande moduler:") } function viewEnterpriseModules() { resetChosenModules(); $("#hasNewsletter, #hasStatistic, #hasTracking, #hasSms, #hasDynamic, #hasSupport, #hasSurvey, #hasStartPackage").val("1"); $("#moduleNewsletter, #moduleStatistic, #moduleSupport, #moduleSurvey, #moduleTracking, #moduleSms, #moduleDynamic").removeClass("checked").addClass("disabled"); $("#panel2Message").html("Enterprise innehåller följande moduler:") } function hasNewsletter() { if ($("#hasNewsletter").val() === "1") { return true } else { return false } } function hasStatistic() { if ($("#hasStatistic").val() === "1") { return true } else { return false } } function hasSurvey() { if ($("#hasSurvey").val() === "1") { return true } else { return false } } function hasSms() { if ($("#hasSms").val() === "1") { return true } else { return false } } function hasTracking() { if ($("#hasTracking").val() === "1") { return true } else { return false } } function hasDynamic() { if ($("#hasDynamic").val() === "1") { return true } else { return false } } function hasSupport() { if ($("#hasSupport").val() === "1") { return true } else { return false } } function hasStartPackage() { if ($("#hasStartPackage").val() === "1") { return true } else { return false } } function isValidNavigation() { if ($("#isValidNavigation").val() === "1") { return true } else { return false } } function showReceipt() { if ($("#showReceipt").val() === "1") { return true } else { return false } } function calculatePrice() { var periodicalPrice = 0; var oneTimePrice = 0; var paymentType = $("input[name='radioPaymentType']:checked").val(); var discountPrice = 0; var startPackagePrice = eval(startPackagePriceString); switch ($("#chosenPackage").val()) { case "Professional": periodicalPrice += eval(packageProfessionalPrice); $("#chosenPackagePrice").html(getPriceString(eval(packageProfessionalPrice) * paymentType)); break; case "Flex": periodicalPrice += hasNewsletter() ? eval(newsletterPrice) : 0; periodicalPrice += hasDynamic() ? eval(dynamicPrice) : 0; periodicalPrice += hasSms() ? eval(smsPrice) : 0; periodicalPrice += hasStatistic() ? eval(statisticsPrice) : 0; periodicalPrice += hasSurvey() ? eval(surveyPrice) : 0; periodicalPrice += hasTracking() ? eval(trackingPrice) : 0; periodicalPrice += hasSupport() ? eval(supportPrice) : 0; $("#chosenModulesHolder").show(); $("#chosenModulesPrice").html(getPriceString(periodicalPrice * paymentType)); break; case "Starter": if ($("#numberOfCredits").val() == eval(creditsAmount1)) { oneTimePrice = eval(creditsPrice1) } else { if ($("#numberOfCredits").val() == eval(creditsAmount2)) { oneTimePrice = eval(creditsPrice2) } else { if ($("#numberOfCredits").val() == eval(creditsAmount3)) { oneTimePrice = eval(creditsPrice3) } else { if ($("#numberOfCredits").val() == eval(creditsAmount4)) { oneTimePrice = eval(creditsPrice4) } else { oneTimePrice = eval(creditsPrice1) } } } } $("#creditsAmountText").html($("#numberOfCredits").val() + " " + priserOchBestall_credits); $("#creditsPrice").html(getPriceString(oneTimePrice)); break; case "Enterprise": periodicalPrice += eval(packageEnterprisePrice); $("#chosenPackagePrice").html(getPriceString(eval(packageEnterprisePrice) * paymentType)); break } periodicalPrice *= paymentType; switch (paymentType) { case "1": $("#paymentTypeText").html(priserOchBestall_monthlyPrice); $("#discountHolder").hide(); $("#discountText").html(""); $("#discountPrice").html(""); break; case "3": $("#paymentTypeText").html(priserOchBestall_quarterlyPrice); discountPrice = Math.round(periodicalPrice * eval(quarterlyDiscountPercentage) / 100); periodicalPrice -= discountPrice; $("#discountHolder").show(); $("#discountText").html(priserOchBestall_discount + " (" + eval(quarterlyDiscountPercentage) + "%)"); $("#discountPrice").html("-" + getPriceString(discountPrice)); break; case "12": $("#paymentTypeText").html(priserOchBestall_yearlyPrice); discountPrice = Math.round(periodicalPrice * eval(yearlyDiscountPercentage) / 100); periodicalPrice -= discountPrice; $("#discountHolder").show(); $("#discountText").html(priserOchBestall_discount + " (" + eval(yearlyDiscountPercentage) + "%)"); $("#discountPrice").html("-" + getPriceString(discountPrice)); break } if (hasStartPackage() && $("#chosenPackage").val() != "Enterprise") { $("#startPackageHolder").show(); $("#startPackageText").html(priserOchBestall_startPackage); $("#startPackagePrice").html(getPriceString(startPackagePrice)); oneTimePrice += startPackagePrice } else { $("#startPackageHolder").hide(); $("#startPackageText").html(""); $("#startPackagePrice").html("") } oneTimePrice = Math.round(oneTimePrice); periodicalPrice = Math.round(periodicalPrice); if (oneTimePrice > 0) { $("#totalOneTimePrice").html(getPriceString(oneTimePrice)); $("#oneOffPayments").show(); $("#oneOffHolder").show() } else { $("#oneOffPayments").hide(); $("#oneOffHolder").hide() } if (periodicalPrice > 0) { $("#totalPeriodicalPrice").html(getPriceString(periodicalPrice)); $("#paymentType").val(paymentType); $("#pricePerTimeUnit").show(); $("#billingPeriodHolder").show(); $("#billingPeriodText").html($("#paymentTypeText").html()) } else { $("#pricePerTimeUnit").hide(); $("#billingPeriodHolder").hide(); $("#chosenModulesHolder").hide(); $("#discountHolder").hide() } if (oneTimePrice > 0 && periodicalPrice > 0) { $("#dumbSpacer").show() } else { $("#dumbSpacer").hide() } } function getErrorString(b, c) { switch (b) { case "companyCell": if (c == "") { return priserOchBestall_enterCompanyName } else { return "" } break; case "orgNrCell": if (c == "") { return priserOchBestall_enterOrgNr } else { if (!organisationsnummer(c)) { return priserOchBestall_nonValidOrgNr } else { return "" } } break; case "nameCell": if (c == "") { return priserOchBestall_enterContact } else { return "" } break; case "addressCell": case "seperateBillingAddressCell": if ($("#wantsSeperateBillingAddress").val() != "1" && b == "seperateBillingAddressCell") { return "" } if (c == "") { return priserOchBestall_enterAddress } else { return "" } break; case "zipCodeCell": case "seperateBillingZipCodeCell": if ($("#wantsSeperateBillingAddress").val() != "1" && b == "seperateBillingZipCodeCell") { return "" } var a = /^([0-9 ])+$/; if (c == "") { return priserOchBestall_enterZipCode } else { if (!a.test(c)) { return priserOchBestall_nonValidZipCode } else { return "" } } break; case "cityCell": case "seperateBillingCityCell": if ($("#wantsSeperateBillingAddress").val() != "1" && b == "seperateBillingCityCell") { return "" } if (c == "") { return priserOchBestall_enterCity } else { return "" } break; case "phoneCell": var a = /^([0-9- ])+$/; if (c == "") { return "" } else { if (!a.test(c)) { return priserOchBestall_nonValidPhoneNumber } else { return "" } } break; case "mobilePhoneCell": var a = /^([0-9- ])+$/; if (c == "") { return "" } else { if (!a.test(c)) { return priserOchBestall_nonValidPhoneNumber } else { return "" } } break; case "emailCell": var a = /^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/; if (c == "") { return priserOchBestall_enterEmail } else { if (!a.test(c)) { return priserOchBestall_nonValidEmail } else { return "" } } break; case "confirmEmailCell": emailString = jQuery.trim($("#emailCell input").val()); if (c == "") { return priserOchBestall_confirmEmail } else { if (c != emailString) { return priserOchBestall_nonMatchingEmail } else { return "" } } break; default: return "" } } function valid(a) { !(/^[A-z0-9]*$/i).test(a.value) ? a.value = a.value.replace(/[^A-z0-9]/ig, "") : null } function showErrorBox(b, a) { switch (b) { case "companyCell": $("#companyErrorBox .errorBoxMessageDiv").html(a); $("#companyErrorBox").show(); break; case "orgNrCell": $("#orgNrErrorBox .errorBoxMessageDiv").html(a); $("#orgNrErrorBox").show(); break; case "nameCell": $("#nameErrorBox .errorBoxMessageDiv").html(a); $("#nameErrorBox").show(); break; case "addressCell": $("#addressErrorBox .errorBoxMessageDiv").html(a); $("#addressErrorBox").show(); break; case "seperateBillingAddressCell": $("#seperateBillingAddressErrorBox .errorBoxMessageDiv").html(a); $("#seperateBillingAddressErrorBox").show(); break; case "zipCodeCell": $("#zipCodeErrorBox .errorBoxMessageDiv").html(a); $("#zipCodeErrorBox").show(); break; case "seperateBillingZipCodeCell": $("#seperateBillingZipCodeErrorBox .errorBoxMessageDiv").html(a); $("#seperateBillingZipCodeErrorBox").show(); break; case "cityCell": $("#cityErrorBox .errorBoxMessageDiv").html(a); $("#cityErrorBox").show(); break; case "seperateBillingCityCell": $("#seperateBillingCityErrorBox .errorBoxMessageDiv").html(a); $("#seperateBillingCityErrorBox").show(); break; case "phoneCell": $("#phoneErrorBox .errorBoxMessageDiv").html(a); $("#phoneErrorBox").show(); break; case "mobilePhoneCell": $("#mobilePhoneErrorBox .errorBoxMessageDiv").html(a); $("#mobilePhoneErrorBox").show(); break; case "emailCell": $("#emailErrorBox .errorBoxMessageDiv").html(a); $("#emailErrorBox").show(); break; case "confirmEmailCell": $("#confirmEmailErrorBox .errorBoxMessageDiv").html(a); $("#confirmEmailErrorBox").show(); break; default: return "" } } function hideErrorBox(a) { switch (a) { case "companyCell": $("#companyErrorBox").hide(); break; case "orgNrCell": $("#orgNrErrorBox").hide(); break; case "nameCell": $("#nameErrorBox").hide(); break; case "addressCell": $("#addressErrorBox").hide(); break; case "seperateBillingAddressCell": $("#seperateBillingAddressErrorBox").hide(); break; case "zipCodeCell": $("#zipCodeErrorBox").hide(); break; case "seperateBillingZipCodeCell": $("#seperateBillingZipCodeErrorBox").hide(); break; case "cityCell": $("#cityErrorBox").hide(); break; case "seperateBillingCityCell": $("#seperateBillingCityErrorBox").hide(); break; case "phoneCell": $("#phoneErrorBox").hide(); break; case "mobilePhoneCell": $("#mobilePhoneErrorBox").hide(); break; case "emailCell": $("#emailErrorBox").hide(); break; case "confirmEmailCell": $("#confirmEmailErrorBox").hide(); break; default: return "" } } function turnInvalidTextField(a) { $(a).parent().removeClass("textFieldMiddleCell"); $(a).parent().addClass("invalidTextFieldMiddleCell"); $(a).parent().parent().find(".textFieldLeftCell").addClass("invalidTextFieldLeftCell"); $(a).parent().parent().find(".textFieldLeftCell").removeClass("textFieldLeftCell"); $(a).parent().parent().find(".textFieldRightCell").addClass("invalidTextFieldRightCell"); $(a).parent().parent().find(".textFieldRightCell").removeClass("textFieldRightCell") } function turnValidTextField(a) { $(a).parent().addClass("textFieldMiddleCell"); $(a).parent().removeClass("invalidTextFieldMiddleCell"); $(a).parent().parent().find(".invalidTextFieldLeftCell").addClass("textFieldLeftCell"); $(a).parent().parent().find(".textFieldLeftCell").removeClass("invalidTextFieldLeftCell"); $(a).parent().parent().find(".invalidTextFieldRightCell").addClass("textFieldRightCell"); $(a).parent().parent().find(".textFieldRightCell").removeClass("invalidTextFieldRightCell") } function getPriceString(c) { var b = ""; var a = 0; var d = "" + c; for (a = 1; a <= d.length; a++) { b = d.charAt(d.length - a) + b; if (a % 3 == 0 && a < d.length) { b = "." + b } } b += " kr"; return b } function organisationsnummer(a) { this.valid = false; a = a.replace(/\s+/g, ""); a = a.replace(/-|/g, ""); if (!a.match(/^(\d{1})(\d{5})(\d{4})$/)) { return false } this.group = RegExp.$1; this.controldigits = RegExp.$3; this.alldigits = this.group + RegExp.$2 + this.controldigits; var c = ""; for (var b = 0; b < this.alldigits.length; b++) { c += ((((b + 1) % 2) + 1) * this.alldigits.substring(b, b + 1)) } this.checksum = 0; for (var b = 0; b < c.length; b++) { this.checksum += c.substring(b, b + 1) * 1 } this.valid = (this.checksum % 10 == 0) ? true : false; return this.valid } function isContactFormValid() { var a = true; if ($("#acceptTermsBox").val() != "1") { return false } $("#contactFormTable input").each(function() { var c = $(this).parent().attr("id"); var d = jQuery.trim($(this).val()); var b = getErrorString(c, d); if (b != "") { a = false; return false } }); return a } function showPopUp(a) { newwindow = window.open(a, "name", "height=600,width=400, resizable=no, scrollbars"); if (window.focus) { newwindow.focus() } return false };