function bevitel_csakszam(e) { var Key = e.keyCode; if (Key == 0) {Key = e.which} if ((Key >= 48 && Key <= 57) || Key == 8 || Key == 9 || Key == 37 || Key == 38 || Key == 39 || Key == 11 || Key == 12 || Key == 46) return true; return false; } function bevitel_csakdb(e) { var Key = e.keyCode; if (Key == 0) {Key = e.which} if ((Key >= 48 && Key <= 57) || Key == 44 || Key == 8 || Key == 9 || Key == 37 || Key == 38 || Key == 39 || Key == 11 || Key == 12 || Key == 46) return true; return false; } $(function() { $.fn.clearForm = function() { return this.each(function() { var type = this.type, tag = this.tagName.toLowerCase(); if (tag == 'form') return $(':input',this).clearForm(); if (type == 'text' || type == 'password' || tag == 'textarea') this.value = ''; else if (type == 'checkbox' || type == 'radio') this.checked = false; else if (tag == 'select') this.selectedIndex = -1; }); }; }); $(document).ready(function() { jQuery("a.nagykep").fancybox({ helpers: { title : { type : 'float' } } }); $('.kedvencekbe').on('click',function(){ // console.log('click'); var id = $(this).data('kedvid'); if ($(this).hasClass('on')) { $(this).removeClass('on'); del_fav(id); } else { $(this).addClass('on'); add_fav(id); } }); $('#keresgomb').click(function(){ document.location.href='/termekek/termeklista/?k=&t=&mitkeres='+$('#mitkeres').val()+'&gyorskereso=1'; }); $('#mitkeres').bind('keydown',function(e){ if (e.keyCode == 13) { document.location.href='/termekek/termeklista/?k=&t=&mitkeres='+$('#mitkeres').val()+'&gyorskereso=1'; return false; } }); $('#pass').bind('keydown',function(e){ if (e.keyCode == 13) { a_login(); } }); }); function add_fav(id) { var url = "/ajax/add_fav_ajax.php"; var data = 'id='+id; var v; $.ajax({ type: "GET", url: url, data: data, success: showResponse_fav_hozzaad }); function showResponse_fav_hozzaad(v) { if (v != "#@error@#no_uid" && v != "#@error@#id_notfound" && v != "#@error@#van" ) { var valasz = v.split("#") var cikkszam = valasz[0]; var ar = valasz[1]; var termeknev = valasz[2]; // $('#kis-kedvencek-ures').remove(); // $('#kis-kedvencek').prepend('
'+termeknev+'
'+ar+',-
'); // $('#kedvcont_'+id).html('Elt�vol�tom a kedvencekb�l'); // $('#kis-kedvencek .termek').slice(9).remove(); $('#kedvcont_'+id).addClass('on'); } else { switch (v) { case "#@error@#no_uid": alert('A kedvencek haszn�lat�hoz bejelentkez�s sz�ks�ges');break; case "#@error@#id_notfound": alert('Nincs ilyen term�k');break; case "#@error@#van": break; } } } } function del_fav(id) { var url = "/ajax/del_fav_ajax.php"; var data = 'id='+id; var v; $.ajax({ type: "GET", url: url, data: data, success: function() { if (v != "#@error@#no_uid" && v != "#@error@#id_notfound" && v != "#@error@#van" ) { // $('#kis-fav'+id).detach(); $('#fav'+id).detach(); // $('#kedvcont_'+id).html('Hozz�ad�s a kedvencekhez'); $('#kedvcont_'+id).removeClass('on'); } else { switch (v) { case "#@error@#no_uid": alert('A kedvencek haszn�lat�hoz bejelentkez�s sz�ks�ges');break; case "#@error@#id_notfound": alert('Nincs ilyen term�k');break; case "#@error@#van": break; } } } }); }