function isArrowKey(a){var b=a.keyCode?a.keyCode:a.charCode;if(b>=37&&b<=40)return true}function setCurrency(a){$.ajax({type:"POST",url:baseDir+"changecurrency.php",data:"id_currency="+parseInt(a),success:function(a){location.reload(true)}})}function floorf(a,b){if(typeof b=="undefined")b=0;var c=b==0?1:Math.pow(10,b);var d=a*c;var e=d.toString();if(e.indexOf(".")===false)return a;if(e.charAt(e.length-1)==0)return a;return Math.floor(d)/c}function ceilf(a,b){if(typeof b=="undefined")b=0;var c=b==0?1:Math.pow(10,b);var d=a*c;var e=d.toString();if(e.indexOf(".")===false)return a;if(e.charAt(e.length-1)==0)return a;return Math.ceil(d)/c}function emptyCustomizations(){if(typeof customizationFields=="undefined")return;for(var a=0;a<customizationFields.length;a++){$("#"+customizationFields[a][0]).html("");$("#"+customizationFields[a][0]).val("")}}function checkCustomizations(){var a=new RegExp(" ?filled ?");if(typeof customizationFields!="undefined")for(var b=0;b<customizationFields.length;b++)if(parseInt(customizationFields[b][1])==1&&($("#"+customizationFields[b][0]).html()==""||$("#"+customizationFields[b][0]).html()!=$("#"+customizationFields[b][0]).val())&&!a.test($("#"+customizationFields[b][0]).attr("class")))return false;return true}function writeBookmarkLinkObject(a,b,c){if(window.navigator.userAgent.indexOf("Chrome")!=-1)return"";else if(window.sidebar||window.external)return"<a href=\"javascript:addBookmark('"+escape(a)+"', '"+escape(b)+"')\">"+c+"</a>";else if(window.opera&&window.print)return'<a rel="sidebar" href="'+escape(a)+'" title="'+escape(b)+'">'+c+"</a>";return""}function writeBookmarkLink(a,b,c,d){var e="";if(d)e=writeBookmarkLinkObject(a,b,'<img src="'+d+'" alt="'+escape(c)+'" title="'+escape(c)+'" />')+"&nbsp";e+=writeBookmarkLinkObject(a,b,c);document.write(e)}function addBookmark(a,b){if(window.sidebar)return window.sidebar.addPanel(b,a,"");else if(window.external)return window.external.AddFavorite(a,b);else if(window.opera&&window.print)return true;return true}function toggleElemValue(a,b,c){var d=document.getElementById(a);if(d)d.value=!d.value||d.value==c?b:c}function openCloseAllDiv(a,b){var c=$("*[name="+a+"]");for(var d=0;d<c.length;++d)toggle(c[d],b)}function showElemFromSelect(a,b){var c=document.getElementById(a);for(var d=0;d<c.length;++d){var e=document.getElementById(b+c.options[d].value);if(e!=null)toggle(e,d==c.selectedIndex)}}function toggleMultiple(a){var b=a.length;for(var c=0;c<b;c++)if(a[c].style)toggle(a[c],a[c].style.display=="none")}function toggle(a,b){a.style.display=b?"":"none"}function autoUrlNoList(a,b){var c;c=document.getElementById(a).checked;location.href=b+(c==true?1:0);return}function autoUrl(a,b){var c;var d;d=document.getElementById(a);c=d.options[d.selectedIndex].value;if(c!=0)location.href=b+c;return}function ps_round(a,b){if(typeof roundMode=="undefined")roundMode=2;if(typeof b=="undefined")b=2;method=roundMode;if(method==0)return ceilf(a,b);else if(method==1)return floorf(a,b);precisionFactor=b==0?1:Math.pow(10,b);return Math.round(a*precisionFactor)/precisionFactor}$().ready(function(){$("form").submit(function(){$(this).find(".hideOnSubmit").hide()})})
