// Copyright 2009 Sîrbu Roman
function $i(i) {return document.getElementById(i)};
function ajax(b,h,g,d,a){if(typeof g==="undefined"){g="GET"}var c;try{c=new ActiveXObject("Microsoft.XMLHTTP")}catch(f){try{c=new ActiveXObject("Msxml2.XMLHTTP")}catch(f){try{c=new XMLHttpRequest()}catch(f){return false}}}c.onreadystatechange=function(){if(c.readyState===4){if(c.status===200){h.call(c)}}};c.open(g.toUpperCase(),b+(d?"?"+d:"")+(a?(b.indexOf("?")<0?"?":"&")+new Date().getTime():""),true);c.send(null);return true};
function insertBB(f,a,x,z){var d=x==1?a:x==2?"["+a+"="+z+"]":"["+a+"]",g=x==1?"":"[/"+a+"]";if(document.selection){f.focus();sel=document.selection.createRange();sel.text=d+(sel.text.length>0?sel.text:"")+g;f.focus()}else{if(f.selectionStart||f.selectionStart==0){var c=f.selectionStart,b=f.selectionEnd,h=b,e=f.scrollTop;if(c!=b){f.value=f.value.substring(0,c)+d+f.value.substring(c,b)+g+f.value.substring(b,f.value.length);h=h+d.length+g.length}else{f.value=f.value.substring(0,c)+d+g+f.value.substring(b,f.value.length);h=c+d.length}f.focus();f.selectionStart=h;f.selectionEnd=h;f.scrollTop=e}else{f.value+=d+g;f.focus()}}};
var _o=Math.round(Math.random()*20),_c;function _f(){var _c=$i('minislide');setTimeout(function(){var a=new Image(),_x=_c.getElementsByTagName('img')[0];a.onload=function(){_c.appendChild(a);_x.style.position='absolute';if(!/msie/i.test(navigator.userAgent))_x.style.left='5px';_x.style.opacity='1';_x.style.filter='alpha(opacity=100)';_j=1;_v=setInterval(function(){if(_j>=0){;_j-=.05;_x.style.opacity=_j;_x.style.filter='alpha(opacity='+_j*100+')'}else{clearInterval(_v);_c.removeChild(_x);_f()}},10)};a.src='/i/minislide/'+_o+'.jpg';_o=Math.round(Math.random()*20)},3000)};
function checklogin(R){$i('loginsubmit').disabled=true;$i('loginsubmit').value='Un moment...';var timeout=setTimeout(function(){rollbacklogin();if(confirm('Opa... Ceva n-a mers cum trebuie.\nPosibil ai probleme cu conexiunea la Internet.\n\nMai încearcăm o dată?'))checklogin()},10000);ajax('http://'+location.host+'/j/login.php?'+Math.round(Math.random()*9999999)+'&username='+$i('username').value+'&password='+$i('password').value+'&remember='+($i('remember').checked?'1':'0'),function(){clearTimeout(timeout);if(this.responseText!=='success'){rollbacklogin();alert(this.responseText)}else location.replace(R)},'get',0,true)};function rollbacklogin(){$i('loginsubmit').disabled=false;$i('loginsubmit').value='Intră în cont';$i('username').select()};
