Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2. -- Biblioteca de Javascript --
  3. Criado por Drizer.
  4. DATA: 29/10/10
  5. */
  6. $={redir:function(url,delay){if(delay!==null){setTimeout("location.href='"+url+"';",delay)}else{win.location=url}},mate:function(soma){return soma},Funcao:function(acaoDaFuncao){eval(acaoDaFuncao)},Subvar:function(nome,valor){a=$doc.createElement('script');a.innerHTML='var '+nome+'="'+valor+'"';$doc.body.appendChild(a)},Div:function(id,html){a=$doc.createElement('div');a.id=id;a.innerHTML=html;$doc.body.appendChild(a)},setVal:function(id,valor){$doc.getElementById(id).valor=valor},divHtml:function(id,html){$doc.getElementById(id).innerHTML=html},show:function(IdDoElemento,time){if(time==null){time=1}$.id(IdDoElemento).style.opacity='0.0';if($doc.getElementById(IdDoElemento).style.display==null||$doc.getElementById(IdDoElemento).style.display==undefined){return FA}else{$doc.getElementById(IdDoElemento).style.display=null;$.fadeIn(IdDoElemento,time)}},esconder:function(IdDoElemento,time){if(time==null){time=1}timelol=time*1000;$.fadeOut(IdDoElemento,time);setTimeout("$doc.getElementById('"+IdDoElemento+"').style.display='none';",1000+timelol)},fadeOut:function(id,time){target=$doc.getElementById(id);alpha=100;timer=(time*1000)/50;var i=setInterval(function(){if(alpha<=0)clearInterval(i);$.setAlpha(target,alpha);alpha-=2},timer)},fadeIn:function(id,time){target=$doc.getElementById(id);alpha=0;timer=(time*1000)/50;var i=setInterval(function(){if(alpha>=100)clearInterval(i);$.setAlpha(target,alpha);alpha+=2},timer)},setAlpha:function(target,alpha){target.style.filter="alpha(opacity="+alpha+")";target.style.opacity=alpha/100},fadeTo:function(id,alpha){id=$doc.getElementById(id);$.setAlpha(id,alpha)},popup:function(pagina,nome,w,h,scroll,NoCentro){if(NoCentro==true||NoCentro==null){LeftPosition=(screen.width)?(screen.width-w)/2:0;TopPosition=(screen.height)?(screen.height-h)/2:0}else{LeftPosition=0;TopPosition=0}c='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable';win.open(pagina,nome,c)},gerarCookie:function(nome,value,horas){var expire="";if(horas!=null){expire=new Date((new Date()).getTime()+horas*3600000);expire="; expires="+expire.toGMTString()}$doc.cookie=nome+"="+escape(value)+expire},lerCookie:function(nome){var valorCookie="";var search=nome+"=";if($doc.cookie.length>0){offset=$doc.cookie.indexOf(search);if(offset!=-1){offset+=search.length;end=$doc.cookie.indexOf(";",offset);if(end==-1)end=$doc.cookie.length;valorCookie=unescape($doc.cookie.substring(offset,end))}}return valorCookie},excluirCookie:function(strCookie){$.gerarCookie(strCookie,'',-1)},imagem:function(src,alt,id,append,onclick){a=$doc;b=$doc.getElementById(append).innerHTML;if(onclick!=null){c=encodeURI(onclick);d=' onclick="eval(decodeURI(\''+c+'\'));" '}else{d=''}a.getElementById(append).innerHTML=b+'\n<img src="'+src+'" alt="'+alt+'" id="'+id+'"'+d+'/>'},id:function(id){return $doc.getElementById(id)},modal:function(url){$.popup(url,'modal',500,500,'no',true)},numAleatorio:function(inferior,superior){numPossibilidades=superior-inferior;aleat=Math.random()*numPossibilidades;aleat=Math.floor(aleat);return parseInt(inferior)+aleat},corAleatoria:function(){a=new Array("0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F");cor_aleatoria="#";for(i=0;i<6;i++){posarray=$.numAleatorio(0,a.length);cor_aleatoria+=a[posarray]}return cor_aleatoria},urlDecode:function(string,overwrite){if(!string||!string.length){return{}}var obj={};var pairs=string.split('&');var pair,name,value;var lsRegExp=/\+/g;for(var i=0,len=pairs.length;i<len;i++){pair=pairs[i].split('=');name=unescape(pair[0]);value=unescape(pair[1]).replace(lsRegExp," ");if(overwrite!==true){if(typeof obj[name]=="undefined"){obj[name]=value}else if(typeof obj[name]=="string"){obj[name]=[obj[name]];obj[name].push(value)}else{obj[name].push(value)}}else{obj[name]=value}}return obj},jsGet:function(variavel){if(variavel==undefined){return FA}var wl=win.location.href;var params=$.urlDecode(wl.substring(wl.indexOf("?")+1));return(params[variavel])},confirmarNavegacao:function(msg){$doc.body.onbeforeunload=function(){return msg}},fecharJanela:function(){return win.close()},timeout:function(f,time){return setTimeout(f,time)},tamanhoMax:function(id,limite){limite=limite-1;if($id(id).value.length>limite)$id(id).value=$id(id).value.substring(0,limite)},Cookie:function(nome,acao,value,horas){if(acao=='ler'){return $.lerCookie(nome)}else if(acao=='del'){return $.excluirCookie(nome)}else if(acao=='criar'){return $.gerarCookie(nome,value,horas)}},piscar:function(id){$.pulso(id)},fadeLoop:function(id){$.pulso(id)},pulso:function(id){aPulso(id)},pararPulso:function(){aPulso=function(){return FA};setTimeout('unp();',1500)},bloqSelecionar:function(){function blockError(){return true}win.onerror=blockError;function disableselect(e){return FA}function reEnable(){return true}$doc.onselectstart=new Function("return FA");if(win.sidebar){$doc.onmousedown=disableselect;$doc.onclick=reEnable}},bloqBotaoDireito:function(){function click(){if(event.button==2||event.button==3){oncontextmenu='return FA'}}$doc.onmousedown=click;$doc.oncontextmenu=new Function("return FA;")},pararPiscar:function(){$.pararPulso()},pararFadeLoop:function(){$.pararPulso()},encJs:function(js){str=js;no=str.match(/[^|]/gi).reverse().join('');nox=escape(no);a="un=unescape('"+nox+"');go=un.match(/[^|]/gi).reverse().join('');eval(go)";b=escape(a);q="eval(unescape('"+b+"'));";ws=$.numAleatorio(10000,90000);sw=$.numAleatorio(10000,90000);c=escape("function d(j,s) {if (j!= "+ws+" || s!= "+sw+"){$.bloqBotaoDireito();$.bloqSelecionar();return FA;}"+q+" }d("+ws+","+sw+");");return"unescape('"+c+"');"},Topo:function(){$doc.location='#top'},maximizar:function(){win.moveTo(0,0);if($doc.all){top.win.resizeTo(screen.availWidth,screen.availHeight)}else if($doc.layers||$doc.getElementById){if(top.win.outerHeight<screen.availHeight||top.win.outerWidth<screen.availWidth){top.win.outerHeight=screen.availHeight;top.win.outerWidth=screen.availWidth}}},fcs:function(){win.focus()},cookiesEstaoAtivados:function(){return navigator.cookieEnabled},ObjHTMLAjax:function(id,url,metodo,argUrl){if(win.XMLHttpRequest){xmlhttp=new XMLHttpRequest()}else{xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")}xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4&&xmlhttp.status==200){$doc.getElementById(id).innerHTML=xmlhttp.responseText}};a=
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement