//COOKIES function createCookie(name,value,days) { if (days) { var date = new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); var expires = "; expires="+date.toGMTString(); } else var expires = ""; document.cookie = name+"="+value+expires+"; path=/"; } function readCookie(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for(var i=0;i < ca.length;i++) { var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1,c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); } return null; } function eraseCookie(name) { createCookie(name,"",-1); } //ART UTILS var avnetFontSize=''; function increaseFontSize(elema,elemb) { if(avnetFontSize <= 16) { avnetFontSize++; elema.style.fontSize = avnetFontSize+'px'; if(elemb) elemb.style.fontSize = avnetFontSize+'px'; createCookie('avnetFontSize',avnetFontSize,14); } } function setFontSize(v,obj, elema, elemb) { if(obj == 'fz_s') { $("fz_s").src = 'http://www.avocatnet.ro/images/icons/fs/fs_small_on.gif'; $("fz_s1").src = 'http://www.avocatnet.ro/images/icons/fs/fs_small_on.gif'; } else { $("fz_s").src = 'http://www.avocatnet.ro/images/icons/fs/fs_small_off.gif'; $("fz_s1").src = 'http://www.avocatnet.ro/images/icons/fs/fs_small_off.gif'; } if(obj == 'fz_n') { $("fz_n").src = 'http://www.avocatnet.ro/images/icons/fs/fs_norm_on.gif'; $("fz_n1").src = 'http://www.avocatnet.ro/images/icons/fs/fs_norm_on.gif'; } else { $("fz_n").src = 'http://www.avocatnet.ro/images/icons/fs/fs_norm_off.gif'; $("fz_n1").src = 'http://www.avocatnet.ro/images/icons/fs/fs_norm_off.gif'; } if(obj == 'fz_b') { $("fz_b").src = 'http://www.avocatnet.ro/images/icons/fs/fs_big_on.gif'; $("fz_b1").src = 'http://www.avocatnet.ro/images/icons/fs/fs_big_on.gif'; } else { $("fz_b").src = 'http://www.avocatnet.ro/images/icons/fs/fs_big_off.gif'; $("fz_b1").src = 'http://www.avocatnet.ro/images/icons/fs/fs_big_off.gif'; } if(elema) elema.style.fontSize = v+'px'; if(elemb) elemb.style.fontSize = v+'px'; createCookie('avnetFontSize',v,10); } function recommend(urlRecommandForThisArticle) { var x = (screen.width-400)/2, y = (screen.height-400)/2; OpenWin = this.open(urlRecommandForThisArticle, "CtrlWindow", "width=400,height=400,toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no, screenX="+x+", screenY="+y+", left="+x+", top="+y); } function decreaseFontSize(elema,elemb) { if(avnetFontSize >= 10) { avnetFontSize--; elema.style.fontSize = avnetFontSize+'px'; if(elemb) elemb.style.fontSize = avnetFontSize+'px'; createCookie('avnetFontSize',avnetFontSize,14); } } function updateRecomandari(vArticleID,nr){ //change link $('sRecomandaArticol').innerHTML=" +"+(nr+1)+""; $('sRecomandaArticol01').innerHTML=" +"+(nr+1)+""; new Ajax.Request(pathWWW+'/getajax|recommendArticle', { method:'post', parameters: {articleID: vArticleID }, onSuccess: function(){ //set cookie createCookie('rec_'+vArticleID,'true',14); }, onFailure: function(){ } }); } function printerFriendly(urlToOpen) { var x = (screen.width-650)/2, y = (screen.height-450)/2; OpenWin = this.open(urlToOpen, "CtrlWindow", "width=650,height=450,toolbars=0,menubar=no,location=no,scrollbars=yes,resizable=no,screenX="+x+",screenY="+y+",left="+x+",top="+y); } //COMMENTS function displayCommentForm() { Effect.toggle($('posteaza'),'slide'); } function postComment(articleID) { Effect.toggle($('posteaza'),'slide'); new Ajax.Request(pathWWW+'/getajax|handleCommentsNew', { method:'post', parameters: {cArticleID: articleID,cUser: ($('cUser') ? $('cUser').value : "") , cText: $('cText').value, postComment: '1' }, onSuccess: function(transport){ if($('cUser')) $('cUser').value = ''; $('cText').value =''; //set cookie createCookie('lastPost','true',(1/24/60/2)); var response = transport.responseText; $('commentsContentID').update(response); }, onFailure: function(){ } }); } function writeComments(rXML) { if(document.all) { var detalii = rXML.childNodes[1].childNodes[0]; var comments = rXML.childNodes[1].childNodes[1]; } else { var detalii = rXML.childNodes[0].childNodes[0]; var comments = rXML.childNodes[0].childNodes[1]; } //build pages var page = detalii.childNodes[0].firstChild.nodeValue; var totalPages = detalii.childNodes[1].firstChild.nodeValue; var totalcomentarii = detalii.childNodes[2].firstChild.nodeValue; var path= detalii.childNodes[3].firstChild.nodeValue; var articleID = detalii.childNodes[4].firstChild.nodeValue; var pager='Pagina '; var range = 7; //alert(parseInt(page)+parseInt(range)); for(j=0; j < totalPages; j++) { if(j==0) { if((j+1)==page) { pager+=" "+(j+1)+" "; } else { pager+=" "+(j+1)+" "; } } if(j==(parseInt(page)-parseInt(range)) && (parseInt(page)-parseInt(range)) > 0) pager+=" ... "; if( j>(parseInt(page)-parseInt(range)) && j<(parseInt(page)+parseInt(range)) && j > 0 && j < (parseInt(totalPages)-1)) { if((j+1)==page) { pager+=" "+(j+1)+" "; } else { pager+=" "+(j+1)+" "; } } if(j==(parseInt(page)+parseInt(range)) && (parseInt(page)+parseInt(range))!=totalPages ) { pager+=" ... "; } if(j==(parseInt(totalPages)-1)) { if((j+1)==page) { pager+=" "+(j+1)+" "; } else { pager+=" "+(j+1)+" "; } } } var content = ""; if(totalPages > 1) content+="
"+pager+"
"; for(i=0; i < comments.childNodes.length; i++) { comment = comments.childNodes[i]; var cUser = comment.getElementsByTagName('name')[0].firstChild.nodeValue; var cUserID = comment.getElementsByTagName('userID')[0].firstChild.nodeValue; var cText = comment.getElementsByTagName('body')[0].firstChild.nodeValue; var cDate = comment.getElementsByTagName('postDate')[0].firstChild.nodeValue; var cAvatar = comment.getElementsByTagName('avatar')[0].firstChild.nodeValue; var cDiff = comment.getElementsByTagName('diferentza')[0].firstChild.nodeValue; content+='
'; content+=''; content+='
'; content+='
'; if(cUserID > 0) content+=''+cUser+'
'; else content+= ''+cUser+' (utilizator neinregistrat)
'; content+='adaugat acum '+cDiff+'
'+cText+'
'; content+=''; } if(totalPages > 1) content+="
"+pager+"
"; $('commentsContentID').innerHTML=content; } function getComments(articleID,page,anchorPoint) { new Ajax.Request(pathWWW+'/getajax|handleComments', { method:'post', parameters: {cArticleID: articleID, p: page}, onSuccess: function(transport){ var response = transport.responseXML; writeComments(response); if(anchorPoint) Effect.ScrollTo(anchorPoint, {duration: 0.3}); }, onFailure: function(){ } }); } function getCommentsNew(articleID,page,anchorPoint) { new Ajax.Request(pathWWW+'/getajax|handleCommentsNew', { method:'post', parameters: {cArticleID: articleID, pageID: page}, onSuccess: function(transport){ var response = transport.responseText; $('commentsContentID').update(response); if(anchorPoint) Effect.ScrollTo(anchorPoint, {duration: 0.3}); }, onFailure: function(){ } }); } //USER var redirectAfterLogin = ''; function doLogin() { if($('hCont')) $('hCont').style.backgroundColor = "#ffffff"; if(!validateLogin()) { return false; } var tmpUtilizator = $('cUtilizator').value; var tmpParola = $('cParola').value; if($('utilizatorInregistrat')) $('utilizatorInregistrat').innerHTML = ''; new Ajax.Request(pathWWW+'/getajax|doLogin', { method:'post', parameters: {cUtilizator: tmpUtilizator,cParola: tmpParola }, onSuccess: function(transport){ var response = transport.responseXML; var status = response.childNodes[0].childNodes[0].firstChild.nodeValue; if(status == 'true') { var user = response.childNodes[0].childNodes[2]; displayLoggedScreen(user); } else { //report error var err = response.childNodes[0].childNodes[1].firstChild.nodeValue; displayLoginScreen(); $('cUtilizator').value = tmpUtilizator; document.getElementById('cUtilizator').focus(); showToolTipFader(err,$('cUtilizator')); } }, onFailure: function(){ } }); } function doLoginNew() { if($('hCont')) $('hCont').style.backgroundColor = "#ffffff"; if(!validateLogin()) { return false; } var tmpUtilizator = $('cUtilizator').value; var tmpParola = $('cParola').value; $('newLoginBoxTopLeft').hide(); $('newLoginBoxLoader').show(); new Ajax.Request(pathWWW+'/getajax|doLogin', { method:'post', parameters: {cUtilizator: tmpUtilizator,cParola: tmpParola }, onSuccess: function(transport){ var response = transport.responseXML; var status = response.childNodes[0].childNodes[0].firstChild.nodeValue; if(status == 'true') { var user = response.childNodes[0].childNodes[2]; displayLoggedScreen(user); } else { //report error var err = response.childNodes[0].childNodes[1].firstChild.nodeValue; displayLoginScreenNew(); $('cUtilizator').value = tmpUtilizator; document.getElementById('cUtilizator').focus(); showToolTipFader(err,$('cUtilizator')); } }, onFailure: function(){ } }); } function doRegister() { if(!validateRegister()) { return false; } var tmpUtilizator = $('cUtilizator').value; var tmpParola = $('cParola').value; var tmpEmail = $('cEmail').value; $('utilizatorNou').innerHTML = ''; new Ajax.Request(pathWWW+'/getajax|doRegister', { method:'post', parameters: {cUtilizator: tmpUtilizator,cParola: tmpParola, cEmail: tmpEmail }, onSuccess: function(transport){ var response = transport.responseXML; var status = response.childNodes[0].childNodes[0].firstChild.nodeValue; if(status == 'true') { displayLoggedScreen(); } else { //report error var err = response.childNodes[0].childNodes[1].firstChild.nodeValue; displayRegisterFrm(); $('cUtilizator').value = tmpUtilizator; document.getElementById('cUtilizator').focus(); showToolTipFader(err,$('cUtilizator')); } }, onFailure: function(){ } }); } function doLogout() { new Ajax.Request(pathWWW+'/getajax|doLogout', { method:'post', onSuccess: function(transport){ //var response = transport.responseXML; eraseCookie("AvocaTNetROAlwaYsRemeBerMe"); addLoginKeyPressEvent(); window.location.reload(); /*displayLoginScreen(); setTimeout("$('cUtilizator').focus()",100);*/ }, onFailure: function(){ } }); } function doRecoverPassword() { if(!validateMail($('cRecover'))) { return false; } var tmpRecover = $('cRecover').value; $('utilizatorInregistrat').innerHTML = ''; new Ajax.Request(pathWWW+'/getajax|doRecoverPassword', { method:'post', parameters: {cRecover: tmpRecover }, onSuccess: function(transport){ var response = transport.responseXML; var status = response.childNodes[0].childNodes[0].firstChild.nodeValue; if(status == 'true') { displayRecoverPasswordMsg("Email-ul cu noua parola a fost trimis succes catre

