function bookmarkpage(title, url) { if (window.sidebar) { window.sidebar.addPanel(title, url, ""); } else if (window.external) { window.external.AddFavorite(url, title); } else { alert("Sorry! Your browser doesn't support this function."); } } function textCounter(field, countfield, maxlimit) { if (field.value.length > maxlimit) { field.value = field.value.substring(0, maxlimit); } else { //countfield.value = maxlimit - field.value.length; document.getElementById(countfield).innerHTML = maxlimit - field.value.length; } } function TextareaNoNewLine(myfield, e, dec) { var key; var keychar; if (window.event) { key = window.event.keyCode; } else if (e) { key = e.which; } else { return true; } keychar = String.fromCharCode(key); if (key==13) { // Enter key return false; } else { return true; } } function newWindow(mypage,myname,w,h,features) { if (screen.width) { var winl = (screen.width-w)/2; var wint = (screen.height-h)/8; } else { winl = 0; wint = 0; } if (winl < 0) winl = 0; if (wint < 0) wint = 0; var settings = 'height=' + h + ','; settings += 'width=' + w + ','; settings += 'top=' + wint + ','; settings += 'left=' + winl + ','; settings += features; settings += ' scrollbars=yes '; win = window.open(mypage,myname,settings); win.window.focus(); } function checkemail(emailStr) { var checkTLD=false; var knownDomsPat=/^(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum)$/; var emailPat=/^(.+)@(.+)$/; var specialChars="\\(\\)><@,;:\\\\\\\"\\.\\[\\]"; var validChars="\[^\\s" + specialChars + "\]"; var quotedUser="(\"[^\"]*\")"; var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/; var atom=validChars + '+'; var word="(" + atom + "|" + quotedUser + ")"; var userPat=new RegExp("^" + word + "(\\." + word + ")*$"); var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$"); var matchArray=emailStr.match(emailPat); var alert_message = 'Please, check E-mail address.'; if (matchArray==null) { alert(alert_message); return false; } var user=matchArray[1]; var domain=matchArray[2]; for (i=0; i127) { alert(alert_message); return false; } } for (i=0; i127) { alert(alert_message); return false; } } if (user.match(userPat)==null) { alert(alert_message); return false; } var IPArray=domain.match(ipDomainPat); if (IPArray!=null) { for (var i=1;i<=4;i++) { if (IPArray[i]>255) { alert(alert_message); return false; } } return true; } var atomPat=new RegExp("^" + atom + "$"); var domArr=domain.split("."); var len=domArr.length; for (i=0;i -1)) { // numbers return true; } else if (dec && (keychar == ".")) { // decimal point jump myfield.form.elements[dec].focus(); return false; } else { return false; } } function changeInputs() { var els = document.getElementsByTagName('input'); var elsLen = els.length; for ( i=0; i= 1) { } else { GCenterTableWidth = 950; } function CenterMainTable() { if (document.getElementById) { if (document.getElementById('HtmlPageBody')) { if (GCenterTableWidth >= 600) { var WSize = getWindowSize(); var WindowWidth = WSize[0]; if (WindowWidth > GCenterTableWidth + 20) { var MarginLeft = (WindowWidth - GCenterTableWidth) / 2 - 10; if (MarginLeft >=1) { window.document.getElementById('HtmlPageBody').style.marginLeft = MarginLeft +'px'; } } else if (WindowWidth >= 1 && WindowWidth < GCenterTableWidth + 20) { window.document.getElementById('HtmlPageBody').style.marginLeft = 0; } } } } } function preloadImages() { if(document.images) { if(!document.preloadImagesArray) { document.preloadImagesArray = new Array(); } var i,j = document.preloadImagesArray.length; functionArgumentsArray = preloadImages.arguments; for(i=0; i