/* * ESTO ES UN INVENTO DE muydom.com, los dominios y hostings más convenientes de la red */var ajax_hosting_anadir; var ajax_cesta_detalle_quitar;var ajax_cambiar_usuario;var ajax_comprobar_dominio;var ajax_cesta_detalle_anadir_subproducto;var ajax_anadir_codigo_descuento;var ajax_dominio_traspasar;function dominio_traspasar(){    tld	=	document.getElementById('tld').value;    sld	=	document.getElementById('sld').value;    if (sld=='')    {        alert("Has de escribir el nombre del dominio");        return;                   }    var ajax	=	ajax_anadir_codigo_descuento;    ajax	=	GetXmlHttpObject();    var url="/ajax/ajax_dominio_traspasar.php";    url=url+"?tld="+tld+"&sld="+sld;    ajax.onreadystatechange= function() {        if (ajax.readyState==4)        {            //document.getElementById('cesta_compra').innerHTML	= ajax.responseText;            alert('Dominio añadido a la cesta');            abanicar('boton_cesta');        }        else        {    //document.getElementById('iddescuento_codigo').innerHTML="<img src='/img/iconos/concalma.gif'>"    }    };    ; //con esto paso parametros    ajax.open("GET",url,true);    ajax.send(null);}function anadir_codigo_descuento(idcesta){    iddescuento_codigo	=	document.getElementById('iddescuento_codigo').value;			    var ajax				=	ajax_anadir_codigo_descuento;    ajax					=	GetXmlHttpObject();			    var url="ajax/ajax_anadir_descuento_codigo.php";    url=url+"?idcesta="+idcesta+"&iddescuento_codigo="+iddescuento_codigo;    ajax.onreadystatechange= function() {					        if (ajax.readyState==4)        {            document.getElementById('cesta_compra').innerHTML					=	ajax.responseText;        }        else        {    //document.getElementById('iddescuento_codigo').innerHTML="<img src='/img/iconos/concalma.gif'>"    }													    };    ; //con esto paso parametros													    ajax.open("GET",url,true);    ajax.send(null);		}function ver_mas (){    document.getElementById('mas_pie').style.display					=	"inline" //lo apago pq se ve por debajo en ie6}function ver_codigo_descuento (){    document.getElementById('poner_codigo').style.display					=	"inline" //lo apago pq se ve por debajo en ie6}function cesta_detalle_anadir_subproducto(idcesta_detalle){    hosting	=	document.getElementById('hosting_'+idcesta_detalle).value;    //tld	=	document.getElementById('tld').value;		    var ajax					=	ajax_cesta_detalle_anadir_subproducto;    ajax					=	GetXmlHttpObject();			    var url="ajax/ajax_cesta_detalle_anadir_subproducto.php";    url=url+"?idcesta_detalle="+idcesta_detalle+"&idproducto="+hosting;    ajax.onreadystatechange= function() {					        if (ajax.readyState==4)        {            document.getElementById('cesta_compra').innerHTML					=	ajax.responseText;        }        else        {            document.getElementById('div_total_pagar').innerHTML="<img src='/img/iconos/concalma.gif'>"        }													    };    ; //con esto paso parametros													    ajax.open("GET",url,true);    ajax.send(null);		}function cerrar_capa_mensaje(vercesta){    parent.document.getElementById('tld').style.display					=	"inline" //lo apago pq se ve por debajo en ie6    parent.document.getElementById('capa_transparente').style.display	=	"none"    parent.document.getElementById('capa_mensaje').style.display		=	"none"    foco('sld');    if (vercesta=='1')    {        //$("#ver_cesta").css({'display' : 'inline'})        parent.document.getElementById('ver_cesta').style.display		=	"inline"    }}function comprobar_dominio(){    sld	=	document.getElementById('sld').value;    tld	=	document.getElementById('tld').value;		    var ajax				=	ajax_comprobar_dominio;    ajax					=	GetXmlHttpObject();			    var url="ajax/ajax_comprobar_dominio.php";    url=url+"?tld="+tld+"&sld="+sld;    ajax.onreadystatechange= function() {					        if (ajax.readyState==4)        {            document.getElementById('capa_mensaje').innerHTML			=	ajax.responseText;        }        else        {            parent.document.getElementById('tld').style.display                 =	"none" //lo apago pq se ve por debajo en ie6            parent.document.getElementById('capa_transparente').style.display	=	"block"            parent.document.getElementById('capa_mensaje').style.display	=	"block"            document.getElementById('capa_mensaje').innerHTML                   ="Buscando disponibilidad ...<br><br>&nbsp;&nbsp;<img src='/img/iconos/concalma.gif'>";        }													    };    ; //con esto paso parametros													    ajax.open("GET",url,true);    ajax.send(null);		}function cambiar_usuario(){    var ajax				=	ajax_cesta_detalle_quitar;    ajax					=	GetXmlHttpObject();			    var url="ajax/ajax_cambiar_usuario.php";    //url=url+"?idcesta_detalle="+idcesta_detalle;    ajax.onreadystatechange= function() {					        if (ajax.readyState==4)        {        //ir("/s-p2.php?idioma=es")        }        else        {            document.getElementById('cambiar_usuario').innerHTML="<img src='/img/iconos/concalma.gif'>"        }													    };    ; //con esto paso parametros													    ajax.open("GET",url,true);    ajax.send(null);		} function ajax_cesta_detalle_sumar_ano(idcesta_detalle){    var ajax				=	ajax_cesta_detalle_quitar;    ajax					=	GetXmlHttpObject();			    var url="ajax/ajax_cesta_detalle_sumar_ano.php";    url=url+"?idcesta_detalle="+idcesta_detalle;    ajax.onreadystatechange= function() {					        if (ajax.readyState==4)        {            document.getElementById('cesta_compra').innerHTML=ajax.responseText;        }        else        {            document.getElementById('div_total_pagar').innerHTML="<img src='/img/iconos/concalma.gif'>"        }													    };    ; //con esto paso parametros													    ajax.open("GET",url,true);    ajax.send(null);		} // V2function ajax_cesta_detalle_sumar_ano_v2(idcesta_detalle){    var ajax				=	ajax_cesta_detalle_quitar;    ajax					=	GetXmlHttpObject();			    var url="ajax/ajax_cesta_detalle_sumar_ano_v2.php";    url=url+"?idcesta_detalle="+idcesta_detalle;    ajax.onreadystatechange= function() {					        if (ajax.readyState==4)        {            document.getElementById('cesta_compra').innerHTML=ajax.responseText;        }        else        {            document.getElementById('div_total_pagar').innerHTML="<img src='/img/iconos/concalma.gif'>"        }													    };    ; //con esto paso parametros													    ajax.open("GET",url,true);    ajax.send(null);		}// fin v2function ajax_cesta_detalle_quitar(idcesta_detalle){    var ajax				=	ajax_cesta_detalle_quitar;    ajax					=	GetXmlHttpObject();			    var url="ajax/ajax_cesta_detalle_quitar.php";    url=url+"?idcesta_detalle="+idcesta_detalle;    ajax.onreadystatechange= function() {					        if (ajax.readyState==4)        {            document.getElementById('cesta_compra').innerHTML=ajax.responseText;        }        else        {            document.getElementById('div_total_pagar').innerHTML="<img src='/img/iconos/concalma.gif'>"        }													    };    ; //con esto paso parametros													    ajax.open("GET",url,true);    ajax.send(null);		} //v2function ajax_cesta_detalle_quitar_v2(idcesta_detalle){    var ajax				=	ajax_cesta_detalle_quitar;    ajax					=	GetXmlHttpObject();			    var url="ajax/ajax_cesta_detalle_quitar_v2.php";    url=url+"?idcesta_detalle="+idcesta_detalle;    ajax.onreadystatechange= function() {					        if (ajax.readyState==4)        {            document.getElementById('cesta_compra').innerHTML=ajax.responseText;        }        else        {            document.getElementById('div_total_pagar').innerHTML="<img src='/img/iconos/concalma.gif'>"        }													    };    ; //con esto paso parametros													    ajax.open("GET",url,true);    ajax.send(null);		}//fin v2function hosting_anadir(idproducto){    var ajax				=	ajax_hosting_anadir;    ajax					=	GetXmlHttpObject();    //idagente				=	document.getElementById("idagente").value;			    var url="ajax/ajax_hosting_anadir.php";    url=url+"?idproducto="+idproducto;    ajax.onreadystatechange= function() {					        if (ajax.readyState==4)        {            document.getElementById('cesta_compra').innerHTML=ajax.responseText;        //<input id="boton_comprar"  type="submit" name="Enviar" value="Comprar &raquo;" class="boton"  />        }        else        {            document.getElementById('div_total_pagar').innerHTML="<img src='/img/iconos/concalma.gif'>"        }													    };    ; //con esto paso parametros													    ajax.open("GET",url,true);    ajax.send(null);		} function ir(web){    window.location.href=web;}function foldear_v2(id,id_ocultar){    foldear(id)	;    document.getElementById(id_ocultar).style.display='none';		}function abanicar(id){    $("#"+id).show('fold','',500,'');}function foldear(id){    if (document.getElementById(id).style.display=='none')        $("#"+id).show('fold','',500,'');    else        document.getElementById(id).style.display='none';/*					if (document.getElementById('listado_producto').style.display=='none')		$("#listado_producto").show('fold','',500,'');		else		document.getElementById('listado_producto').style.display="none"				*/}	function bouncear(id,tiempo){    id="#"+id;    $(id).effect('bounce', '', tiempo, '');}function foco(id){    //this.document.validador.iduser.focus()">    document.getElementById(id).focus();}	function mostrar(id){    document.getElementById(id).display='block';}function cambia_imagen(id,iddos){    document.getElementById(id).display='none';    document.getElementById(iddos).display='block';}function vernover(id){    if (document.getElementById(id).style.display=="none")        document.getElementById(id).style.display="block"    else        document.getElementById(id).style.display="none"}function form_registro_nuevo(opcion){	    if (opcion==1)    {        document.getElementById('formulario_nuevo_cliente').style.display="none";        document.getElementById('formulario_ya_registrado').style.display="block";    }    else    {        document.getElementById('formulario_nuevo_cliente').style.display="block";        document.getElementById('formulario_ya_registrado').style.display="none";    }//	}function nover(id)	{			    document.getElementById(id).style.display="none"						}function ver_inline(id){				    document.getElementById(id).style.display="inline"						}//funcion AJAX principalfunction GetXmlHttpObject(){    var xmlHttp=null;    try  {  // Firefox, Opera 8.0+, Safari        xmlHttp=new XMLHttpRequest();    } catch (e)  {   // Internet Explorer        try    {            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");        } catch (e)    {            xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");        }    }    return xmlHttp;}