function creazaXmlHttp(){ var xmlHttp; if(window.ActiveXObject){ try{ xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e){ xmlHttp = false; } } else{ try{ xmlHttp = new XMLHttpRequest(); } catch (e){ xmlHttp = false; } } if (!xmlHttp) alert("Nu s-a putut crea obiectul XMLHttpRequest ."); else return xmlHttp; } function $val(a){ try{ return document.getElementById(a).value; } catch(e){ alert('Elementul '+a+' nu poate fi gasit reporniti browserul si incercati din nou'); return false; } } function $v(a,v){ try{ document.getElementById(a).value=v; return true; } catch(e){ alert('Elementul '+a+' nu poate fi gasit reporniti browserul si incercati din nou'); return false; } } function $html(a,v){ try{ document.getElementById(a).innerHTML=v; return true; } catch(e){ alert('Elementul '+a+' nu poate fi gasit reporniti browserul si incercati din nou'); return false; } } function $id(a){ var rez; try{ rez=document.getElementById(a); return rez; } catch(e){ alert('Elementul '+a+' nu poate fi gasit reporniti browserul si incercati din nou'); return false; } } var xmainpath='images/'; var xmlHttp=creazaXmlHttp(); function Ejax(phpfile,params,divelem){ if(divelem=='0'){ var xdiv='0'; var dispwait=false; } else if (divelem!='') { var xdiv=$id(divelem); var dispwait=true; } else { var xdiv=''; var dispwait=false; } this.phppath=phpfile; var xphp=this.phppath; if(params!=''){ var xparam='?'+params+"&sid="+Math.random(); } else{ var xparam="?sid="+Math.random(); } this.cerere=function(){ if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0){ xmlHttp.open("GET", xphp+xparam, true); xmlHttp.onreadystatechange = xrez; xmlHttp.send(null); if(dispwait){ xdiv.innerHTML= ''+'PLEASE WAIT!!!'; //document.getElementById('AjaxLoading').style.display='block'; } } else{ if(dispwait){ xdiv.innerHTML= ''+'PLEASE WAIT!!!'; //document.getElementById('AjaxLoading').style.display='block'; } } }; var xcer=this.cerere; this.rezultat=function(){ if (xmlHttp.readyState == 4){ if (xmlHttp.status == 200){ var raspuns = xmlHttp.responseText; if(xdiv==''){ alert(raspuns); } else if (xdiv=='0') { //nu facem nimik } else{ //document.getElementById('AjaxLoading').style.display='none'; xdiv.innerHTML = raspuns; } } else{ alert("Problema la accesare: " +xmlHttp.statusText); } } else{ if(dispwait){ xdiv.innerHTML= ''+'PLEASE WAIT!!!'; //document.getElementById('AjaxLoading').style.display='block'; } } }; var xrez=this.rezultat; xcer(); } //functie ajax callback var xmainpath='images/'; var xmlHttp=creazaXmlHttp(); function EjaxCb(phpfile,params,divelem,callback){ if(divelem!=''){ var xdiv=$id(divelem); var dispwait=true; } else { var xdiv=''; var dispwait=false; } //var dispwait=false; // sa nu mai faca loading this.phppath=phpfile; var xphp=this.phppath; if(params!=''){ var xparam='?'+params+"&sid="+Math.random(); } else{ var xparam="?sid="+Math.random(); } var xmlHttp=creazaXmlHttp(); this.cerere=function(){ if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0){ xmlHttp.open("GET", xphp+xparam, true); xmlHttp.onreadystatechange = xrez; xmlHttp.send(null); if(dispwait){ xdiv.innerHTML= ''+'PLEASE WAIT!!!'; //document.getElementById('AjaxLoading').style.display='block'; } } else{ if(dispwait){ xdiv.innerHTML= ''+'PLEASE WAIT!!!'; //document.getElementById('AjaxLoading').style.display='block'; } } }; var xcer=this.cerere; this.rezultat=function(){ if (xmlHttp.readyState == 4){ if (xmlHttp.status == 200){ var raspuns = xmlHttp.responseText; if (callback) {callback(raspuns);} else if(xdiv==''){ alert(raspuns); } else{ //document.getElementById('AjaxLoading').style.display='none'; xdiv.innerHTML = raspuns; } } else{ alert("Problema la accesare: " +xmlHttp.statusText); } } else{ if(dispwait){ xdiv.innerHTML= ''+'PLEASE WAIT!!!'; //document.getElementById('AjaxLoading').style.display='block'; } } }; var xrez=this.rezultat; xcer(); } function getwh(){ if (parseInt(navigator.appVersion)>3) { if (navigator.appName=="Netscape") { winW = window.innerWidth; winH = window.innerHeight; } if (navigator.appName.indexOf("Microsoft")!=-1) { winW = document.body.offsetWidth; winH = document.body.offsetHeight; } } return winH; } function redirect(l,g) { var link=l; if (g!='') { var get='&'+g; window.location='index.php?action='+link+get; } else { window.location='index.php?action='+link; } } function select_all_object(idMax,container,select,idInput) { var nrMax=document.getElementById(idMax).value; var value=''; if (select.checked==true) { for (var j=1;j<=nrMax;j++) { if (value=='') { value=document.getElementById(idInput+j).value; } else { value+=','+document.getElementById(idInput+j).value; } document.getElementById(idInput+j).checked=true; } } else { for (var j=1;j<=nrMax;j++) { document.getElementById(idInput+j).checked=false; } } document.getElementById(container).value=value; } function select_object(v,id) { var val=v.value; var idUri=document.getElementById(id).value; var idUri2=idUri.split(','); var l=idUri2.length; if (v.checked) { idUri2.push(val); if (document.getElementById(id).value=='') { document.getElementById(id).value=idUri2.join(''); } else { document.getElementById(id).value=idUri2.join(','); } } else { var j=0; for (j;j<=l;j++) { if (val==idUri2[j]) { idUri2.splice(j,1); } } document.getElementById(id).value=idUri2.join(','); } } function eurl(v) { return encodeURIComponent(v); } var IE6 = false /*@cc_on || @_jscript_version < 5.7 @*/; function eroare(msg,w,h) { if (IE6) { alert(msg); } else { alerta('
'+msg+'
',w,h); } } function operationAnswerHide(div) { if (div=='') { div='divRaspuns'; } $("#"+div).hide("slow"); } var interval=0; function operationAnswer(div,msg,type) { clearTimeout(interval); if (type=='ok') { $id(div).className='divRaspunsOk'; } else if (type=='error') { $id(div).className='divRaspunsError'; } $html(div,msg); $("#"+div).show("slow"); interval=setTimeout("operationAnswerHide('')",5000); } function AjaxW(parametrii,fisier,id_f,titlu_f,latime_f,inaltime_f,min_b,max_b,close_b) { //Swindow(id_f,'',titlu_f,latime_f,inaltime_f,min_b,max_b,close_b); //Ajax(parametrii,fisier,'continut_window_'+id_f); NSS_win(id_f,titlu_f,'',latime_f+20,inaltime_f,true); $('#NSS_win_content_'+id_f).load(fisier+'?'+parametrii); } function AIM () { if (this==window) {return null;} this.iframename=''; do { this.iframename='aimf' + Math.floor(Math.random() * 99999); } while (document.getElementById(this.iframename)); this.div=document.createElement('DIV'); this.div.style.display='none'; this.div_iframe=document.createElement('IFRAME'); this.div_iframe.style.display='none'; this.div_iframe.src='about:blank'; this.div_iframe.id=this.iframename; this.div_iframe.name=this.iframename; var thisobj=this; this.div_iframe.onload=function () {thisobj.loaded();} this.div.appendChild(this.div_iframe); document.body.appendChild(this.div); this.submit = function (f, onStart, onComplete) { this.onComplete=onComplete; f.setAttribute('target', this.iframename); if (typeof onStart=='function') { return onStart(this); } else {return true;} } this.loaded = function () { if (this.div_iframe.contentDocument) { var d = this.div_iframe.contentDocument; } else if (this.div_iframe.contentWindow) { var d = this.div_iframe.contentWindow.document; } else { var d = window.frames[this.iframename].document; } if (d.location.href == "about:blank") { return; } if (typeof this.onComplete == 'function') { this.onComplete(d.body.innerHTML,this); } } } function number_format( number, decimals, dec_point, thousands_sep ) { // http://kevin.vanzonneveld.net // + original by: Jonas Raoni Soares Silva (http://www.jsfromhell.com) // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // + bugfix by: Michael White (http://getsprink.com) // + bugfix by: Benjamin Lupton // + bugfix by: Allan Jensen (http://www.winternet.no) // + revised by: Jonas Raoni Soares Silva (http://www.jsfromhell.com) // + bugfix by: Howard Yeend // + revised by: Luke Smith (http://lucassmith.name) // + bugfix by: Diogo Resende // + bugfix by: Rival // % note 1: For 1000.55 result with precision 1 in FF/Opera is 1,000.5, but in IE is 1,000.6 // * example 1: number_format(1234.56); // * returns 1: '1,235' // * example 2: number_format(1234.56, 2, ',', ' '); // * returns 2: '1 234,56' // * example 3: number_format(1234.5678, 2, '.', ''); // * returns 3: '1234.57' // * example 4: number_format(67, 2, ',', '.'); // * returns 4: '67,00' // * example 5: number_format(1000); // * returns 5: '1,000' // * example 6: number_format(67.311, 2); // * returns 6: '67.31' var n = number, prec = decimals; n = !isFinite(+n) ? 0 : +n; prec = !isFinite(+prec) ? 0 : Math.abs(prec); var sep = (typeof thousands_sep == "undefined") ? ',' : thousands_sep; var dec = (typeof dec_point == "undefined") ? '.' : dec_point; var s = (prec > 0) ? n.toFixed(prec) : Math.round(n).toFixed(prec); //fix for IE parseFloat(0.55).toFixed(0) = 0; var abs = Math.abs(n).toFixed(prec); var _, i; if (abs >= 1000) { _ = abs.split(/\D/); i = _[0].length % 3 || 3; _[0] = s.slice(0,i + (n < 0)) + _[0].slice(i).replace(/(\d{3})/g, sep+'$1'); s = _.join(dec); } else { s = s.replace('.', dec); } return s; }