"+tmpRecover+"
"); } else { //report error var err = response.childNodes[0].childNodes[1].firstChild.nodeValue; displayRecoverPasswordMsg(""+err+""); } }, onFailure: function(){ } }); } function doRecoverPasswordNew() { if(!validateMail($('cRecover'))) { return false; } var tmpRecover = $('cRecover').value; $('newRecoveryPasswordBoxTopLeft').hide(); $('newLoginBoxLoader').show(); new Ajax.Request(pathWWW+'/getajax|doRecoverPassword', { method:'post', parameters: {cRecover: tmpRecover }, onSuccess: function(transport){ var response = transport.responseXML; var status = response.childNodes[0].childNodes[0].firstChild.nodeValue; if(status == 'true') { $('newLoginBoxLoader').hide(); $('newMsgBoxTopLeft').show(); $('newMsgBoxTop').update("Email-ul cu noua parola a fost trimis succes catre

"+tmpRecover+""); } else { //report error var err = response.childNodes[0].childNodes[1].firstChild.nodeValue; $('newLoginBoxLoader').hide(); $('newMsgBoxTopLeft').show(); $('newMsgBoxTop').update(err); } }, onFailure: function(){ } }); } function displayLoggedScreen(user) { if(redirectAfterLogin) { window.location=redirectAfterLogin; } else { window.location.reload(); } } function displayLoginScreen() { var content = ""; content +="

