﻿var xv=new Array("atfsti",".aspx","");var pe=".aspx";var pw;var af=true;var par=null;var ar=null;var ob,od,obt;var obch=false,odch=false;var addthis_pub="automobile247";var addthis_language="es";var addthis_brand="<strong class='lg'>AUTOMOBILE<span>247</span></strong><small>™</small>";var addthis_logo="http://www.automobile247.es/i/lg.gif";var addthis_options="email,favorites,google,live,yahoobkm,delicious,reddit,magnolia,facebook,myspace,twitter,more";var addthis_offset_top=8;var addthis_localize={share_caption:"Compartir favorito",email_caption:"Enviar por email",email:"Enviar email",favorites:"Añadir favorito",more:"más sitios..."};function dr(v){document.write(v);}function i(o){return document.getElementById(o);}function t(o,n){return o.getElementsByTagName(n);}function gee(){return window.event;}function ae(o,n,h){if(o.addEventListener)o.addEventListener(n,h,false);else if(o.attachEvent)o.attachEvent("on"+n,h);}function de(o,n,h){if(o.removeEventListener)o.removeEventListener(n,h,false);else if(o.detachEvent)o.detachEvent("on"+n,h);}function sep(e){if(window.event){e=window.event;e.returnValue=false;e.cancelBubble=true;return;}e.preventDefault();e.stopPropagation();}
function gov(o,l)
{
    var v=0;
    if(o.offsetParent)
    {
        do v+=(l?o.offsetLeft:o.offsetTop);
        while(o=o.offsetParent)
    }
    return v
}
function cbit(o)
{
    var v;
    if(v=o.innerText)
        return v;
    if(v=o.textContent)
        return v;
    return ""
}
function cbsit(o,v){if(o.innerText){o.innerText=v;return}o.textContent=v}
function gtc(n)
{
    var v,p,s=document.cookie.split("; ");
    for(var x=0,y=s.length;x<y;x++)
    {
        p=s[x].split("=");
        if(p[0]==n)
        {
            v=p[1];
            if(v&&(v.length>0))
                return unescape(v);
            return null
        }
    }
}
function opc(o,v)
{
    var s=o.style;
    v=((v==100)?99.999:v);
    s.filter="alpha(opacity="+v+")";
    v=v/100;
    s.KhtmlOpacity=v;
    s.MozOpacity=v;
    s.opacity=v;
}
function ffe(o)
{
    o=i(o);
    if(af)
    {
        o.focus();
        o.value+=""
    }
}
function fbe(o)
{
    o=i(o);
    if(af)
    {
        o.focus();
        o.blur()
    }
}
function che(o)
{
    return(o.className.indexOf("err")!=-1);
}
function gar()
{
    var r;
    if(window.XMLHttpRequest)
        r=new XMLHttpRequest();
    else if(window.ActiveXObject)
    {
        try
        {
            r=new ActiveXObject("Msml2.XMLHTTP")
        }
        catch(e1)
        {
            try
            {
                r=new ActiveXObject("Microsoft.XMLHTTP")
            }
            catch(e2)
            {
                r=null
            }
        }
    }
    return r
}
function d(t,a)
{
    var f=document.forms["f"];
    if(!f)
    {
        f=document.f
    }
    if(!f.onsubmit||(f.onsubmit()!=false))
    {
        f.__eventtarget.value=t;
        f.__eventargument.value=a;
        f.submit()
    }
}
function GetTI(o,s)
{
    var v=gtc("atfsti");
    if(v)
    {
        var u=document.URL;
        var ioq=u.indexOf("?");
        if (ioq>0)
            u=u.substring(0,ioq);
        var lios=(s?u.lastIndexOf("/"):u.lastIndexOf("-"));
        var ioe=u.indexOf(".aspx");
        u=u.substring(lios+1,ioe);
        if(o)
        {
            //i("tibc").href=v+"#"+u;

	    var dv=i("dvob");
            i("tibc").href=dv.firstChild.href=v+"#"+u;
            
            dv=dv.style;
            dv.fontSize="1.1em";
            dv.padding="7px 0 7px 3px";
            dv.visibility="visible";
            
            lios=(v.lastIndexOf(s?"/":"-"));
            v="/"+v.substring(lios+1);
            dv=i("dvor");
            dv.firstChild.href=v;
            
            dv=dv.style;
            dv.fontSize="1em";
            dv.padding="4px 0 0 3px";
            dv.visibility="visible";

            rban()
        }
        else
            document.write(" › <a id=\"tibc\" href=\""+v+"#"+u+"\" title=\"Vuelve al listado de vehículos\">Tu búsqueda</a>")
    }
}function SetTI(){document.cookie="atfsti="+escape(window.location.pathname)+";path=/"}function ClrTI(){document.cookie="atfsti=;path=/"}function caf(){af=false}function acaf(){var f=i("f").elements;for(var x=0;x<f.length;x++)ae(f[x],"focus",caf)}function elp(e,a){if(document.open(a.href,"_blank",""))sep(e)}
function rb(o)
{
    o=i(o).parentNode;
    o.parentNode.removeChild(o);
}

