function ures(){}; // Project DropDown Menu window.addEvent('domready',function(){ $('dropMenu1').set('href','javascript:ures();'); $('dropMenu2').set('href','javascript:ures();'); $$('.topLevel').addEvent('mouseenter',function(){ try{$('sMenu').destroy();}catch(z){}; }); $('dropMenu1').addEvent('mouseenter',function(){ var lang = 'hu'; var Ajax = new Request({ method: 'post', data : { 'event': 'projectCats', 'req': true }, url: lang+'/ajax/getProjectCats', evalScripts : true, onRequest : function(){ try{$('sMenu').destroy();}catch(z){}; }, onComplete : function(rsp){ var Pos = $('dropMenu1').getPosition(); var sMenu = new Element('div' , { id : 'sMenu', html : rsp, style : 'top:144px;left:'+(Pos.x-10)+'px' }).inject(document.body); $('sMenu').addEvent('mouseleave',function(){ this.destroy(); }); } }).send(); }); $('dropMenu2').addEvent('mouseenter',function(){ var lang = 'hu'; var Ajax = new Request({ method: 'post', data : { 'event': 'writingCats', 'req': true }, url: lang+'/ajax/getWritingCats', evalScripts : true, onRequest : function(){ try{$('sMenu').destroy();}catch(z){}; }, onComplete : function(rsp){ var Pos = $('dropMenu2').getPosition(); var sMenu = new Element('div' , { id : 'sMenu', html : rsp, style : 'top:144px;left:'+(Pos.x-10)+'px' }).inject(document.body); $('sMenu').addEvent('mouseleave',function(){ this.destroy(); }); } }).send(); }); }); // Product Categories function prodTree(id) { var Ajax = new Request ( { method: 'post', url: home+'ajax/product_tree/' + id, evalScripts : true, onComplete : function(rsp){ new Element('div',{html:rsp}).inject($('listHolder'+id)); $('arrow'+id).src='images/admin/arrow-d.png'; $('listHolder'+id).setOpacity(0); var Efx= new Fx.Tween($('listHolder'+id),{duration:500}); Efx.start('opacity' , 0 , 1).chain(function(){ }); var myTips = new Tips('.mootip'); } } ).send(); $('link'+id).href="javascript:closeCat(" + id + ")"; $('link'+id).setStyles({ //'color': "#f00" }); } function closeCat(id) { $('listHolder'+id).innerHTML = ""; $('arrow'+id).src='images/admin/arrow-r.png'; $('link'+id).href="javascript:prodTree('" + id + "')"; $('link'+id).setStyles({ //'color': "#f00", 'text-decoration' : 'none', 'font-weight' : 'normal' }); } // Menu function menuTree(id) { var Ajax = new Request ( { method: 'post', url: home+'ajax/menu_tree/' + id, evalScripts : true, onComplete : function(rsp){ new Element('div',{html:rsp}).inject($('menuListHolder'+id)); $('menuarrow'+id).src='images/admin/arrow-d.png'; var myTips = new Tips('.mootip'); } } ).send(); $('menulink'+id).href="javascript:closeMenuCat(" + id + ")"; } function closeMenuCat(id) { $('menuListHolder'+id).innerHTML = ""; $('menuarrow'+id).src='images/admin/arrow-r.png'; $('menulink'+id).href="javascript:menuTree('" + id + "')"; $('menulink'+id).setStyles({ //'color': "#f00", 'text-decoration' : 'none', 'font-weight' : 'normal' }); } // User reg / user data mod. function onChangeUserTipus() { if( $('us_type').value == "szemely" ) { $('us_cegnev').style.visibility = "hidden"; $('cegnev_text').style.visibility = "hidden"; } else { $('us_cegnev').style.visibility = "visible"; $('cegnev_text').style.visibility = "visible"; } } function szalliatasiCimMegegyezikSzamlazasiCimmel() { $('us_szallitasi_nev').value = $('us_szamlazasi_nev').value; $('us_szallitasi_orszag').value = $('us_szamlazasi_orszag').value; $('us_szallitasi_varos').value = $('us_szamlazasi_varos').value; $('us_szallitasi_irszam').value = $('us_szamlazasi_irszam').value; $('us_szallitasi_utcahaz').value = $('us_szamlazasi_utcahaz').value; } function levelezesiCimMegegyezikSzamlazasiCimmel() { $('us_levelezesi_nev').value = $('us_szamlazasi_nev').value; $('us_levelezesi_orszag').value = $('us_szamlazasi_orszag').value; $('us_levelezesi_varos').value = $('us_szamlazasi_varos').value; $('us_levelezesi_irszam').value = $('us_szamlazasi_irszam').value; $('us_levelezesi_utcahaz').value = $('us_szamlazasi_utcahaz').value; } // Check username (ajax) window.addEvent('domready' , function(){ try{ $('username').addEvents({ blur : function(){ var req = new Request.HTML({ method: 'post', url: home+"ajax/checkUsername", data: { 'username' : this.value }, evalScripts : true, update : $('checkUsername') }).send(); } }); }catch(z){}; // Check email (ajax) try{ $('email').addEvents({ blur : function(){ var req = new Request.HTML({ method: 'post', url: home+"ajax/checkEmail", data: { 'email' : this.value }, update : $('checkEmail') }).send(); } }); }catch(z){}; try{ $('password2').addEvents({ blur : function(){ if ($('password1').value != this.value) { $('checkPassword2').innerHTML = "" + trans['a_ket_jelszo_nem_egyezik_meg'] + "<\/span>"; } else { $('checkPassword2').innerHTML = ""; } } }); $('password1').addEvents({ keyup : function(){ var passwd = this.value; var intScore = 0 var strVerdict = trans['gyenge']; var strLog = "" if (passwd.length<5) // length 4 or less { intScore = (intScore+3) } else if (passwd.length>4 && passwd.length<8) // length between 5 and 7 { intScore = (intScore+6) } else if (passwd.length>7 && passwd.length<16)// length between 8 and 15 { intScore = (intScore+12) } else if (passwd.length>15) // length 16 or more { intScore = (intScore+18) } if (passwd.match(/[a-z]/)) // [verified] at least one lower case letter { intScore = (intScore+1) } if (passwd.match(/[A-Z]/)) // [verified] at least one upper case letter { intScore = (intScore+5) } if (passwd.match(/\d+/)) // [verified] at least one number { intScore = (intScore+5) } if (passwd.match(/(.*[0-9].*[0-9].*[0-9])/)) // [verified] at least three numbers { intScore = (intScore+5) } if (passwd.match(/.[!,@,#,$,%,^,&,*,?,_,~]/)) // [verified] at least one special character { intScore = (intScore+5) } if (passwd.match(/(.*[!,@,#,$,%,^,&,*,?,_,~].*[!,@,#,$,%,^,&,*,?,_,~])/)) { intScore = (intScore+5) } if (passwd.match(/([a-z].*[A-Z])|([A-Z].*[a-z])/)) // [verified] both upper and lower case { intScore = (intScore+2) } if (passwd.match(/([a-zA-Z])/) && passwd.match(/([0-9])/)) // [verified] both letters and numbers { intScore = (intScore+2) } if (passwd.match(/([a-zA-Z0-9].*[!,@,#,$,%,^,&,*,?,_,~])|([!,@,#,$,%,^,&,*,?,_,~].*[a-zA-Z0-9])/)) { intScore = (intScore+2) } if(intScore < 16) {strVerdict = "" + trans['nagyon_gyenge'] + "<\/span>"} else if (intScore > 16 && intScore < 24){strVerdict = "" + trans['gyenge'] + "<\/span>"} else if (intScore > 24 && intScore < 32){strVerdict = "" + trans['kozepes'] + "<\/span>"} else if (intScore > 32 && intScore < 36){strVerdict = "" + trans['eros'] + "<\/span>"} else{strVerdict = "" + trans['nagyon_eros'] + "<\/span>"} $('checkPassword1').innerHTML = strVerdict; } }); }catch(z){}; // Autocomplete SZAMLAZASI VAROS try{ new Autocompleter.Request.HTML('us_szamlazasi_varos', 'ajax/cityList', { minLength: 2, maxChoices: 8, cache: true, delay: 100 }); }catch(z){}; // Autocomplete SZALLITASI VAROS try{ new Autocompleter.Request.HTML('us_szallitasi_varos', 'ajax/cityList', { minLength: 2, maxChoices: 8, cache: true, delay: 100 }); }catch(z){}; // Autocomplete LEVELEZESI VAROS try{ new Autocompleter.Request.HTML('us_levelezesi_varos', 'ajax/cityList', { minLength: 2, maxChoices: 8, cache: true, delay: 100 }); }catch(z){}; });