var myArray = new Array(); function freeIndex(o) { var i; for (i=0; i0) i++; o[i] = null; return i; } // Részletes adatok lenyitása/becsukása // ==================================== var current_user = -1; function look(id) { var div; var div_p; // ha mar meg van nyitva vmi, bezarjuk if (current_user != -1) { div = document.getElementById(current_user); if (div) { div_p = div.parentNode.parentNode; div_p.className = "displaynone"; div.className = "displaynone"; } } // ha nem a megnyitottra kattintottunk if (current_user != id) { div = document.getElementById(id); div_p = div.parentNode.parentNode; div_p.className = "displaytr"; div.className = "displayblock"; current_user = id; } else { current_user = -1; } } // Jelszó erősségének ellenőrzése // ============================== function checkpwd(o) { var idx = freeIndex(myArray); myArray[idx] = o; setTimeout("checkpwd2(" + idx + ")", 10); } function checkpwd2(idx) { var o = myArray[idx]; myArray[idx] = null; var checkdata = o.value; if (checkdata.length > 5) { var strong = getPwdStrength(checkdata); document.getElementById('correct').className = 'showed'; document.getElementById('false').className = 'hidden'; if (strong < 3) { document.getElementById('pwdtext').innerHTML = 'Gyenge jelszó'; } else if (strong >= 3 && strong < 5) document.getElementById('pwdtext').innerHTML = 'Közepes jelszó'; else document.getElementById('pwdtext').innerHTML = 'Erős jelszó'; var w = 41; if (strong > 1) w += 27; if (strong > 2) w += 23; if (strong > 3) w += 18; if (strong > 4) w += 32; if (strong > 5) w += 13; document.getElementById('pwdcontainer').style.width = w + 'px'; } else { document.getElementById('false').className = 'showed'; document.getElementById('correct').className = 'hidden'; document.getElementById('pwdtext').innerHTML = ''; document.getElementById('pwdcontainer').style.width = '0px'; } } // Beállítjuk, hogy milyen erős a jelszó // ===================================== function getPwdStrength(pwd) { var check1 = new RegExp('[0-9]'); var check2 = new RegExp('[a-záéíóöőúüű]'); var check3 = new RegExp('[A-ZÁÉÍÓÖŐÚÜŰ]'); var check4 = new RegExp('[^0-9a-záéíóöőúüűA-ZÁÉÍÓÖŐÚÜŰ]'); var num = false; var string = false; var stringbig = false; var other = false; var strong = 0; for (i=0; i < pwd.length; i++) { if ((!num) && (pwd.charAt(i).match(check1))) { num = true; strong++; } if ((!string) && (pwd.charAt(i).match(check2))) { string = true; strong++; } if ((!stringbig) && (pwd.charAt(i).match(check3))) { stringbig = true; strong++; } if ((!other) && (pwd.charAt(i).match(check4))) { other = true; strong++; } } if (pwd.length>7) strong++; if (pwd.length>9) strong++; return strong; } // Jelszó és jelszó megerősítés ellenrőzése beírás közben // ====================================================== function checkequalpwd(o1, o2) { var idx1 = freeIndex(myArray); myArray[idx1] = o1; var idx2 = freeIndex(myArray); myArray[idx2] = o2; setTimeout("checkequalpwd2(" + idx1 + ", " + idx2 + ")", 10); } function checkequalpwd2(idx1, idx2) { var o1 = myArray[idx1]; myArray[idx1] = null; var o2 = myArray[idx2]; myArray[idx2] = null; if ((o1.value == o2.value) && (o1.value != "")) { document.getElementById('reply_false').className = 'hidden'; document.getElementById('reply_correct').className = 'showed'; } else { document.getElementById('reply_false').className = 'showed'; document.getElementById('reply_correct').className = 'hidden'; } } addEvent(window,'load',attachClassChange); function attachClassChange(d,E,b,i,a) { d=document;E=d.documentElement;b=d.body;if(!E)return; for(i=0; a=b.getElementsByTagName("tr")[i]; i++) { if (a.className=="") { addEvent(a, 'mouseover', trHoverOn); addEvent(a, 'mouseout', trHoverOut); } } } // Táblázat sorainak kiemelése // =========================== function trHoverOn(e) { e = e||event; e = e.srcElement||e.target; var c = 0, found = false; var a = e; while (a && c<5) { if (a.tagName && a.tagName.toUpperCase()=="TR" && a.className && (a.className=="row1" || a.className=="row2" || a.className=="errorrow" || a.className=="errorrow2")) { found = true; break; } a = a.parentNode; c++; } if (found) { if (a.className=="row1" || a.className=="row2") { a.oldClass = a.className=="row1"?"row1":"row2"; a.className = "hoverinput"; } else { a.oldClass = "errorrow"; a.className = "errorrow2"; } } } // Táblázat kiemelt sorainak eltüntetése // ===================================== function trHoverOut(e) { e = e||event; e = e.srcElement||e.target; var c = 0, found = false; var a = e; while (a && c<5) { if (a.tagName && a.tagName.toUpperCase()=="TR" && (a.className == "hoverinput" || a.className == "errorrow2")) { found = true; break; } a = a.parentNode; c++; } if (found) { //a.className = a.oldClass=="row1"?"row1":"row2"; if (a.oldClass=="row1" || a.oldClass=="row2") a.className = a.oldClass=="row1"?"row1":"row2"; else a.className = "errorrow"; } } function getX(oElement) { var iReturnValue = 0; while (oElement != null) { iReturnValue += oElement.offsetLeft; oElement = oElement.offsetParent; } return iReturnValue; } function getY(oElement) { var iReturnValue = 0; while (oElement != null) { iReturnValue += oElement.offsetTop; oElement = oElement.offsetParent; } return iReturnValue; } function subScribe() { document.subscribe.action.value = "subscribe"; document.subscribe.submit(); } function unSubScribe() { document.subscribe.action.value = "unsubscribe"; document.subscribe.submit(); } // egy wizard adott oldalara ugrik function jumpToWizardStep(step) { document.wizardstep_form.steptojump.value = step; document.wizardstep_form.submit(); } function formElement(form, elem) { var i; for (i in form.elements) if (form.elements[i] && form.elements[i].name && form.elements[i].name == elem) return form.elements[i]; return null; } function picMaxSize(obj, width, height) { try { if (obj.height > height) obj.height = height; if (obj.width > width) { var r = obj.width/obj.height; obj.width = width; obj.height = obj.width/r; } } catch (e) {} } function trim(x) { var i; i=0; while (x.charAt(i)==" ") i++; x = x.substr(i); i=x.length-1; while (i>0 && x.charAt(i)==" ") i--; x = x.substr(0, i+1); return x; } function openPopup(o) { window.open(o.href, '', 'width=800, height=600'); return false; } function picPopup(src) { window.open('/pic.yp?src=' + src, '', 'width=800, height=721'); return false; } function selectCountry(c) { ajax_request("ajax_getplaces.yp?c=" + c, writePlaces, 1); var o = document.getElementById('placelist'); o.options.length = 0; o.options[0] = new Option("-- Kérem várjon! --", -1); } function writePlaces(id, txt) { txt = txt.split("\n"); var o = document.getElementById('placelist'); var i; o.options.length = 0; for (i in txt) { if (!txt[i] || trim(txt[i])==0) continue; txt[i] = trim(Url.decode(txt[i])); o.options[o.options.length] = new Option(txt[i], txt[i]); } } function selectCategory(c) { ajax_request("ajax_getsubcategories.yp?c=" + c, writeCategories, 1); var o = document.getElementById('subcategory'); o.options.length = 0; o.options[0] = new Option("-- Kérem várjon! --", -1); } function writeCategories(id, txt) { txt = txt.split("\n"); var o = document.getElementById('subcategory'); var i, j, l, id, val; o.options.length = 0; o.options[0] = new Option("-- Kérem válasszon! --", -1); for (i in txt) { if (!txt[i] || trim(txt[i])==0) continue; l = txt[i].split("&"); for (j in l) { l[j] = l[j].split("="); if (l[j][0] == "id") id = l[j][1]; else if (l[j][0] == "value") val = trim(Url.decode(l[j][1])); } o.options[o.options.length] = new Option(val, id); } } // HTML replaced tag beszúrása // --------------------------- function insertHTMLTag(myField, tag) { if (tag == "b") { insertAtCursor(myField,'[b][/b]', 3); } if (tag == "i") { insertAtCursor(myField,'[i][/i]', 3); } if (tag == "u") { insertAtCursor(myField,'[u][/u]', 3); } if (tag == "link") { insertAtCursor(myField,'[link][/link]', 6); } } // Az aktuális kurzorhoz szúrja be a megadott szöveget // --------------------------------------------------- function insertAtCursor(myField, myValue, afterInsert) { if (document.selection) { myField.focus(); sel = document.selection.createRange(); sel.text = myValue; sel.moveStart('character', afterInsert - myValue.length); sel.moveEnd('character', afterInsert - myValue.length); sel.select(); } else if (myField.selectionStart || myField.selectionStart == '0') { var startPos = myField.selectionStart; var endPos = myField.selectionEnd; myField.value = myField.value.substring(0, startPos) + myValue + myField.value.substring(endPos, myField.value.length); myField.selectionStart = startPos + afterInsert; myField.selectionEnd = startPos + afterInsert; myField.focus(); } else { myField.value += myValue; } }