function rgmmbq()
{
    var b=i("cqs_btgmm").parentNode;
    b.parentNode.removeChild(b);
    i("cqs_cbma").style.width="172px";
}

function rgmmb()
{
    var b=i("cs_btgmm").parentNode;
    b.parentNode.removeChild(b);
    i("cs_cbma").style.width="209px";
}

function fl(o)
{
    var e=gee();
    if(e)
    {
        o=i(o.htmlFor);
        if(!o.disabled)
        {
            o.focus();
            e.returnValue=false
        }
    }
}

function slg()
{
    var as=t(i("lg"),"a");
    as[0].href=as[1].href
}

function uo()
{
    var v=gtc("atfsaun");
    if(v)
    {
        v=v.replace(/\+/g," ");
        i("uo").innerHTML="<strong title=\""+v+"\">"+v+"</strong><ul><li class=\"first\"><a href=\"/mis-vehiculos/\" title=\"Entra en tu área privada\">Mis vehículos</a></li><li class=\"last\"><a href=\"/cerrar-sesion.aspx\">Cerrar sesión</a></li></ul>"
    }
}

function suiqd()
{
    var b,g,q=i("ciqi").style,s=t(t(i("ciq"),"h2")[0],"span")[0];
    q.display="none";
    q.position="absolute";
    q.width="280px";
    q.padding="2px 4px 3px 4px";
    q.background="#ffe";
    q.color="#777";
    
    s.title="";
    s.onmouseover=function(){
        if(!b)
        {
            b=i("ciq_tbm");
            g=b.style;
        }
        g.color="#eee";
        b.focus();
        b.value+="";
        
        var p=i("p_ciq_tbm");
        q.top=(gov(p)+20)+"px";
        q.left=(gov(p,true)+16)+"px";
        q.display="block"
    };
    s.onmouseout=function(){q.display="none";g.color="#000"}
}

function hcp()
{
    var h=i("hpg");
    if(h)
    {
        var s=t(h,"li");
        for(var x=0,y=s.length;x<y;x++)
        {
            var l=s[x];
            var a=t(l,"a");
            a[0].childNodes[0].title=a[1].title=cbit(a[1]);
            a[0].href=a[1].href;
            l.onmouseover=function(){t(this,"dl")[0].style.background="#ffd"};
            l.onmouseout=function(){t(this,"dl")[0].style.background="#fffff9"}
        } 
    }
}

function ssrtp() {
    var c, a, l = t(i("srtp"), "img");
    for (var x = 0, y = l.length; x < y; x++) {
        c = l[x];
        a = c.alt;
        c.title = a.substr(0, a.length - 8);
    }
}

function shet()
{
    var c,n,a,l=t(i("ads"),"li");
    for(var x=0,y=l.length;x<y;x++)
    {
        c=l[x];
        n=c.childNodes;
        
        n[0].childNodes[0].title="";
        
        c.onmouseover=function(){this.childNodes[1].style.background="#ffd"};
        c.onmouseout=function(){this.childNodes[1].style.background=((this.className=="o")?"#f3f3f6":"#fff")};
        
        a=t(n[1],"a")[0];
        a.title=a.innerHTML;
        n[0].href=a.href
    }
}