"; content +="UTILIZATOR"; content +=""; content +="PAROLA"; content +=""; content +=""; content +="

"; content +=""; content +=""; $('utilizatorInregistrat').update(content); addLoginKeyPressEvent(); } function displayRecoverPassword() { $('hCont').style.backgroundColor = "#ffffff"; var content = ""; content +=''; content +="

"; content +="Introduceti adresa de email asociata contului dumneavoastra."; content +="EMAIL"; content +=""; content +="« inapoi

"; content +="

"; content +=""; $('utilizatorInregistrat').update(content); setTimeout('document.getElementById(\'cRecover\').focus();',100); addLoginKeyPressEvent(); } function displayRecoverPasswordNew() { $('newLoginBoxTopLeft').hide(); $('newRecoveryPasswordBoxTopLeft').show(); setTimeout('document.getElementById(\'cRecover\').focus();',100); addLoginKeyPressEvent(); } function displayLoginScreenNew() { $('newRecoveryPasswordBoxTopLeft').hide(); $('newLoginBoxLoader').hide(); $('newMsgBoxTopLeft').hide(); $('newLoginBoxTopLeft').show(); addLoginKeyPressEvent(); } function displayRecoverPasswordMsg(msg) { var content = ""; content +=""; content +="

"; content +=msg; content +="« inapoi

"; content +="

"; $('utilizatorInregistrat').update(content); } function displayRegisterFrm() { var content = ""; content +=''; content +="
"; content +="« inapoi
"; content +="

Creare cont

"; content +="
UTILIZATOR
disponibil?
"; content +="
PAROLA
"; content +="
VERIFICA PAROLA
"; content +="
EMAIL
disponibil?
"; content +="
        sunt de acord cu termenii si conditiile
"; content +=""; content +="
"; $('fieldsetLogin').innerHTML = content; } function highlightLogin(redirAfter) { displayLoginScreen(); redirectAfterLogin = redirAfter; $('hCont').style.backgroundColor = "#fffaa6"; $('cUtilizator').focus(); self.scrollTo(0, 0); showToolTipFader("Actiunea necesita autentificare!",$('cUtilizator')); } function highlightLoginVreauSiEu(redirAfter) { displayLoginScreen(); redirectAfterLogin = redirAfter; $('hCont').style.backgroundColor = "#fffaa6"; $('cUtilizator').focus(); self.scrollTo(0, 0); showToolTipFader("Actiunea necesita autentificare!",$('vreauSiEu')); } //MISC function checkIfAvailable(elem) { new Ajax.Request(pathWWW+'/getajax|checkIfAvailable', { method:'post', parameters: {check: elem.name, r: elem.value }, onSuccess: function(transport){ var response = transport.responseXML; var status = response.childNodes[0].childNodes[0].firstChild.nodeValue; if(status == 'true') { $('avail'+elem.name).innerHTML = "disponibil"; } else { //report error $('avail'+elem.name).innerHTML = "indisponibil"; //var err = response.childNodes[0].childNodes[1].firstChild.nodeValue; //displayRecoverPasswordMsg('« inapoi

