var isIE = false; var IEversion = 0; { var ua = navigator.userAgent.toLowerCase(); isIE = ( (ua.indexOf('msie') != -1) && (ua.indexOf('opera') == -1) && (ua.indexOf('webtv') == -1) ); // browser name IEversion = parseFloat(navigator.appVersion); // browser version if (isIE && IEversion >= 4) { IEversion = parseFloat( ua.substring( ua.indexOf('msie ') + 5 ) ); // correct version number } } function isBirthYear(_year) { if (_year.search(/^[1-2]{1}[0-9]{3}$/gi)!=-1) { var numer = parseInt(_year); var today = new Date(); if (numer<1800|| numer>today.getFullYear()) { return false; } return true; } return false; } 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; } function getPageSize(){ var xScroll, yScroll; if (window.innerHeight && window.scrollMaxY) { xScroll = document.body.scrollWidth; yScroll = window.innerHeight + window.scrollMaxY; } else if (document.body.scrollHeight > document.body.offsetHeight){ xScroll = document.body.scrollWidth; yScroll = document.body.scrollHeight; } else { xScroll = document.body.offsetWidth; yScroll = document.body.offsetHeight; } var windowWidth, windowHeight; if (self.innerHeight) { windowWidth = self.innerWidth; windowHeight = self.innerHeight; } else if (document.documentElement && document.documentElement.clientHeight) { windowWidth = document.documentElement.clientWidth; windowHeight = document.documentElement.clientHeight; } else if (document.body) { windowWidth = document.body.clientWidth; windowHeight = document.body.clientHeight; } if(yScroll < windowHeight){ pageHeight = windowHeight; } else { pageHeight = yScroll; } if(xScroll < windowWidth){ pageWidth = windowWidth; } else { pageWidth = xScroll; } arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) return arrayPageSize; } function confirmBox(htmlstring,width,height,type) { if (width<300) width = 300; if (height < 170) height = 170; var pageSize = new Array(); pageSize = getPageSize(); var parameters = [htmlstring,type]; var rv = window.showModalDialog('tak_nie.php',parameters,'dialogHeight: '+height+'px;dialogWidth: '+width+'px;center: yes;help: no;resizable: no;scroll: no;status: no; dialogTop:'+((pageSize[3] - height)/ 2)+'px; dialogLeft:'+((pageSize[2] - width)/ 2)+'px;'); if (rv == 1) return true; return false; } 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 openInWindow2(_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,resizable=1,scrollbars=auto'); } function urlencode(s) { var hexDigit = '0123456789ABCDEF'; var ns = ''; var z = ''; s = String(s); for(i=0;i=97 && z<=122) || (z>=65 && z <= 90) || (z>=48 && z <= 57)) { ns += s.charAt(i); } else { ns += '%'+hexDigit.charAt((z&0xF0)>>>4)+hexDigit.charAt(z&0x0F); } } return ns; } function isCorrectBrowser(_version) { return true; /** if (browser.isIE && browser.versionMinor>=_version))) return true else return false; **/ } // 0x09-0x0D, 0x20 function isspace(s) { return ((s>='\t'&&s<='\r')||s==' ')?true:false; } function isalpha(s) { return ((s>='a'&&s<='z')||(s>='A'&&s<='Z'))?true:false; } function uclcwords2(s) { s = String(s); //s = s.charAt(0).toUpperCase() + ; s = s.replace(/^(.{0})(.)/g, function ( mama ) { return mama.toUpperCase ( ); } ); return s.replace(/(\s|\-)(.)/g, function ( mama ) { return mama.toUpperCase ( ); } ); /* arrrrrrr = s.split("-"); wrd = ''; for(i=0; i 0){ wrd += '-' + (arrrrrrr[i]); }else{ wrd += (arrrrrrr[i]); } } alert(wrd); //uclcwords(s); //return wrd; */ } function uclcwords(s) { s = String(s); var ns = ''; var wspc = true; var walpha = false; if (s.length==0) { return s; } for(i=0;i d2 1 // d1 == d2 0 // d1 < d2 -1 if (y1==y2 && m1==m2 && d1==d2) { return 0; } if (y1>y2 || (y1==y2 && m1>m2) || (y1==y2 && m1==m2 && d1>d2)) { return 1; } return -1; } function isDateCorrect(y1,m1,d1) { if (y1<2003 || m1>12 || m1<1 || d1>31 || d1<1) { return false; } return true; } var wh_pon = null; function autorPonaglenie(abstrakt_id) { if (wh_pon != null) { wh_pon.close(); } wh_pon = window.open('mail_druk.php?druk=PONAGLENIE_AUTOR&abstrakt_id='+abstrakt_id,'wh_pon','status=no,width=620,height=500,screenX=50,screenY=50,left=50,top=50,scrollbars=1'); wh_pon.focus(); } function htmlspecialchars(s) { s = String(s); if (s.length==0) { return s; } s = s.replace(/&/,'&'); s = s.replace(//,'>'); s = s.replace(/"/,'"'); return s; } /** liczba, ile ma miec znakow (wypelniane jest zerami z przodu) **/ function makeIDFromNumber(_numer, _fillto) { s = String(_numer); _fillto -= s.length; while(_fillto-->0) { s = '0'+s; } return s; }