function openInWindow(_url,_width, _height) { if (_width<1) { _width = 300; } if (_height<1) { _height = 300; } window.open(_url,'','status=no,width='+(_width+20)+',height='+(_height+20)+',screenX=50,screenY=50,left=50,top=50'); } function openTest(numer) { openInWindow('http://www.hards.pl/old/tester/index.php?test_id='+numer,700, 500); } function htmlspecialchars(s) { s = String(s); if (s.length==0) { return s; } s = s.replace(/&/,'&'); s = s.replace(//,'>'); s = s.replace(/"/,'"'); return s; } function ehtmlspecialchars(s) { s = String(s); if (s.length==0) { return s; } s = s.replace(/&/,'&'); s = s.replace(//,'>'); s = s.replace(/"/,'"'); s = s.replace(/<[bB]>/,''); s = s.replace(/<\/[bB]>/,''); s = s.replace(/<[iI]>/,''); s = s.replace(/<\/[iI]>/,''); s = s.replace(/<[sS][uU][pP]>/,''); s = s.replace(/<\/[sS][uU][pP]>/,''); return s; } function isEmailValid(emailstring) { if (!emailstring.match(/^[a-z0-9+]{1}[a-z_0-9-\.]*@[a-z0-9]{1}[a-z0-9-]*(\.[a-z0-9]{1}[a-z0-9-]*)+$/gi)) { return false; } return true; }