'+err); } }, onFailure: function(){ } }); } function restoreCheck(elem) { $('avail'+elem.name).innerHTML="disponibil?"; } //BROWSE USER function browseUser(evt) { var ele = Event.element(evt); new Ajax.Request(pathWWW+'/getajax|userinfo', { method:'post', parameters: {userID: ele.name }, onSuccess: function(transport){ var response = transport.responseText; showToolTipFader(response,ele,1); }, onFailure: function(){} }); } //end browser user var globalTimeout = ""; function showToolTipFader(texty,obj,doNotCloseAfter) { if($('tooltipX')) { document.body.removeChild($('tooltipX')); window.clearTimeout(globalTimeout); } var newdiv = document.createElement('div'); newdiv.id="tooltipX"; newdiv.style.display = "none"; //generating table inside div if(document.all) { var tbl = document.createElement(''); var tbb = document.createElement("tbody"); } else { var tbl = document.createElement('table'); var tbb = document.createElement("tbody"); tbl.setAttribute('cellpadding','0'); tbl.setAttribute('cellspacing','0'); tbl.setAttribute('border','0'); } // create up arrow td var row = document.createElement('tr'); if(document.all) var cell = document.createElement('
'); else var cell = document.createElement('td'); cell.setAttribute('colspan','3'); //create img var nimg = document.createElement('img'); if(document.all) nimg.src="http://www.avocatnet.ro/images/pop-up/sageata_sus.gif"; else nimg.src="http://www.avocatnet.ro/images/pop-up/sageata_sus.png"; nimg.className="tooltipUpArrow"; nimg.id = "toolArrowU"; //create img var nimgRight = document.createElement('img'); if(document.all) nimgRight.src="http://www.avocatnet.ro/images/pop-up/sageata_sus_right.gif"; else nimgRight.src="http://www.avocatnet.ro/images/pop-up/sageata_sus_right.png"; nimgRight.className="tooltipUpArrowRight"; nimgRight.id = "toolArrowURight"; cell.appendChild(nimg); cell.appendChild(nimgRight); row.appendChild(cell); tbb.appendChild(row); //end create up arrow td //create top tooltip var row = document.createElement('tr'); var cell = document.createElement('td'); cell.className="tooltipCorner_ul"; row.appendChild(cell); var cell = document.createElement('td'); cell.className="tooltipBar_u"; row.appendChild(cell); var cell = document.createElement('td'); cell.className="tooltipCorner_ur"; row.appendChild(cell); tbb.appendChild(row); //end create top tooltip if(doNotCloseAfter == 1) { var imgClose = "Detaliu utilizator"; //create close tooltip var row = document.createElement('tr'); var cell = document.createElement('td'); cell.className="tooltipBar_l"; row.appendChild(cell); var cell = document.createElement('td'); cell.className="tooltipText"; cell.innerHTML=imgClose; row.appendChild(cell); var cell = document.createElement('td'); cell.className="tooltipBar_r"; row.appendChild(cell); tbb.appendChild(row); //end close tooltip } if(doNotCloseAfter == 2) { var imgClose = ""; //create close tooltip var row = document.createElement('tr'); var cell = document.createElement('td'); cell.className="tooltipBar_l"; row.appendChild(cell); var cell = document.createElement('td'); cell.className="tooltipText"; cell.innerHTML=imgClose; row.appendChild(cell); var cell = document.createElement('td'); cell.className="tooltipBar_r"; row.appendChild(cell); tbb.appendChild(row); //end close tooltip } //create middle tooltip var row = document.createElement('tr'); var cell = document.createElement('td'); cell.className="tooltipBar_l"; row.appendChild(cell); var cell = document.createElement('td'); cell.className="tooltipText"; cell.innerHTML=texty; row.appendChild(cell); var cell = document.createElement('td'); cell.className="tooltipBar_r"; row.appendChild(cell); tbb.appendChild(row); //end middle tooltip //create bottom tooltip var row = document.createElement('tr'); var cell = document.createElement('td'); cell.className="tooltipCorner_bl"; row.appendChild(cell); var cell = document.createElement('td'); cell.className="tooltipBar_b"; row.appendChild(cell); var cell = document.createElement('td'); cell.className="tooltipCorner_br"; row.appendChild(cell); tbb.appendChild(row); //end create bottom tooltip // create down arrow td var row = document.createElement('tr'); if(document.all) var cell = document.createElement(''); else var cell = document.createElement('td'); cell.setAttribute('colspan','3'); //create img var nimg = document.createElement('img'); if(document.all) nimg.src="http://www.avocatnet.ro/images/pop-up/sageata_jos.gif"; else nimg.src="http://www.avocatnet.ro/images/pop-up/sageata_jos.png"; nimg.className="tooltipDownArrow"; nimg.id = "toolArrowD"; //create img var nimgRight = document.createElement('img'); if(document.all) nimgRight.src="http://www.avocatnet.ro/images/pop-up/sageata_jos_right.gif"; else nimgRight.src="http://www.avocatnet.ro/images/pop-up/sageata_jos.png"; nimgRight.className="tooltipDownArrowRight"; nimgRight.id = "toolArrowDRight"; cell.appendChild(nimg); cell.appendChild(nimgRight); row.appendChild(cell); tbb.appendChild(row); //end create down arrow td tbl.appendChild(tbb); newdiv.appendChild(tbl); newdiv.className ="tooltipDiv"; //add tooltip to document document.body.appendChild(newdiv); //position tooltip setPopupPosition(obj,newdiv,'tooltip'); Effect.Appear(newdiv.id,{duration:.2}); //set fade out if(!doNotCloseAfter) globalTimeout = window.setTimeout('Effect.Fade(\'tooltipX\', {duration:.3,from:1.0, to:0.0})',2500); //======================================== } function setPopupPosition(el, x, who) { var direction = "up"; var directionX = "left"; var position = Position.cumulativeOffset(el); var scrollY = document.body.scrollTop ? document.body.scrollTop : document.documentElement.scrollTop; var scrollX = document.body.scrollLeft ? document.body.scrollLeft : document.documentElement.scrollLeft; var viewHeight = (navigator.userAgent.toLowerCase().indexOf("safari") != -1 && window.innerHeight) ? window.innerHeight : document.documentElement.clientHeight; x.style.left = position[0]-40 + "px"; var popupTop = position[1] + Element.getHeight(el); var popupLeft = position[0] + Element.getWidth(el); if((popupTop + x.offsetHeight > scrollY + viewHeight) && (position[1] - x.offsetHeight > scrollY)) { popupTop = position[1] - x.offsetHeight ; } if(popupTop > (scrollY + Element.getHeight(x) + 40 + Element.getHeight(el))) { direction="down"; if(who=='tooltip') { if(popupLeft > (scrollX+Element.getWidth(x) + 40 + Element.getWidth(el))) { $('toolArrowDRight').style.visibility = "visible"; directionX = "right"; } else { $('toolArrowD').style.visibility = "visible"; } } if(who=='infotip') $('infoArrowD').style.visibility = "visible"; } else { if(who=='tooltip') { if(popupLeft > (scrollX+Element.getWidth(x) + 40 + Element.getWidth(el))) { $('toolArrowURight').style.visibility = "visible"; directionX = "right"; } else { $('toolArrowU').style.visibility = "visible"; } } if(who=='infotip') $('infoArrowU').style.visibility = "visible"; } if(direction == "up") x.style.top = (popupTop+30) + "px"; else x.style.top = (popupTop - Element.getHeight(x) - (document.all ? 20 : 30) - Element.getHeight(el)) + "px"; if(directionX == "right") x.style.left = (popupLeft-Element.getWidth(x) - Element.getWidth(el) + (document.all ? 50 : 40)) + "px"; } function hidePopup() { if($('tooltipX')) { document.body.removeChild($('tooltipX')); window.clearTimeout(globalTimeout); } } function validateComment() { if($('cUser')) var cUser = $('cUser'); var cText = $('cText'); if(cUser) { if(Validation.get('required').test(cUser.value)) { } else { showToolTipFader('Completati numele dumneavostra.',cUser); cUser.focus(); return false; } } if(Validation.get('required').test(cText.value)) { } else { showToolTipFader('Adaugati comentariul',cText); cText.focus(); return false; } return true; } function validatePm() { var recipient = $('recipient'); var bodyPM = $('body'); if($('to1').checked == true) { if(Validation.get('required').test(recipient.value)) { } else { showToolTipFader('Completati utilizatorul.',recipient); recipient.focus(); return false; } } if(Validation.get('required').test(bodyPM.value)) { } else { showToolTipFader('Completati mesajul catre destinatar.',bodyPM); bodyPM.focus(); return false; } return true; } function validateSearchTop() { if($('cauta')) { if(Validation.get('required').test($('cauta').value) && ($('cauta').value.length > 2)) { } else { showToolTipFader('Cautarea trebuie sa contina minim 3 caractere.',$('cauta')); $('cauta').focus(); return false; } } return true; } function validateSearchGoogle() { if($('q')) { if(Validation.get('required').test($('q').value) && ($('q').value.length > 2)) { } else { showToolTipFader('Cautarea trebuie sa contina minim 3 caractere.',$('q')); $('q').focus(); return false; } } return true; } function validateLogin() { var cUtilizator = $('cUtilizator'); var cParola = $('cParola'); if(Validation.get('required').test(cUtilizator.value)) { } else { showToolTipFader('Completati campul de utilizator.',cUtilizator); cUtilizator.focus(); return false; } if(Validation.get('required').test(cParola.value)) { } else { showToolTipFader('Completati parola dvs.',cParola); cParola.focus(); return false; } return true; } function validateMail(ele) { var cEmail = ele; if(Validation.get('validate-email').test(cEmail.value) && cEmail.value.length > 1) { } else { showToolTipFader('Adresa de email este invalida \nExemplu: popesecu@example.ro',cEmail); cEmail.focus(); return false; } return true; } function validateRegister() { var cUtilizator = $('cUtilizator'); var cParola = $('cParola'); var cParolaT = $('cParolaT'); var cEmail = $('cEmail'); var cAgree = $('cAgree'); if(Validation.get('required').test(cUtilizator.value)) { } else { showToolTipFader('Completati campul de utilizator.',cUtilizator); cUtilizator.focus(); return false; } if(Validation.get('required').test(cParola.value)) { } else { showToolTipFader('Completati parola dvs.',cParola); cParola.focus(); return false; } if(Validation.get('required').test(cParolaT.value)) { } else { showToolTipFader('Reintroduceti parola in campul de "VERIFICA PAROLA"',cParolaT); cParolaT.focus(); return false; } if(cParola.value != cParolaT.value) { showToolTipFader('Parola nu a fost verificata',cParolaT); cParolaT.value=''; cParola.focus(); return false; } if(Validation.get('validate-email').test(cEmail.value) && cEmail.value.length > 1) { } else { showToolTipFader('Adresa de email este invalida \nExemplu: popesecu@example.ro',cEmail); cEmail.focus(); return false; } if(cAgree.checked != true) { showToolTipFader('Pentru a te putea inregistra trebuie sa accepti termenii si conditiile de utilizare ale Avocatnet.ro',cAgree); cAgree.focus(); return false; } return true; } function validateRegister01() { var cUtilizator = $('cUtilizator3'); var cParola = $('cParola'); var cParolaT = $('cParolaT'); var cEmail = $('cEmail'); var cAgree = $('cAgree'); if(Validation.get('required').test(cUtilizator.value)) { } else { showToolTipFader('Completati campul de utilizator.',cUtilizator); cUtilizator.focus(); return false; } if(Validation.get('required').test(cParola.value)) { } else { showToolTipFader('Completati parola dvs.',cParola); cParola.focus(); return false; } if(Validation.get('required').test(cParolaT.value)) { } else { showToolTipFader('Reintroduceti parola in campul de "VERIFICA PAROLA"',cParolaT); cParolaT.focus(); return false; } if(cParola.value != cParolaT.value) { showToolTipFader('Parola nu a fost verificata',cParolaT); cParolaT.value=''; cParola.focus(); return false; } if(Validation.get('validate-email').test(cEmail.value) && cEmail.value.length > 1) { } else { showToolTipFader('Adresa de email este invalida \nExemplu: popesecu@example.ro',cEmail); cEmail.focus(); return false; } if(cAgree.checked != true) { showToolTipFader('Pentru a te putea inregistra trebuie sa accepti termenii si conditiile de utilizare ale Avocatnet.ro',cAgree); cAgree.focus(); return false; } document.doRegister.submit(); return true; } function initPage(){ if(readCookie('avnetFontSize')) { avnetFontSize = readCookie('avnetFontSize'); /*if($('teaserArticol')) $('teaserArticol').style.fontSize = avnetFontSize+'px'; if($('textArticol')) $('textArticol').style.fontSize = avnetFontSize+'px';*/ if(avnetFontSize == 12) { if($('textArticol') && $('textArticol')) setFontSize(avnetFontSize,'fz_s',$('teaserArticol'), $('textArticol')); } if(avnetFontSize == 14) { if($('textArticol') && $('textArticol')) setFontSize(avnetFontSize,'fz_n',$('teaserArticol'), $('textArticol')); } if(avnetFontSize == 16) { if($('textArticol') && $('textArticol')) setFontSize(avnetFontSize,'fz_b',$('teaserArticol'), $('textArticol')); } } else { avnetFontSize = 16; if($('textArticol') && $('textArticol')) setFontSize(avnetFontSize,'fz_b',$('teaserArticol'), $('textArticol')); } } function addLoginKeyPressEvent(e) { if($('cUtilizator')) $('cUtilizator').onkeypress = function(e) { if(!document.all && e.which == 13) doLogin(); } if($('cParola')) $('cParola').onkeypress = function(e) { if(!document.all && e.which == 13) doLogin(); } if($('cRecover')) $('cRecover').onkeypress = function(e) { if(!document.all && e.which == 13) doRecoverPassword(); } if(document.all) { document.body.onkeypress = function(e) { var kC = event.keyCode; if(kC==27) if($('tooltipX')) hidePopup(); } } else { window.onkeypress = function(e) { var kC = e.keyCode; var Esc = e.DOM_VK_ESCAPE; if(kC==Esc) if($('tooltipX')) hidePopup(); } } } var bAllSelected = false; function selectAll(f,v) { bAllSelected = !bAllSelected; if(document.all) { for(i=0; i < f.elements.length; i++) { var tmpName = String(f.elements(i).name); if (tmpName.indexOf(v) >= 0) { f.elements[i].checked = bAllSelected; } } } else { for (var i in f.elements) { var tmpName = (f.elements[i]) ? String(f.elements[i].name) : i; if (tmpName.indexOf(v) >= 0) { f.elements[i].checked = bAllSelected; } } } } function getSearchDomains(ele,domID) { new Ajax.Request(pathWWW+'/getajax|consCatDomains', { method:'post', parameters: {catID: ele.value}, onSuccess: function(transport){ var response = transport.responseXML; populateDomains(response,domID); }, onFailure: function(){ } }); } function populateDomains(rXML,domIDS) { var domSelect = $('domSelect'); for(j = domSelect.length;j>=0;j--) domSelect.remove(j); domSelect.disabled=true; var alegeti = document.createElement('option'); alegeti.text = '- toate -'; alegeti.value = ''; try { domSelect.add(alegeti, null); // standards compliant; doesn't work in IE } catch(ex) { domSelect.add(alegeti); // IE only } var subdomenii = rXML.childNodes[0]; //build if(subdomenii.childNodes.length > 0) { for(var i=0;i'); var tbb = document.createElement("tbody"); } else { var tbl = document.createElement('table'); var tbb = document.createElement("tbody"); tbl.setAttribute('cellpadding','0'); tbl.setAttribute('cellspacing','0'); tbl.setAttribute('border','0'); } // create up arrow td var row = document.createElement('tr'); if(document.all) var cell = document.createElement(''); else var cell = document.createElement('td'); cell.setAttribute('colspan','3'); //create img var nimg = document.createElement('img'); if(document.all) nimg.src="http://www.avocatnet.ro/images/pop-up/sageata_sus.gif"; else nimg.src="http://www.avocatnet.ro/images/pop-up/sageata_sus.png"; nimg.className="tooltipUpArrow"; nimg.id = "infoArrowU"; cell.appendChild(nimg); row.appendChild(cell); tbb.appendChild(row); //end create up arrow td //create top tooltip var row = document.createElement('tr'); var cell = document.createElement('td'); cell.className="tooltipCorner_ul"; row.appendChild(cell); var cell = document.createElement('td'); cell.className="tooltipBar_u"; row.appendChild(cell); var cell = document.createElement('td'); cell.className="tooltipCorner_ur"; row.appendChild(cell); tbb.appendChild(row); //end create top tooltip if(doNotCloseAfter) { var imgClose = ""+infoTitle+""; //create close tooltip var row = document.createElement('tr'); var cell = document.createElement('td'); cell.className="tooltipBar_l"; row.appendChild(cell); var cell = document.createElement('td'); cell.className="tooltipText"; cell.innerHTML=imgClose; row.appendChild(cell); var cell = document.createElement('td'); cell.className="tooltipBar_r"; row.appendChild(cell); tbb.appendChild(row); //end close tooltip } //create middle tooltip var row = document.createElement('tr'); var cell = document.createElement('td'); cell.className="tooltipBar_l"; row.appendChild(cell); var cell = document.createElement('td'); cell.className="tooltipText"; cell.innerHTML=texty; row.appendChild(cell); var cell = document.createElement('td'); cell.className="tooltipBar_r"; row.appendChild(cell); tbb.appendChild(row); //end middle tooltip //create bottom tooltip var row = document.createElement('tr'); var cell = document.createElement('td'); cell.className="tooltipCorner_bl"; row.appendChild(cell); var cell = document.createElement('td'); cell.className="tooltipBar_b"; row.appendChild(cell); var cell = document.createElement('td'); cell.className="tooltipCorner_br"; row.appendChild(cell); tbb.appendChild(row); //end create bottom tooltip // create down arrow td var row = document.createElement('tr'); if(document.all) var cell = document.createElement(''); else var cell = document.createElement('td'); cell.setAttribute('colspan','3'); //create img var nimg = document.createElement('img'); if(document.all) nimg.src="http://www.avocatnet.ro/images/pop-up/sageata_jos.gif"; else nimg.src="http://www.avocatnet.ro/images/pop-up/sageata_jos.png"; nimg.className="tooltipDownArrow"; nimg.id = "infoArrowD"; cell.appendChild(nimg); row.appendChild(cell); tbb.appendChild(row); //end create down arrow td tbl.appendChild(tbb); newdiv.appendChild(tbl); newdiv.className ="tooltipDiv"; //add tooltip to document document.body.appendChild(newdiv); //position tooltip setPopupPosition(obj,newdiv,'infotip'); Effect.Appear(newdiv.id,{duration:.2}); //set fade out if(!doNotCloseAfter) { if(!hover) globalTimeout = window.setTimeout('Effect.Fade(\'infotipX\', {duration:.3,from:1.0, to:0.0})',2500); } //======================================== } function hideInfoPopup() { if($('infotipX')) { if($('tooltipX')) document.body.removeChild($('tooltipX')); document.body.removeChild($('infotipX')); window.clearTimeout(globalTimeout); } } function doCerereCons(cons) { if($('cerereNume').value.length < 2) { showToolTipFader('Completeaza numele.',$('cerereNume')); $('cerereNume').focus(); return false; } if(!validateMail($('cerereEmail'))) { return false; } if($('cerereIntrebare').value.length < 30) { showToolTipFader('Cererea de consultanta trebuie sa contina minim 30 de caractere.',$('cerereIntrebare')); $('cerereIntrebare').focus(); return false; } var cereEmail = $('cerereEmail').value; var cereInt = $('cerereIntrebare').value; var cereNume = $('cerereNume').value; new Ajax.Request(pathWWW+'/getajax|handleCereriCons', { method:'post', parameters: {consID: cons, cEmail: cereEmail, cInt: cereInt, cNume: cereNume}, onSuccess: function(transport){ var response = transport.responseXML; $('cerereFrm').innerHTML="
Cererea dvs a fost trimisa cu succes!

