function checkEnter(e){ var characterCode; if(e && e.which){ //if which property of event object is supported (NN4) e = e characterCode = e.which //character code is contained in NN4's which property } else{ e = event characterCode = e.keyCode //character code is contained in IE's keyCode property } if(characterCode == 13){ //if generated character code is equal to ascii 13 (if enter key) return false; } else{ return true; } } function Top() { $(window).scrollTo( $("#page"), 800 ); } function Back() { history.back(); } function TTop(objname) { $(window).scrollTo( $("#"+objname), 800 ); } function ToPage(href) { window.location.href = href; } function IsValidObject(objToTest) { if (objToTest == null || objToTest == undefined) { return false; } return true; } function SubmitForm(formname) { var form = document.getElementById(formname); if (IsValidObject(form)) { form.submit(); } } function addOption(selectId, txt, val) { var objOption = new Option(txt, val); document.getElementById(selectId).options.add(objOption); } function selOption(selectId,val) { document.getElementById(selectId).selectedIndex = val; } function clearOptions(selectId) { var lb = document.getElementById(selectId); for (var i=lb.options.length-1; i>=0; i--){ lb.options[i] = null; } lb.selectedIndex = -1; } function Filter(submodule,id,page,sort) { link = "/?m=show"; var brand = document.getElementById('brand'); var size = document.getElementById('size'); var price = document.getElementById('price'); var word = document.getElementById('word').value; if (submodule!="") { link = link + "&s="+submodule; } if (word!="") { link = link + "&word="+word; } if (id!="") { link = link + "&id="+id; } if (page!="") { link = link + "&p="+page; } if (sort!="") { link = link + "&o="+sort; } if (brand.selectedIndex!=0) { link = link + "&brand="+brand.value; } if (size.selectedIndex!=0) { link = link + "&size="+size.value; } if (price.selectedIndex!=0) { link = link + "&price="+price.value; } ToPage(link); } function FFilter(submodule,id,page,sort) { link = "/show"; var brand = document.getElementById('brand'); var size = document.getElementById('size'); var price = document.getElementById('price'); var word = document.getElementById('word').value; if (submodule!="") { link = link + "/"+submodule; } if (word!="") { link = link + "&word="+word; } if (id!="") { link = link + "/"+id; } if (sort!="") { link = link + "/sort"+sort; } if (brand.selectedIndex!=0) { link = link + "/brand"+brand.value; } if (size.selectedIndex!=0) { link = link + "/size-"+size.value; } if (price.selectedIndex!=0) { link = link + "/price"+price.value; } if (page!="") { link = link + "/page"+page+".html"; } ToPage(link); } function ShowA(display) { if (display==true) { $("#secAAddress").slideDown('fast'); } else { $("#secAAddress").slideUp('fast'); } } function ShowInformation(info) { jAlert(info, 'Informacja'); } function HideWait() { $('#dialog').jqmHide(); } function Search() { var word = document.getElementById('word').value; if (word.length<3) { ShowInformation("Proszę podać min. 3 znaki!"); } else { ToPage("/?m=show&s=search&word="+word); } } function SearchAdv() { var w = document.getElementById('word1').value; document.getElementById('word').value = w; var b = document.getElementById('brand'); var a = document.getElementById('cid'); var z = document.getElementById('size'); var p = document.getElementById('price'); if ((w.length<3) && (b.selectedIndex==0) && (a.selectedIndex==0) && (z.selectedIndex==0) && (p.selectedIndex==0)) { ShowInformation("Proszę podać kryterium wyszukiwania!"); } else { param = ""; if (w.length>=3) { param = param + "&word="+w; } if (b.selectedIndex!=0) { param = param + "&brand="+b.value; } if (a.selectedIndex!=0) { param = param + "&cid="+a.value; } if (z.selectedIndex!=0) { param = param + "&size="+z.value; } if (p.selectedIndex!=0) { param = param + "&price="+p.value; } ToPage("/?m=show&s=search"+param); } } function Registration() { $('#dialog').jqmShow(); xajax_Registration(xajax.getFormValues('regFrm')); } function Add2Cart(id) { $('#dialog').jqmShow(); xajax_Add2Cart(id); } function DelItem(id) { $('#dialog').jqmShow(); xajax_DelItem(id); } function RecountCart() { $('#dialog').jqmShow(); xajax_RecountCart(xajax.getFormValues('cartFrm')); } function RecountOrder() { $('#dialog').jqmShow(); xajax_RecountOrder(xajax.getFormValues('ordFrm')); } function Purchase() { $('#dialog').jqmShow(); xajax_Purchase(xajax.getFormValues('ordFrm')); } function Login() { $('#dialog').jqmShow(); xajax_Login(xajax.getFormValues('loginFrm')); } function Logout() { $('#dialog').jqmShow(); xajax_Logout(); } function UpdatePa() { $('#dialog').jqmShow(); xajax_UpdatePa(xajax.getFormValues('passFrm')); } function UpdateData() { $('#dialog').jqmShow(); xajax_UpdateData(xajax.getFormValues('regFrm')); } $().ready(function(){ $(function() { $('#gallery a').lightBox(); }); $('#dialog') .jqm({ trigger:'#dialogTrigger', overlay: 0, onShow: function(h) { /* callback executed when a trigger click. Show notice */ h.w.fadeIn(); }, onHide: function(h) { /* callback executed on window hide. Hide notice, overlay. */ h.w.fadeOut("fast",function() { if(h.o) h.o.remove(); }); } }); $('div[id*="secOrderDetails"]').each(function() { $(this).hide(); }); $('a[id*="orderlnk"]').toggle(function(){ var orderid = $(this).attr('id'); var oid = orderid.replace("orderlnk", ""); if ($("#secOrderDetails"+oid).is(":hidden")) { $("#secOrderDetails"+oid).slideDown('slow'); } else { $("#secOrderDetails"+oid).slideUp('slow'); } },function(){ var orderid = $(this).attr('id'); var oid = orderid.replace("orderlnk", ""); if ($("#secOrderDetails"+oid).is(":visible")) { $("#secOrderDetails"+oid).slideUp('slow'); } else { $("#secOrderDetails"+oid).slideDown('slow'); } }); });