Cambia IP Prodigy Manual/modSeg

By Marco Polo Last update Nov 29, 2008 — Installed 1,184 times. Daily Installs: 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 6, 0, 0, 0, 2, 0, 3

There are 8 previous versions of this script.

Add Syntax Highlighting (this will take a few seconds, probably freezing your browser while it works)

// ==UserScript==
// @name           Cambia IP Prodigy Manual/modSeg
// @namespace      marcopoloaguilarzambrano@hotmail.com
// @description    Cambia la IP Manualmente || modSeg :]
// @description    sin problemas
// @description    ::v5.2::
// @include        http://home/*
// ==/UserScript==

VERSION=5.2;
function id(x){return document.getElementById(x);};
function search(){
if(location.search.length>=2||location.search!=""){
var search=location.search,searchA=search.split("&"),res="";
for(var i=0;i<searchA.length;i++){if(i==0) searchA[i]=searchA[i].replace("?","");
var vyv=searchA[i].split("=");
res+=(((i==0)?"{":"")+vyv[0]+":'"+vyv[1]+"'"+((i==searchA.length-1)?",length:"+searchA.length+"}":","));
}eval("var r="+res+";" );return r;}else{return false;}}
function validarIP(ip){if(!(/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(ip)))return false;var Split=ip.split(".");
for(var i=0;i<Split.length;i++)if(Number(Split[i]>255||Split.length<4))return false;return true;};
function Element(tag,o){var n=document.createElement(tag);
for(var i in o){if(typeof o[i]=="function" || typeof o[i]=="number")eval( "n."+ i +"="+ o[i] +";" );
else eval( "n."+ i +"=\""+ o[i] +"\";" );}return n;};
Array.prototype.inArray=function(v){for(var i=0;i<this.length;i++){if(this[i]===v)return i;}return false;};
Array.prototype.count=function(val){var contador=0;for(var i=0;i<this.length;i++){if(this[i]==val)contador++;}return contador;};
Array.prototype.kill=function(n){var temp1=[],temp2=[];for(var i=0;i<n;i++){temp1[i]=this[i];}
for(var j=(n+1),i=0;j<this.length;j++,i++){temp2[i] = this[j];}return temp1.concat( temp2 );};
String.prototype.replaceArray=function(){var temp=this;for(var i=0;i<arguments.length-1;i++){
temp=temp.replace(arguments[i],arguments[arguments.length-1]);}return temp;};
String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,'')};
function AIps(set,set2){
var aIps = GM_getValue("aIps"),si=false;
    if( aIps.length <=1 )si=true;
    aIps=aIps.split(",");
    if(set && set2!==false && set2!==true){
        var n = aIps.inArray(set.trim() );
        if(n!==false){
            aIps[n]=set2;
            GM_setValue("aIps", aIps.join(",").trim() );
            return;
        }
    }
    if(set && set2==true){
        var n = aIps.inArray(set.trim() );
        if(n!==false)
            GM_setValue("aIps", aIps.kill(n).join(",").trim() );
        return;
    }
    if(set && aIps.inArray(set.trim() )===false && aIps.length<10){
        if(!validarIP(set.trim() ) ){alert(set +"\nparece que no tiene formato de IP Valido.");return false;}
        if(si==false) aIps.push( set.trim() );
        else aIps[0]=set.trim();
        GM_setValue("aIps", aIps.join(",").trim() );
        return true;
    }
    return (si==false)?aIps:[];
};
function ACTUALIZAR(){
 
 GM_xmlhttpRequest({
   method:"GET",
   url:"http://userscripts.org/scripts/review/20617?format=txt",
   onload:function(response){
        var txt = response.responseText;
        var v = Number( txt.match( /::v\d{1,2}\.\d?::/ ).toString().replaceArray(/:/g,/v/g,"") );
        if( VERSION<v ){
            alert( "Hay una actualización\nEsta Versión: "+ VERSION +"\nNueva Versión: "+ v );
            GM_openInTab("http://userscripts.org/scripts/show/20617");
        }
   }
 });
 
 GM_setValue( "update", (new Date).getDate() );

};
 function inputz(){
 var tempArray = [];
 var inputs=document.getElementsByTagName("input");
 for(var i=0;i<inputs.length;i++){
    var inp = inputs[i];
    if( inp.type=="radio" && inp.name=="IP_DYNAMIC" ){
        tempArray.push( inp );
    }
 }
 return tempArray;
 };
function ip$co(){
    var data=document.getElementsByTagName("td");
    var txt="";
    var laIP="";
    var d = false;
    for(var i=0;i<data.length;i++){
        var td=data[i];
        if(td.className=="datasmall"){
            if(/^(Conectado|Sin conexión)$/.test(td.innerHTML)){
                txt+=td.innerHTML;
                d = true;
            }else if( d == true ){
                if( validarIP(td.innerHTML) ){
                    laIP = td.innerHTML;
                }
            }
        }
    }
    return [laIP, txt];
};
function uRl(){
    alert( document.location.host );
};


function cambiaipprodigy(){ // cambiaipprodigy

this.V = VERSION;


var v=function(k){this.k=k;
this.set=function(v){
return GM_setValue(this.k,v);};
this.get=GM_getValue(this.k);};

/* CONFIGURACION */
this.Cip=new v("ip");               // la IP (String)
this.Ctiempo=new v("tiempo");       // segundos -  timepo de actualizaciÓn (Number)
this.Cauto=new v("auto");           // true/false (true/false)
this.Cpass=new v("pass");           // pass de prodigy (String)
this.Cpasssis=new v("passsis");     // pass del sistema (String)
this.Cpuerta=new v("puerta");       // puerta de enlace predeterminada (String)
this.Cgenerar=new v("generar");     // generar de 2 en 2 IPS (true/false)
this.Cinstalado=new v("instalado"); // recien instalado (true/false)
//  AUTOBOT  //
this.bot=new v("bot");              // autobot true/false
this.enuso=new v("enuso");          // true/false        si YA! esta en uso
// /AUTOBOT  //
/* /CONFIGURACION */
laip=this.Cip;
tie=this.Ctiempo;
aut=this.Cauto;
pas=this.Cpass;
pasi=this.Cpasssis;
pue=this.Cpuerta;
gen=this.Cgenerar;
ins=this.Cinstalado;
//
bot=this.bot;
uso=this.enuso;

//
tiempo=1;
this.cambio=function(){

//if(Boolean(GM_getValue("bot"))!=true){  
var _s=search();
//}       

setTimeout(function(){

auto=Boolean(aut.get);  
contrase_a=pas.get; 
mascaradesubred="255.255.255.0"; 
IPS=["XXX.XXX.X.111","XXX.XXX.X.113","XXX.XXX.X.114",  
     "XXX.XXX.X.115","XXX.XXX.X.117","XXX.XXX.X.119"];
puertadeenlacepredeterminado=pue.get; 
generarde2en2=Boolean(gen.get); 


formx=id("pagepost");

var inputs=document.getElementsByTagName("input");

if(inputs.length>=27 && inputs.length <=30){
var pass="PPP_PASS";
var pass2="PPP_PASS_CONF";
var mascsubred="IP_BBAND_NETMASK";
var puertaenlacepredeter="IP_BBAND_GATEWAY";
var laIP="IP_BBAND_ADDR";


for(var i=0;i<inputs.length;i++){
   var input=inputs[i];
 if(input.name==pass || input.name==pass2){
  if(contrase_a=="undefined" || contrase_a==""){alert("no has puesto la contraseña");}else{
  input.style.color="red";
   input.value=contrase_a;}}
	if(input.name==mascsubred){
	input.style.color="red";
	 input.value=mascaradesubred;}
 if(input.name==puertaenlacepredeter){
   input.style.color="red";
  input.value=puertadeenlacepredeterminado;}
   
   if(input.name==laIP){
   
   var modseg = GM_getValue("modseg");
   var modseg_ = GM_getValue("modseg_");
   var c = GM_getValue("c");
   
   // modseg
   if( modseg==true && modseg_==true ){
        if( c <= 0 ){
            inputz()[1].checked = true;
            GM_setValue("c", (c+1) );
            input.value="255.255.255.0";
            break;
        }else if( c >= 1 ){
            inputz()[0].checked = true;
            GM_setValue("c", (c+1) );
            break;
        }
   }
   // modseg
   
    var ip=input;
    if(auto==true){
    
    if(laip.get=="undefined"){
        alert("No has configurado la IP");
        break;
    }
    ////////
	function getLaIp(val){
        if(/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(val.trim() ) )
            return val;
        else
            return GM_getValue("ip");
    };
    ////////
	 var automatico={
     ip: getLaIp(input.value),  // ip
	  array:function(){
	   var a=[];
       var un=Number(this.ip.substring(this.ip.length-1,this.ip.length));
	   var nd=Number(this.ip.substring(this.ip.length-1,this.ip.length-2));
	   var vip=this.ip.substring(0,this.ip.length-2);
	    for(var i=0;i<11;i++){
             if(un%2!=0){
              if(i%2==0 && generarde2en2==true){
               continue;
              }
             }
		 a.push(vip+nd+i);
		}
	      return a;
			}
	 };
     
	 for(var j=0;j<automatico.array().length;j++){
	   if(getLaIp(ip.value)==automatico.array()[j]){
       var _tempIP=automatico.array()[((j>=automatico.array().length-1)?0:(j+1))];
       var ai = AIps();
            if(GM_getValue("AIPS")==true && ai.length<=10 && ai.length>=5 ){
                var esta = GM_getValue("ip");
                var temp__ = false;
                    var posEsta = ai.inArray(esta);
                    if(posEsta!==false){
                        if(posEsta==ai.length-1){
                            ip.value = ai[0];
                            temp__ = true;
                        }else if(posEsta<10){
                            ip.value = ai[posEsta+1];
                            temp__ = true;
                        }
                    }
                    if(temp__==false){
                        ip.value = ai[0];
                    }
            }else{
                ip.value=_tempIP;
            }
	   input.style.color="red";
	   break;
	   }	 
	 }	 
	 
	}else{
	
     for(var j=0;j<IPS.length;j++){
	   if(ip.value==IPS[j]){
	    ip.value=IPS[((j>=IPS.length-1)?0:(j+1))];
		  input.style.color="red";
	break;
	   }	 
	 }
	 
	}
	 
	}
}

    formx.addEventListener("submit",function(){
var _in_=document.getElementsByTagName("input");
var _name_="IP_BBAND_ADDR";
var _type_="text";
var _num_temp_;
for(var I=0;I<_in_.length;I++){
    if(_in_[I].name==_name_ && _in_[I].type==_type_)_num_temp_=I;
}
        //GM_setValue("ip",_in_[_num_temp_].value);
    },true);

   if( GM_getValue("modseg") == false && GM_getValue("modseg_") == false ){        //submit automático para el Bot
    if(confirm("Hacer cambio de IP ahora???")){
        var _e_=formx.getElementsByTagName("input");
        for(var ii=0;ii<_e_.length;ii++){
            if(_e_[ii].type=="submit" && _e_[ii].value=="Guardar"){  
                _e_[ii].click();
            }
        }
    }
   }else{
        var _e_=formx.getElementsByTagName("input");
        for(var ii=0;ii<_e_.length;ii++){
            if(_e_[ii].type=="submit" && _e_[ii].value=="Guardar"){ 
                _e_[ii].click();
            }
        }
   }
    
}

},tiempo+"000");//cierra setTimeout



}; // /cambio



this.instalado=function(){

if(GM_getValue("instalado")!=false){
        alert("Acabas de instalar el Script,\nnecesitas configurar tu IP y la puerta de enlace.\nEspera en lo que se recupera la informacion\nLlevare a la pag de la informacion");
        document.location="javascript:document.location='http://home/xslt?PAGE=B02&THISPAGE=B01&NEXTPAGE=B02&action=instalado';";
}

}

this.obtenerdatos=function(){
var lai=false,_i;
var lap=false,_P;
    var ele=document.getElementsByTagName("td");
    for(var i=0;i<ele.length;i++){
        if(/Dirección de Internet:/.test(ele[i].innerHTML) && i>15){
            alert("Tu IP: "+ ele[(i+1)].innerHTML);
            _i=ele[(i+1)].innerHTML;lai=true;
        }else if(/Puerta de enlace predeterminada:/.test(ele[i].innerHTML) && i>15){
            alert("Tu Puerta de enlace: "+ ele[(i+1)].innerHTML);
            _p=ele[(i+1)].innerHTML;lap=true;
        }
    }
        if(lai==false && lap==false){
            alert("Hubo un error, tendras que ponerlos datos Manualmente en:\nComandos de el script -> Configuracion.");
            GM_setValue("instalado",false);GM_setValue("bot",false);GM_setValue("enuso",false);GM_setValue("AIPS",false);
            GM_setValue("ver",this.V.toString() );GM_setValue("modseg", false);GM_setValue("modseg_", false);
            GM_setValue( "update", (new Date).getDate() );GM_setValue( "seg", 8 );
            return;
        }
        if(lai==true || lap==true){
           GM_setValue("bot",false);GM_setValue("enuso",false);GM_setValue("instalado",false);GM_setValue("AIPS",false);
           GM_setValue("ver",this.V.toString() );GM_setValue("modseg", false);GM_setValue("modseg_", false);
           GM_setValue( "update", (new Date).getDate() );GM_setValue( "seg", 8 );
            gen.set(false);   //
            aut.set(true);
         if(lai==false && lap==true){
            alert("Hubo un Error con la IP.\npero tu la Puerta de enlace se registro");
            pue.set(_p);
         }else if(lai==true && lap==false){
            alert("Hubo un Error con la Puerta de enlace.\n pero la IP se registro");
            laip.set(_i);
         }else{
            laip.set(_i);
            pue.set(_p);
            alert("Tu puerta de enlace e ip se registraron CORRECTAMENTE!");
            setTimeout(function(){
                document.location="javascript:document.location='http://home/';";
            },1000);
         }
        }
}


this.mostrarform=function(){

if(document.getElementById("elDiv")!=null){
    document.getElementById("elDiv").style.visibility="visible";
    return;
}

var elDiv=Element("div",{id:"elDiv"});
 /////////
 var t="   <center><br> ";
 t+="    <b style='font-family:Verdana,Helvetica,Arial;font-size:14px;'>Configuración</b>";
 t+=" <br>";
 t+=" <span style='font-family:Verdana,Helvetica,Arial;font-size:14px;'> .:Cambia IP Prodigy Manual/modSeg:. v5.2 </span>";
 t+="   </center> ";
 t+="    <br> ";
 t+="    <table class='laTabla' border='0px'>";
 t+="     <tr><td style='font-family:Verdana,Helvetica,Arial;font-size:13px;'>";
    if(pas.get!=undefined)
 t+="    Contraseña de Prodigy*: </td><td> <input type='password' class='elInput' value='"+ pas.get +"' id='pass' />";
    else
 t+="    Contraseña de Prodigy*: </td><td> <input type='password' class='elInput' value='' id='pass' />";
 t+="     </td></tr>";
 t+="     <tr><td style='font-family:Verdana,Helvetica,Arial;font-size:13px;'>";
    if(pue.get!=undefined)
 t+="    Puerta de enlace pred.*: </td><td> <input type='text' class='elInput' value='"+ pue.get +"' maxlength='15' id='puerta' />";
    else
 t+="    Puerta de enlace pred.*: </td><td> <input type='text' class='elInput' value='' maxlength='15' id='puerta' />";
 t+="     </td></tr>";
 t+="    <tr><td style='font-family:Verdana,Helvetica,Arial;font-size:13px;'>";
    if(pasi.get!=undefined)
 t+="Contraseña del sistema: </td><td><br> <input type='password' value='"+ pasi.get +"' id='passsis' class='elInput' />";
    else
 t+="    Contraseña del sistema: </td><td><br> <input type='password' value='' id='passsis' class='elInput' />";
 t+="    </td></tr>";
 //
     if( GM_getValue("seg")!=undefined )
 t+="    Segundos:  <input type='text' class='elInput' value='"+ GM_getValue("seg") +"' maxlength='2' id='seg' style='width:130px;' />";
    else
 t+="    Segundos:  <input type='text' class='elInput' value='de 8 a 60, default: 8' maxlength='2' id='seg' style='width:130px;' />";
 t+="    El tiempo que tarda la pág en recargar la 2ª vez, cuando el foco va de rojo a verde. De 8 a 60, default: 8";
 //
 t+="   <tr><td style='font-family:Verdana,Helvetica,Arial;font-size:13px;'> <br> Tu IP: <b><span id='laip'> ---------- </span></b><br>";
 t+="    <input type='button' value='Guardar' class='inc' id='salvar' />  <input type='button' class='inc' value='Cancelar' id='cancelar' />  <a href='#INFO' onclick='return false;' id='info'>Información</a>";
 t+="    </td></tr>";
 t+="     </table>";
 t+="    <br>";
 t+=" <span style='font-family:Verdana,Helvetica,Arial;font-size:13px;'> cualquier problema:<br>   <i><u>marcopoloaguilarzambrano@hotmail.com</u></i> </span>";
    ///////
    
    var estilos=[
        "#elDiv {visibility:visible;position:absolute;left:10px;top:10px;width:360px;height:470px;border:.2em #111 dashed;padding:10px;}",
        ".elInput:focus { border:1px black solid; }",
        "#contenido {background-color:silver;width:360px;height:470px;}",
        ".inc {width:100px;height:50px;font-family:Lucida Console,Arial,Helvetica;font-size:1.3em}",
        ".inc:hover {font-weight:bold;}",
        ".ips {width:100px;height:30px;font-size:1.5em;font-family:Helvetica;}",
        ".losInputs {font-weight:bold;}",
        ".losInputs:focus {color:green;}"
                ];
    GM_addStyle(estilos.join("\n"));
    
    var elDiv2=Element("div",{id:"contenido",innerHTML:t});

    elDiv.appendChild(elDiv2);
    document.body.appendChild(elDiv);    
    
    var salvar=id("salvar");
    var _ip=id("laip");
    var seg_ = id("seg");
    

    if(laip.get!=undefined || laip.get!="undefined")
        _ip.innerHTML=laip.get;
        
        /*
    seg_.addEventListener('click',function(){
        if( this.value=="de 8 a 60, default: 8" )this.value="";
    }, true);
    seg_.addEventListener('blur',function(){
        if( this.value.indexOf(" ")!=-1 || this.value=="" || isNaN(this.value) ){
            if( GM_getValue("seg")!=undefined )this.value=GM_getValue("seg");
            else this.value="de 8 a 60, default: 8";
        }
    }, true);
    */
  
    salvar.addEventListener('click',function(){
        var $ip_=new cambiaipprodigy;
        $ip_.validarform();
        document.body.removeChild(document.getElementById("elDiv"));
        return false;   
    },true);
    
    var cancelar=id("cancelar");
    cancelar.addEventListener("click",function(){
          document.body.removeChild(document.getElementById("elDiv"));
          return;
    },true);
    
    var info = id("info");
    info.addEventListener("click",function(){
    
    var pro = new cambiaipprodigy;
    pro.info();
    
    },false);
    
    
}

var contra=id("pass"),s0=false;
var puerta=id("puerta"),s1=false;
var contrasis=id("passsis"),s2=false;
var seg=id("seg"),s3=false;

this.validarform=function(){

var MSGS=["Contraseña Prodigy","Puerta de enlace","Contraseña Sistema","Segundos"];

if(contra.value!=pas.get && contra.value!=""){
    pas.set(contra.value);
    s0=true;
}
if(puerta.value!=pue.get && puerta.value!="" ){
    pue.set(puerta.value);
    s1=true;
}
if(contrasis.value!=pasi.get && contrasis.value!=""){
    pasi.set(contrasis.value);
    s2=true;
}
var n = Number( seg.value );
if( !isNaN(n) && n>=8 && n<=60 ){
    GM_setValue( "seg", n );
    s3=true;
}

var msgtxt="";
for(var i=0;i<MSGS.length;i++){
    eval("if(s"+ i +"==true){msgtxt+= MSGS["+ i +"] + \"......  Actualizado\\n\";}");
}
if(msgtxt.length>=8)
    alert(msgtxt);

};

this.cancelar=function(){
var cancel = false;

if(contra.value!=pas.get && contra.value!=""){
    cancel = true;
}
if(puerta.value!=pue.get){
    cancel = true;
}
if(contrasis.value!=pasi.get && contrasis.value!=""){
    ccancel = true;
}

return cancel;

}


this.ponercontrase_a=function(){
if(!(/Sistema: Contraseña/.test(document.title.toString())))return false;

var name_="PASSWORD";
var clase="textmono";

var tags=document.getElementsByTagName("input");

for(var i=0;i<tags.length;i++){
    if(tags[i].name==name_ && tags[i].className==clase){
        if(pasi.get!=undefined && pasi.get!=""){
            var s_=search();
            if(s_.bot!=undefined && Boolean(s_.bot)==true){
                if(Boolean(GM_getValue("enuso"))==true){
                    window.close();
                    //return false;
                }
                GM_setValue("bot",true);
                //GM_setValue("enuso","true");
            }
            tags[i].value=pasi.get;
            id("pagepost").submit();
        }else
            alert("Necesitas configurar el pass del sistema,\npara que se ponga automaticamente\nO fíjate que no tenga un espacio en Blanco");
    }   
}

};

this.info=function(){

    var div=id("contenido");
    
    var txt = 
    [
    "<br><h3>Atajos</h3>",
    "<p><b>Shift</b>+<b>c</b> ................................................... Cambiar IP (modo normal)<br>",
    "<b>Shift</b>+<b>s</b> .................................................... Cambiar IP (modoSeg)**<br>",
    "<b>Shift</b>+<b>m</b> ................................................... Abrir Menú <br>",
    "<b>Shift</b>+<b>x</b> ................................................... Muestra IP para copiarla </p><br>",
    "<p> ** Usar este método es el mas garantizado </p>",
    "<center>            <b>Press Esc</b></center>"
    ];
    
    div.innerHTML=txt.join("");


};


} // /cambiaipprodigy

$s=search();
$ip=new cambiaipprodigy;
if(GM_getValue("instalado")==undefined){
        GM_setValue("instalado",true);
}
/////////
function ini_modseg(){
GM_setValue("modseg", true);
GM_setValue("modseg_", true);
GM_setValue("c", 0);
};
function des_modseg(){
GM_setValue("modseg", false);
GM_setValue("modseg_", false);
GM_setValue("c", 0);
};
function modseg(){
    ini_modseg();
    document.location="javascript:document.location='http://home/xslt?PAGE=B05&THISPAGE=B01&NEXTPAGE=B05';";
};
if($s.length==1 && $s.modseg=="true"){
    modseg();
}else if( $s.length==1 && $s.PAGE=="B01" && GM_getValue("modseg")==true ){
   var modseg = GM_getValue("modseg");
   var modseg_ = GM_getValue("modseg_");
   var c = GM_getValue("c");
   if( c <= 1 ){
        setTimeout(function(){
            document.location="javascript:document.location='http://home/xslt?PAGE=B05&THISPAGE=B01&NEXTPAGE=B05';";
        }, 3000);
   }else if(c >= 2 ){
        if( GM_getValue("seg")==undefined )GM_setValue("seg", 8)
        setTimeout(function(){
            document.location="javascript:document.location='http://home/xslt?PAGE=B01&q=t';";
        }, Number( GM_getValue("seg") ) *1000 );
   }
}else if( $s.length==2 && $s.q=="t" ){
    var fnc = ip$co();
    var laIP = fnc[0];
    var conect = fnc[1];
    if( /ConectadoConectado/.test(conect) && laIP!=GM_getValue("ip") ){
        GM_setValue( "ip", laIP );
        des_modseg();
        document.title = "Listo!";
    }else{
        modseg();
    }
}
if( GM_getValue("modseg")==false && $s.length==3 && $s.PAGE=="B01" ){
    var laIP = ip$co()[0];
    if( laIP != GM_getValue("ip") )
        GM_setValue( "ip", laIP );
}
if(GM_getValue("instalado")!=false && $s.action=="instalado"){
$ip.obtenerdatos();
}
if(GM_getValue("instalado")!=false){
    if(GM_getValue("aIps")==undefined)GM_setValue("aIps","");
$ip.instalado();
}
if(/Sistema: Contraseña/.test(document.title.toString())){
$ip.ponercontrase_a();
}
if(/Enlace de banda ancha: Configuración avanzada/.test(document.title.toString())){
$ip.cambio();
}
if( document.location.toString()=="http://home/" && GM_getValue("update")!=(new Date).getDate() ){
ACTUALIZAR();
}

var menu="";
menu+="        <span class='navtext'> ";
menu+="            <a class='navtext' href='#' onclick='return false;' id='elMenu' style='color:red;'>[ CambiarIP ]</a> ";
menu+="        </span> ";

var losTags=document.getElementsByTagName("div");
var laClase="topnavlinks";
var numTag;

for(var i=0;i<losTags.length;i++){if(losTags[i].className==laClase){numTag=i;}}

var elLink=Element("div",{className:"topnavlink",innerHTML:menu});

var padre=losTags[numTag];

padre.replaceChild(elLink,padre.firstChild);

var elMenu=document.getElementById("elMenu");
elMenu.addEventListener("click",function(){
if(document.getElementById("elDiv")==null)
 $ip.mostrarform();
else
 document.getElementById("elDiv").style.visibility="visible";
},true);
////

function qit(){
     while( id("elDiv")!=null )document.body.removeChild( document.getElementById("elDiv") );
     while( id("div")!=null )document.body.removeChild( document.getElementById("div") );
};

document.addEventListener("keypress",function(e){
var key = e.which;
var key2 = e.keyCode;
var shift = e.shiftKey;
//  c == 67-99  || m == 77-109 || s == 83-115 || x == 88-120 //
if( (key==67 || key==99) && shift===true){
    if("http://home/xslt?PAGE=B05&THISPAGE=B01&NEXTPAGE=B05"!=document.location.toString() ){
        GM_setValue("bot",false);GM_setValue("enuso",false);
        document.location="javascript:document.location='http://home/xslt?PAGE=B05&THISPAGE=B01&NEXTPAGE=B05';";
    }
}else if( (key==83 || key==115) && shift===true){
    modseg();
}else if( (key==88 || key==120) && shift===true ){
    qit();
    var elDiv=document.createElement("input");
    elDiv.id = "div";
    elDiv.type = "text";
    elDiv.style.fontSize = "20px";
    elDiv.style.width = "150px";
    elDiv.style.position = "absolute";
    elDiv.style.top = "1px";
    elDiv.style.left = "1px";
    elDiv.value = GM_getValue("ip");
    document.body.appendChild( elDiv );
    document.getElementById("div").select();
}else if( (key==77 || key==109) && shift===true){
    qit();
    var prodigy=new cambiaipprodigy;
    prodigy.mostrarform();
}else if( key==0 && key2==27 ){
    qit();
}

},true);
////

/*
GM_setValue("instalado", true);
GM_setValue("ip", "");
GM_setValue("passsis", "");
GM_setValue("pass", "");
GM_setValue("puerta", "");
*/