"; }, onFailure: function(){ } }); } function writeShopBooks(page) { if(!page) page = 0; new Ajax.Request(pathWWW + '/getajax|getPromotionForSlider?pageID=' + page, { onComplete: function(transport) { doCompleteWriteShopBooks(page, transport); } }); } function doCompleteWriteShopBooks(page, transport) { $('promotiiCarteContent').innerHTML = transport.responseText; page = page*1 + 1; setTimeout('writeShopBooks(' + page + ');', 4000); } function confirmContestKeyword() { var keyField = $('contestKeyword'); if(keyField.value.length < 3) { showToolTipFader('Cuvantul cheie trebuie sa contina minim 3 caractere.',keyField); keyField.focus(); return false; } var ok = confirm('Atentie: de la momentul la care veti completa cuvantul, \n acesta nu mai poate fi modificat / sters. \n Odata completat, cuvantul introdus de dumneavoastra\n este cel cu care veti participa la concurs.\n OK pentru a continua, Cancel pentru a reveni'); if(ok==true) document.contestKeywordFrm.submit(); else return false; } function getFriendsList(inObj) { inObj.show(); inObj.innerHTML = ' se incarca...'; new Ajax.Request(pathWWW+'/getajax|userFriends', { method:'post', onSuccess: function(transport){ var response = transport.responseText; inObj.innerHTML = response; }, onFailure: function(){} }); } function stickyFloat(id) { var el= $(id); var obH = el.getHeight(); var obW = el.getWidth(); var dH = document.body.clientHeight; var dW = document.body.clientWidth; var sT = document.documentElement.scrollTop; var wW = document.all ? document.documentElement.clientWidth : window.innerWidth; var wH = document.all ? document.documentElement.clientHeight : window.innerHeight; //alert("H: "+obH+" W:"+obW+"\n"+"DH: "+dH+"DW: "+dW+"\nsT: "+sT+"\n"+"wH: "+wH+" wW:"+wW); el.centru = function(how) { if(dW >= obW) el.style.left = ((dW-obW)/2)+"px"; else el.style.left = 0+"px"; if (typeof document.body.style.maxHeight == "undefined") { switch(how) { case 'sus': el.style.top = sT+"px"; break; case 'jos': el.style.top = (sT+wH-obH)-5+"px"; break; case 'mijloc': el.style.top = (sT+wH-obH)-(wH/2)+"px"; break; default: el.style.top = sT+"px"; break; } } } el.show(); return el; } startList = function() { if($('navCont')) { $("navCont").childElements().each( function(s) { s.observe("mouseover", function() { var sChild = this.childElements(); sChild.each( function(f) { f.style.display="block"; }); if(sChild.length >1) this.className = "navContActiv"; }); s.observe("mouseout", function() { s.className = ""; this.childElements().each( function(f) { f.style.display=""; }); }); }); } } window.onload=startList; avServOut = function(sID) { $('d'+sID).removeClassName('over'); } avServOver = function(sID) { $('d'+sID).addClassName('over'); } avServClick = function(sID,credit) { if($('s'+sID).value == 1) { creditServicii -= parseInt(credit); creditRest += parseInt(credit); $('s'+sID).value = 0; $('d'+sID).removeClassName('on'); } else { creditServicii += parseInt(credit); creditRest -= parseInt(credit); if(creditRest < 0) { showToolTipFader('Credit insuficient',$('d'+sID)); creditServicii -= parseInt(credit); creditRest += parseInt(credit) return false; } $('s'+sID).value = 1; $('d'+sID).addClassName('on'); } $('totalCrediteServicii').update(creditServicii); $('restCreditServicii').update(creditRest); } checkServicePurchaseFrm = function() { if(creditServicii == 0) showToolTipFader('Selectati unul dintre serviciile de mai sus',$('sAvServices')); else document.purchaseService.submit(); } function delForumMessage(obj,messID) { var texty = ""; new Ajax.Request(pathWWW+'/getajax|deleteForumPopupForm', { method:'post', parameters: {messageID: messID }, onSuccess: function(transport){ var response = transport.responseText; texty = response; showToolTipFader(texty,obj,2); }, onFailure: function(){} }); } function delTopicMessage(obj,topID) { var texty = ""; new Ajax.Request(pathWWW+'/getajax|deleteForumPopupFormTopic', { method:'post', parameters: {topicID: topID }, onSuccess: function(transport){ var response = transport.responseText; texty = response; showToolTipFader(texty,obj,2); }, onFailure: function(){} }); } function doDelFrmTopicReason() { if($('topicID')=="") { alert('Nu exista id topic, contact pianistul'); return false; } var val = $RF('delReasonTopicFrm','delReasonTopic'); if(!val) { alert('Selectati motiv'); return false; } if(val == 1 && $('motivText').value =='') { alert('Completati motiv pentru "Alte motive" '); return false; } $('delReasonTopicFrm').submit(); // window.location.reload(); } function doDelFrmMessageReason() { if($('messID')=="") { alert('Nu exista id mesaj, contact pianistul'); return false; } var valz = $RF('delReasonFrm','delReason'); if(!valz) { alert('Selectati motiv'); return false; } if(valz == 1 && $('motivText').value =='') { alert('Completati motiv pentru "Alte motive" '); return false; } $('delReasonFrm').submit(); // window.location.reload(); } function $RF(el, radioGroup) { if($(el).type && $(el).type.toLowerCase() == 'radio') { var radioGroup = $(el).name; var el = $(el).form; } else if ($(el).tagName.toLowerCase() != 'form') { return false; } var checked = $(el).getInputs('radio', radioGroup).find( function(re) {return re.checked;} ); return (checked) ? $F(checked) : null; } function sortThruFriends(obj) { $('isOffline').removeClassName("activ"); $('isOnline').removeClassName("activ"); $('isOnOff').removeClassName("activ"); obj.addClassName("activ"); i=0; if(obj.id == "isOnOff") { $$("li.listFriendOn").each(function(s) { s.show() }); } else { $$("li.listFriendOn").each(function(s) { if(s.id == obj.id+"F") { s.show(); } else { s.hide(); } }); } } function openMDetail(evt,usr) { var ele = Event.element(evt); var content =''; switch(ele.className) { case 'Mconsultant': content = '

Consultantul lunii

Medalie acordata lunar, in functie de media rating-ului obtinut in luna respectiva de consultantii inclusi in Catalogul Avocatnet.ro.
'; break; case 'Mservicii': content = '

Servicii Avocatnet.ro

Medalie acordata de Avocatnet.ro utilizatorilor care au achizitionat servicii Avocatnet.ro.
'; break; case 'Mutilizator': content = '

Utilizatorul lunii

Medalie acordata lunar, in functie de numarul de aplauze obtinut de membrii Avocatnet.ro in luna respectiva. (se adauga numai aplauzele primite de la utilizatori)
'; break; } showInfoTip(content,ele,'',false,'','hover'); /*if($('infotipX')) { document.body.removeChild($('infotipX')); } new Ajax.Request(pathWWW+'/getajax|medalieinfo', { method:'post', parameters: {userID: usr, className: ele.className }, onSuccess: function(transport){ var response = transport.responseText; showInfoTip(response,ele,'',false,'','hover'); }, onFailure: function(){} });*/ } function closeMDetail(evt) { if($('infotipX')) { document.body.removeChild($('infotipX')); } } function hartaTabbed(idz) { $('hAvCom').removeClassName('on'); $('hAvArt').removeClassName('on'); $('hAvComContent').hide(); $('hAvArtContent').hide(); $(idz).addClassName('on'); $(idz+'Content').show(); } // --------------------------------------------------- function showSelectBoxes(){ var selects = document.getElementsByTagName("select"); for (i = 0; i != selects.length; i++) { selects[i].style.visibility = "visible"; } } // --------------------------------------------------- function hideSelectBoxes(){ var selects = document.getElementsByTagName("select"); for (i = 0; i != selects.length; i++) { selects[i].style.visibility = "hidden"; } } // --------------------------------------------------- function showFlash(){ var flashObjects = document.getElementsByTagName("object"); for (i = 0; i < flashObjects.length; i++) { flashObjects[i].style.visibility = "visible"; } var flashEmbeds = document.getElementsByTagName("embed"); for (i = 0; i < flashEmbeds.length; i++) { flashEmbeds[i].style.visibility = "visible"; } } // --------------------------------------------------- function hideFlash(){ var flashObjects = document.getElementsByTagName("object"); for (i = 0; i < flashObjects.length; i++) { flashObjects[i].style.visibility = "hidden"; } var flashEmbeds = document.getElementsByTagName("embed"); for (i = 0; i < flashEmbeds.length; i++) { flashEmbeds[i].style.visibility = "hidden"; } } function getPageSize(){ var xScroll, yScroll; if (window.innerHeight && window.scrollMaxY) { xScroll = window.innerWidth + window.scrollMaxX; yScroll = window.innerHeight + window.scrollMaxY; } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac xScroll = document.body.scrollWidth; yScroll = document.body.scrollHeight; } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari xScroll = document.body.offsetWidth; yScroll = document.body.offsetHeight; } var windowWidth, windowHeight; // console.log(self.innerWidth); // console.log(document.documentElement.clientWidth); if (self.innerHeight) { // all except Explorer if(document.documentElement.clientWidth){ windowWidth = document.documentElement.clientWidth; } else { windowWidth = self.innerWidth; } windowHeight = self.innerHeight; } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode windowWidth = document.documentElement.clientWidth; windowHeight = document.documentElement.clientHeight; } else if (document.body) { // other Explorers windowWidth = document.body.clientWidth; windowHeight = document.body.clientHeight; } // for small pages with total height less then height of the viewport if(yScroll < windowHeight){ pageHeight = windowHeight; } else { pageHeight = yScroll; } // console.log("xScroll " + xScroll) // console.log("windowWidth " + windowWidth) // for small pages with total width less then width of the viewport if(xScroll < windowWidth){ pageWidth = xScroll; } else { pageWidth = windowWidth; } // console.log("pageWidth " + pageWidth) arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) return arrayPageSize; } function getPageScroll(){ var xScroll, yScroll; if (self.pageYOffset) { yScroll = self.pageYOffset; xScroll = self.pageXOffset; } else if (document.documentElement && document.documentElement.scrollTop){ // Explorer 6 Strict yScroll = document.documentElement.scrollTop; xScroll = document.documentElement.scrollLeft; } else if (document.body) {// all other Explorers yScroll = document.body.scrollTop; xScroll = document.body.scrollLeft; } arrayPageScroll = new Array(xScroll,yScroll) return arrayPageScroll; } Object.extend(Element, { getWidth: function(element) { element = $(element); return element.offsetWidth; }, setWidth: function(element,w) { element = $(element); element.style.width = w +"px"; }, setHeight: function(element,h) { element = $(element); element.style.height = h +"px"; }, setTop: function(element,t) { element = $(element); element.style.top = t +"px"; }, setLeft: function(element,l) { element = $(element); element.style.left = l +"px"; }, setSrc: function(element,src) { element = $(element); element.src = src; }, setHref: function(element,href) { element = $(element); element.href = href; }, setInnerHTML: function(element,content) { element = $(element); element.innerHTML = content; } });