function shetp()
{
    var c,n,a,l=t(i("adsp"),"li");
    for(var x=0,y=l.length;x<y;x++)
    {
        c=l[x];
        n=c.childNodes;
        
        n[0].childNodes[0].title=""; // supress image titles in ad lists
        
        c.onmouseover=function(){this.childNodes[1].style.background="#ffd"};
        c.onmouseout=function(){this.childNodes[1].style.background=((this.className=="o")?"#f3f3f6":"#fff")};
        
        a=t(n[1],"a")[0];
        a.title=a.innerHTML;
        n[0].href=a.href
    }
}

function sasls()
{
    i("asolb").style.height=i("asls").style.height="114px";
}

// ***

function heciq() {
    var s = i("ciq_tbm");

    ae(s, "click", sshciq);
    ae(s, "keypress", sshciq);

    shciq(true)
}

function sshciq() {
    shciq()
}

function shciq(c) {
    var s = i("shciq").style, b = i("ciq_tbm"), g = b.style;
    if (che(i("ciq"))) {
        de(b, "click", sshciq);
        de(b, "keypress", sshciq);
        return
    }
    if (c) {
        //g.height="9.4em";
        g.height = "3.4em";
        s.display = "none";
        return
    }

    de(b, "click", sshciq);
    de(b, "keypress", sshciq);

    g.height = "13.4em";
    s.display = "block"
}

// ***

function heccs()
{
    var s=i("ccs_tbm");
    
    ae(s,"click",sshccs);
    ae(s,"keypress",sshccs);

    shccs(true)
}

function sshccs()
{
    shccs()
}

function shccs(c)
{
    var s=i("shccs").style,b=i("ccs_tbm"),g=b.style;
    if(che(i("ccs")))
    {
        de(b,"click",sshccs);
        de(b,"keypress",sshccs);
        return
    }
    if(c)
    {
        g.height="2.5em";
        s.display="none";
        return
    }
    
    de(b,"click",sshccs);
    de(b,"keypress",sshccs);
    
    g.height="7em";
    s.display="block"
}

function crakp(e)
{
    if(window.event)
        e=window.event;

    if((e.keyCode&&(e.keyCode==13))||(e.which&&(e.which==13)))
    {
        var o=i("cra_tbe");
        de(o,"keypress",crakp);
        o.style.height="2.5em";
    }
}

function fpshc(a)
{
    var fpf=a?shcal:shcra;
    window.setTimeout(fpf,100)
}

function shcra(c,e,o)
{
    var hspn,shcra,ccra=i("cra"),hcra=t(ccra,"h2")[0];
    
    if(hcra.innerHTML=="Recomendar vehículo")
    {
        hcra.innerHTML+=" <span>[+]</span>";
        hcra.style.cursor="pointer";
        
        var tb=i("cra_tbe");
        if(tb)
        {
            if(tb.value.indexOf("\n")!=-1)
                tb.style.height="2.5em";
            else
                ae(tb,"keypress",crakp)
        }
    }
    
    hspn=t(hcra,"span")[0];
    if((e&&che(ccra))||o)
    {
        hspn.innerHTML="[−]";
        if(o)
            fbe("asea");
        return
    }
    
    shcra=i("shcra");
    if(c)
    {
        hspn.innerHTML="[+]";
        shcra.style.display="none";
        return
    }
    
    shcal(true);
    if(shcra.style.display=="none")
    {
        hspn.innerHTML="[−]";
        shcra.style.display="block";
        var tb=i("cra_tbe");
        if(tb)
            tb.focus()
    }
    else
    {
        hspn.innerHTML="[+]";
        shcra.style.display="none"
    }
}

function shcal(c,e,o)
{
    var hspn,shcal,ccal=i("cal"),hcal=t(ccal,"h2")[0];
    if(hcal.innerHTML=="Alertas de vehículos")
    {
        hcal.innerHTML+=" <span>[+]</span>";
        hcal.style.cursor="pointer"
    }
    
    hspn=t(hcal,"span")[0]
    if((e&&che(ccal))||o)
    {
        hspn.innerHTML="[−]";
        if(o)
            fbe("asea");
        return
    }
        
    shcal=i("shcal");
    if(c)
    {
        hspn.innerHTML="[+]";
        shcal.style.display="none";
        return
    }
    
    shcra(true);
    if(shcal.style.display=="none")
    {
        hspn.innerHTML="[−]";
        shcal.style.display="block";
        var tb=i("cal_tbe");
        if(tb)
            tb.focus()
    }
    else
    {
        hspn.innerHTML="[+]";
        shcal.style.display="none"
    }
}

function lcal(e)
{
    if(i("shcal").style.display=="none")
        shcal();
    else
    {
        var b=i("cal_tbe");
        if(b)
            b.focus()
    }
    sep(e)
}

function poc()
{
    var obc=i("co_cbb"),odc=i("co_cbd"),obtn=i("co_btnSubmit");
    ob=obc.value;
    od=odc.value;
    obc.onchange=function(){obch=(ob!=obc.value);cico(obtn)};
    odc.onchange=function(){odch=(od!=odc.value);cico(obtn)};
    obt=obtn.title;
    cico(obtn)
}

function cico(b)
{
    var co=false;
    b.disabled=!(co=(obch||odch));
    b.title=(co?obt:"Cambia los criterios para ordenar")
}

function hudr(e,o)
{
    var s=document.documentElement.scrollTop;
    if(s==0)s=document.body.scrollTop;
    var d=e.clientY-gov(o)+s-10;
    if(d<3)d=3;
    var m=o.clientHeight-21;
    if(d>m)d=m;
    o.style.background="#f3f3f6 url(/i/rb.gif) 3px "+d+"px no-repeat";
}

function hhudr()
{
    var x,o=t(i("cd"),"p");o=o[o.length-1];
    o.onmousemove=function(e){hudr(e?e:event,this)};
    o.onmouseout=function(){o.style.background="#f3f3f6"}
}

function ran(o)
{
    var v=gtc("atfsti");
    if(v)
    {
        var ioq=v.indexOf("?");
        if(ioq>0)
            v=v.substring(0,ioq);
        var lios=v.lastIndexOf("-");
        var ioe=v.indexOf(".aspx");
        v=v.substring(lios+1,ioe);
    
        ar=gar();
        if(!ar)
            return;
        
        i("rran").style.display="block";
    
        ar.open("GET","/default.aspx?k="+v+"&i="+o,true);
        ar.onreadystatechange=rran;
        ar.send(null)
    }
}
var ranc;
function rban()
{
    if(ranc)
    {
        var o=i("ban");
        if(o)
        {
            t(o,"dl")[0].innerHTML+="<dd><span id=\"rrban\"></span></dd>";
            t(o,"dt")[0].innerHTML+=" <br class=\"h\" />&#8226;&#160;<a href=\""+i("tibc").href+"\">Vuelve a tu búsqueda</a> <br class=\"h\" />&#8226;&#160;Navega:<br class=\"h\" /><br class=\"h\" />";
            i("rrban").innerHTML=ranc;
            
            i("rrban").onmouseover=function(){this.childNodes[2].style.background="#ff9"};
            i("rrban").onmouseout=function(){this.childNodes[2].style.background="#ffe"};
            
            var s=t(t(o,"h2")[0],"span")[0];
            s.title=cbit(s);
        }
        else
            window.setTimeout(rban,1000);
    }
}
function rran()
{
    if((ar.readyState==4)&&(ar.status==200))
    {
        var rx=ar.responseXML;
        
        var ac=i("rran");
        var pl=t(rx,"p");
        
        var acb="<span class=\"anp\">";
        
        if(pl.length==1)
        {
            pl=pl[0].getAttribute("v");
            acb+="<a class=\"fitdf\" href=\""+pl+"\" title=\"vehículo anterior\"><img src=\"/i/p.gif\" alt=\"‹\" title=\"vehículo anterior\" /><span>anterior</span></a>"
        }
        else
            acb+="<a class=\"fitdf2\"><img src=\"/i/gp.gif\" alt=\"‹\" title=\"\" />anterior</a>";

        acb+="</span>";
            
        var ai=t(rx,"r")[0].getAttribute("i").replace("|"," de ");
        if(ai=="1 de 1")
        {
            ac.style.display="none";
            ac.innerHTML="";
            ranc=null;
            return
        }
        
        acb+=" <span class=\"anns\">vehículo "+ai+"</span> ";
            
        var nl=t(rx,"n");
        
        acb+="<span class=\"ann\">";
        if(nl.length==1)
        {
            nl=nl[0].getAttribute("v");
            acb+="<a class=\"fitdf\" href=\""+nl+"\" title=\"vehículo siguiente\"><span>siguiente</span><img src=\"/i/n.gif\" alt=\"›\" title=\"vehículo siguiente\" /></a>"
        }
        else
            acb+="<a class=\"fitdf2\">siguiente<img src=\"/i/gn.gif\" alt=\"›\" title=\"\" /></a>";

        acb+="</span>";
        ac.innerHTML+=acb;
        ranc=acb;

        ac.style.background="#ffe";
        
        var hs=((pl.length==0)?t(ac,"span")[1]:t(ac,"span")[2]);
        ae(hs,"mouseover",shb);
        ae(hs,"click",shb);
        
        GetTI(true)
    }
}
function shb(e)
{
    if(!e)e=window.event;
    
    var se=e.srcElement;
    if(!se)se=e.target;
    
    var ses=se.style;
    var bs=t(i("bc"),"a")[1].style;
    var hlc="#ff9";
    
    ses.background=hlc;
    
    if(se.bi==null)
    {
        bs.background=hlc;
        se.bs=true;
        se.bi=window.setInterval(function(){bs.background=((se.bs=!se.bs)?hlc:"#ffd")},500)
    }
    
    ae(se,"mouseout",hhb);
    
    if((gtc("atfshb")=="true")&&(e.type=="mouseover"))
    {
        se.title="¿Qué es esto?";
        return
    }
        
    window.clearInterval(se.bi);
    se.bi=null;
    bs.background=hlc;
        
    se.title="";
    i("h").style.background="url(/i/rel.gif) 68px 55px no-repeat"; // 262px - 257px
}
function hhb(e)
{
    if(!e)e=window.event;
    
    i("h").style.background="#fff";
    
    var se=e.srcElement;
    if(!se)se=e.target;
    
    var ses=se.style;
    
    if(gtc("atfshb")!="true")
        document.cookie="atfshb=true;path=/";

    de(se,"mouseout",hhb);
    
    window.clearInterval(se.bi);
    se.bi=null;
    
    t(i("bc"),"a")[1].style.background="#ffd";
    ses.background="#ffe";
    ses.cursor="pointer";
    se.title="¿Qué es esto?";
}

function rsp()
{
    if((par.readyState==4)&&(par.status==200))
        i("cip").innerHTML=par.responseText
}

function sp(e)
{
    var l=t(i("cip"),"a");
    if(l.length==0)
        return;
        
    l=l[0];

    par=gar();
    if(!par)
        return;
    
    par.open("GET","/p/"+l.c+xv[1],true);
    par.onreadystatechange=rsp;
    par.send(null);

    if(e)sep(e)
}

function rp(v,b)
{
    dr("<p id=\"cip\"><a href=\"#c\">"+v+"</a></p>");
    var l=t(i("cip"),"a")[0];
    l.c=b;l.onclick=function(e){sp(e?e:event)}
}

function sa(o)
{
    o.style.cursor="pointer";
    var b=t(o.parentNode,"input");
    var v=!b[0].checked;
    o.title=(v?"Des":"S")+"eleccionar todos";
    for(var x=0;x<b.length;x++)
        b[x].checked=v
}

function s()
{
    i("f").submit()
}

function ilp(e,ai,np)
{
    if (i("ilp")!=null)
    {
        sep(e);
        return;
    }
    
    var mi=t(i("adp"),"img")[0];
    
    var pc = document.createElement("div");
    pc.id="ilp";
    
    var pv=(i("vma")!=null);
    
    var str="<ul>";
    for (var x=0; x<np; x++)
    {
        str += "<li><img src=\"/i/a/s" + ai + x + ".jpg\" alt=\"\" /></li>";
    }
    str += "</ul>";
    if (np>1)
        str+="<p>Pulsa sobre una imagen pequeña para ampliarla.</p>";
    str += "<span style=\"margin-right:2px\">";
    if(pv)
        str += "<a href=\"#cdt\" style=\"padding:0 1px 2px 1px;background:#ffc;visibility:hidden\" title=\"¿Te gusta este coche? ...Contacta con el vendedor\">¿te gusta?</a>&nbsp; ";
    str += "<strong>x</strong> <a href=\"#ct\" title=\"Cerrar imágenes\">cerrar</a></span>";
    pc.innerHTML = str;
    
    var pd=i("add").childNodes[0];
    pd.insertBefore(pc,i("adp").nextSibling);
    
    mi.title="";
    t(i("adp"),"a")[0].focus();t(i("adp"),"a")[0].removeAttribute("href");
    pc.style.marginTop="-" + (gov(pc)-(gov(mi)+187)) + "px";
    
    t(pc,"p")[0].style.marginLeft=((np<3)?(2-np):((np>4)?(6-np):2))*62+"px";
    
    var sis = t(pc,"li");
    var csi = sis[0].childNodes[0]; csi.style.padding="0";csi.style.border="1px solid #fff";csi.style.cursor="default"; opc(csi,100);
    var cmoi=null;
    var lb=true;
    
    var movf=function(){lb=true;if(cmoi&&cmoi!=csi)cmoi.style.cursor="pointer";var is=t(t(pc,"ul")[0],"img");for(var x=0;x<is.length;x++)opc(is[x],is[x]==csi?100:(is[x]==cmoi?85:70))};
    var mouf=function(){lb=false;if(cmoi)cmoi.style.cursor="default";var is=t(t(pc,"ul")[0],"img");for(var x=0;x<is.length;x++)opc(is[x],is[x]==csi?30:10)};
    
    var tmt=window.setTimeout(mouf,3000);
    
    ae(pc,"mouseout",function(){window.clearTimeout(tmt);mouf()});
    var raf=function(){window.clearTimeout(tmt);if(!lb)movf();tmt=window.setTimeout(mouf,3000)};
    ae(pc,"mousemove",raf);
    ae(pc,"click",raf);
    for (var x=0; x<sis.length; x++)
    {
        var si=sis[x].childNodes[0];
        si.onmouseover = function(){
                if (this!=csi)
                {
                    cmoi=this;
                    this.style.cursor="pointer";
                    opc(this,85);
                    this.style.padding="0";
                    this.style.border="1px solid #fff";
                }
            };
        si.onmouseout = function(){
                if (this!=csi)
                {
                    cmoi=null;
                    opc(this,70);
                    this.style.border="none";
                    this.style.padding="1px";
                }
            };
        si.onclick = function(){
        
                if(pv)
                {
                    if(!pc.cc)
                        pc.cc=1;
                    else
                        pc.cc+=1;
                    if(pc.cc==4)
                        t(pc,"a")[0].style.visibility="visible";
                }
        
                if(this!=csi){
                
                t(i("adp"),"img")[0].src=this.src.replace("/s/","/l/");
                csi.style.border="none";
                csi.style.padding="1px";
                csi.style.cursor="pointer";
                opc(csi,70);
                csi = this;
                this.style.padding="0";
                this.style.border="1px solid #fff";
                this.style.cursor="default";
                opc(this,100);
                }
            };
    }
    
    t(pc,"a")[pv?1:0].onclick=function(){
    
        t(i("adp"),"a")[0].href=t(i("adp"),"a")[1].href;
    
        mi.title="Ver más fotos";
        t(i("adp"),"img")[0].src="/i/a/l/"+ai+"/0.jpg";
        pd.removeChild(pc);
        sep(e)
    };
    if(pv)
    {
        t(pc,"a")[0].onclick=function(){sp()};
    }
    
    sep(e);
}

function apho(){var sis=t(i("pthl"),"li");for(var x=0,y=sis.length;x<y;x++){var si=sis[x];if(si.className!="civ"){opc(si,80);si.onmouseover=function(){opc(this,100)};si.onmouseout=function(){opc(this,70)}}}}

function rphpbtd(o){

    var x=document.referrer;var y=false;
    if(x.indexOf("-"+o+".")>0)
    {
        document.cookie="atfsraap=1;path=/";
        y=true
    }
    else if(x.indexOf("/"+o)>0)
    {
        if(gtc("atfsraap")=="1")
            y=true
    }
    else
        document.cookie="atfsraap=;path=/";
    if(y)
        cbsit(t(i("pthb"),"span")[0],"volver al anuncio")
}

function wpoc()
{
    var c=i("cs_chwpo");
    if(c)
    {
        c.onclick=function(){this.nextSibling.style.color=(this.checked?"#000":"#777")};
        c.onclick();
    }
}

function huhrb()
{
    var asc=i("asc");
    if(asc)
    {
        var s=i("asch").style;
        var h=i("cs_hdus");
        var o=(h.value=="1");
        if(!o)
        {
            s.display="none";
            asc.hd=true;
        }
        var a = "[";
        var b=a+"+]";
        a+="−]";
        
        var sw=i("ascs");
        sw.style.display="block";
        sw.innerHTML="<a href=\"#\">"+(o?a:b)+"</a>";
        
        t(sw,"a")[0].onclick=function(e){
            if(asc.hd)
            {
                this.innerHTML=a;
                s.display="block";
                h.value="1";
                asc.hd=false
            }
            else
            {
                this.innerHTML=b;
                s.display="none";
                h.value="0";
                asc.hd=true
            }
            sep(e)
        };
    }
    
    var tbg=i("cs_tbg");
    var tbgs=t(tbg.parentNode,"span")[0];
    tbgs.onclick=function(){tbg.focus();tbg.value+=""};
    tbg.onkeyup=function(){tbgs.style.color=((this.value.length==0)?"#777":"#000")};
    tbg.onkeyup();
    
    var tbd=i("cs_tbd");
    var tbds=t(tbd.parentNode,"span")[0];
    tbds.onclick=function(){tbd.focus();tbd.value+=""};
    tbd.onkeyup=function(){tbds.style.color=((this.value.length==0)?"#777":"#000")};
    tbd.onkeyup();
    
    var tbs=i("cs_tbs");
    var tbss=t(tbs.parentNode,"span")[0];
    tbss.onclick=function(){tbs.focus();tbs.value+=""};
    tbs.onkeyup=function(){tbss.style.color=((this.value.length==0)?"#777":"#000")};
    tbs.onkeyup();
    
    var awd=i("cs_chawd");
    awd.onclick=function(){this.nextSibling.style.color=(this.checked?"#000":"#777")};
    awd.onclick();

    var r=i("rlsf");
    if(r)
    {
        var z=t(r,"input");
        for (var x=0,y=z.length;x<y;x++)
        {
            var c=z[x];
            if(c.checked)
                r.cr=c.nextSibling;
            else
                c.nextSibling.style.color="#777";
            c.onclick=function(){r.cr.style.color="#777";var n=this.nextSibling;n.style.color="#000";r.cr=n};
        }
    }
}

function husc(o)
{
    o=i(o);
    if(o.firstChild.textContent)
    {
        o=t(o,"select");
        for(var x=0,y=o.length;x<y;x++)
        {
            var c=o[x];
            ae(c,"change",function(){this.style.color=((this.options[this.selectedIndex].className=="hint")?"#999":"#000")});
            c.style.color=((c.options[c.selectedIndex].className=="hint")?"#999":"#000");
        }
    }
}

function surapc() {
    var o = t(i("cprapp"), "div");
    for (var x = 0, y = o.length - 1; x < y; x++) {
        var c = o[x];
        var ci = t(c, "img")[0];
        var cr = t(c, "input")[0];
        var cc = t(c, "input")[1];
        if (x == 0) {
            o.cro = cr;
            o.cio = ci;
        }
        cc.onclick = function() {
            t(this.parentNode, "label")[0].style.color = (this.checked ? "#f30" : "#777");
        };
        cr.onclick = function() {
            var s = t(o.cro.parentNode, "label")[0].style;
            s.color = "#777";
            s.background = "#fff";
            o.cro = this;
            s = t(this.parentNode, "label")[0].style;
            s.color = "#000";
            s.background = "#ffc";
        };
        ci.onclick = function() {
            o.cio.style.borderColor = "#fff";
            o.cio = this;
            this.style.borderColor = "#f30";
            t(this.parentNode, "input")[0].click();
            t(i("cpraplp"), "img")[0].src = this.src.replace("/p/", "/l/");

        };
    }
}

function tbca()
{
var o=i("cl_btnSubmit");
o.disabled="disabled";
o.title="Estamos en un proceso corto de mantenimiento"
}

function wl()
{
    acaf();
    wpoc();
    
    if(i("at"))
        addthis_offset_top=4;
}
window.onload=wl;
