// JavaScript Document function checkMail(mail) { var emailFilter=/^.+@.+\..{2,3}$/; var err = null; if (!(emailFilter.test(mail))) { return false; } var illegalChars= /[\(\)\<\>\,\;\:\\\/\"\[\]]/; if (mail.match(illegalChars)) { return false; } return true; } function checkPhone(phone) { var filter=/^[0-9]{8}$/; if (!(filter.test(phone))) { return false; } return true; } function popupSalidzinat(url) { var name = 'LaptopShop_lv'; var w = 800; var h = 600; var scroll = 'yes'; var resizable = 'yes'; var LeftPosition = (screen.width) ? (screen.width-w)/2 : 100; var TopPosition = (screen.height) ? (screen.height-h)/2 : 100; var settings = 'width=' + w + ',height=' + h + ',top=' + TopPosition + ',left=' + LeftPosition + ',scrollbars=' + scroll + ',location=no,directories=no,status=yes,menubar=no,toolbar=no,resizable=' + resizable + ''; var win1 = window.open(url, name, settings); win1.focus(name); } $(document).ready(function(){ $("a[@rel='popup']").click(function(){ popupSalidzinat(this.href); return false; }); }); function number_format( number, decimals, dec_point, thousands_sep ) { // http://kevin.vanzonneveld.net // + original by: Jonas Raoni Soares Silva (http://www.jsfromhell.com) // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // + bugfix by: Michael White (http://getsprink.com) // + bugfix by: Benjamin Lupton // + bugfix by: Allan Jensen (http://www.winternet.no) // + revised by: Jonas Raoni Soares Silva (http://www.jsfromhell.com) // + bugfix by: Howard Yeend // * example 1: number_format(1234.5678, 2, '.', ''); // * returns 1: 1234.57 var n = number, c = isNaN(decimals = Math.abs(decimals)) ? 2 : decimals; var d = dec_point == undefined ? "." : dec_point; var t = thousands_sep == undefined ? "," : thousands_sep, s = n < 0 ? "-" : ""; var i = parseInt(n = Math.abs(+n || 0).toFixed(c)) + "", j = (j = i.length) > 3 ? j % 3 : 0; return s + (j ? i.substr(0, j) + t : "") + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + t) + (c ? d + Math.abs(n - i).toFixed(c).slice(2) : ""); }