var pathname = window.location.pathname; //if menu_drop -> maplane margin-top += menu_drop.height() function maplaneMsg(data) { var $ = jQuery.noConflict(); if (parseInt(data.succ) === 1) { $(".maplane").addClass('succ'); if (pathname === '/') $("#site").css("margin-top", 138); else $("#site").css("margin-top", 105); } else { $(".maplane").addClass('error'); if (pathname === '/') $("#site").css("margin-top", 138); else $("#site").css("margin-top", 105); } var tmpMapContent = $(".mapContent").html(); $(".mapContent").text(data.msg); var clearI = setInterval(function(del) { $(".maplane").removeClass('error succ'); $(".mapContent").html(tmpMapContent); if (pathname === '/') $("#site").css("margin-top", 138); else $("#site").css("margin-top", 0); clearInterval(clearI); }, 5000); } $(document).ready(function(){ var $ = jQuery.noConflict(); $("#search").click(function () { // Set the effect type var effect = 'slide'; // Set the options for the effect type chosen var options = { direction: 'right' }; // Set the duration (default: 400 milliseconds) var duration = 700; $('#searchDiv').slideToggle(); $('#searchinput').focus(); }); $("#search404").click(function () { // Set the effect type var effect = 'slide'; // Set the options for the effect type chosen var options = { direction: 'right' }; // Set the duration (default: 400 milliseconds) var duration = 700; $('#searchDiv').slideToggle(); $('#searchinput').focus(); }); /*var $ = jQuery.noConflict(); $('#newsletter') .mouseenter(function() { $('#newsletter').animate({ 'marginLeft' : 0 }, 200); }) .mouseleave(function() { $('#newsletter').animate({ 'marginLeft' : -222 }, 200); });*/ var $ = jQuery.noConflict(); $("#timeSubmit").on("click",function(){ var name = $('#timeName').val(); var phone = $('#timePhone').val(); var mail = $('#timeEmail').val(); var category = $('#timeCategory').val(); var ora = $('#ora').val(); var dressingDate = $('#timeDate').val(); var city = $('#timeCity').val(); var dressingDate2 = $('#timeDate2').val(); var comment = $('#timeComment').val(); $.ajax({ type:"post", url:"https://elizabethnardo.hu/caller.php", data:{name: name, mail: mail, category: category, phone: phone, dressingdate: dressingDate, city: city, dressingdate2: dressingDate2, comment: comment, ora: ora, f: 'time'}, dataType:"json", success: function(data) { maplaneMsg(data); if (data.succ === 1) { setTimeout(function() { window.location.href = "/"; }, 3000); } } }); }); /*var $ = jQuery.noConflict(); $("#timeDate2").on("change",function(){ var datum = $(this).val(); $.ajax({ type:"get", url:"https://elizabethnardo.hu/caller.php", data:{datum: datum, f: 'getTimeToTime'}, dataType:"json", success: function(data) { maplaneMsg(data); } }); });*/ // vendégkönyv var $ = jQuery.noConflict(); $("#SubmitVend").on("click",function(){ var v_uzi = $('textarea[name=v_uzi]').val(); var v_nick = $('input[name=v_nick]').val(); alert(v_nick); $.ajax({ type:"post", url:"https://elizabethnardo.hu/caller.php", data:{v_nick: v_nick, v_uzi: v_uzi, f: 'vendegk'} }).done(function (data) {}); }); //hírlevél feliratkozás var $ = jQuery.noConflict(); $("#newsLetterSubmit").on("click",function(){ var name = $('#newsLetterName').val(); var mail = $('#newsLetterMail').val(); $.ajax({ type:"get", url:"https://elizabethnardo.hu/caller.php", data:{name: name, mail: mail, f: 'addNewsletter'}, dataType:"json", success: function(data) { maplaneMsg(data, true); } }); }); /////////////BEJELENTKEZES function login() { var $ = jQuery.noConflict(); $.ajax({ type:"post", url:"https://elizabethnardo.hu/classes/loginmethod.php", data:$("#loginForm").serialize(), dataType:"json", success: function(data) { maplaneMsg(data); if (data.user) $(".login").html('