function create_connector(){

	/* definisce la variabile del connettore */
	var http_conn=false;

	/* per Firefox/Safari/Opera/Chrome/IE7+ */
	if(window.XMLHttpRequest){

		http_conn=new XMLHttpRequest();

		if(http_conn.overrideMimeType){

			/* impone il riconoscimento della risposta come puro testo */
			http_conn.overrideMimeType("text/plain");
		}
	}
	else if(window.ActiveXObject){

		/* richiama oggetto ActiveX necessario per creare il connettore in IE5/6 */
		try{

			http_conn=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(e){

			try{

				http_conn=new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch(e){

				try{

					http_conn=new ActiveXObject("Msxml2.XMLHTTP.6.0");
				}
				catch(e){

					try{

						http_conn=new ActiveXObject("Msxml2.XMLHTTP.3.0");
					}
					catch(e){}
				}
			}
		}
	}

	/* controlla l'avvenuta creazione del connettore */
	if(!http_conn){

		alert("Ajax Error: Cannot create XMLHTTP instance!");
		return false;
	}

	return http_conn;
};

function showPriceItem(products_id)
{
document.getElementById("mv_product_price").innerHTML="Attendere...";

    var conn=create_connector();
    conn.onreadystatechange=function()
    {
        if (conn.readyState==4 && conn.status==200)
        {
            document.getElementById("mv_product_price").innerHTML=conn.responseText;
        }
     }

    nome=document.getElementsByTagName("select");
    //alert(nome);
    toReturn='';
    for(var i = 0; i < nome.length; i++)
    {
        if(nome[i].value==nome[i].options[nome[i].selectedIndex].value){
            
            toReturn=toReturn + nome[i].name + "=" + nome[i].value + "|";
            //alert(nome[i].text);
        }

        //alert(obj.id + " =  " + obj.value);
    }
            //alert(toReturn);

    conn.open("GET","get_ajax_option_price.php?valore="+toReturn+"&products_id="+products_id,true);
    conn.setRequestHeader("Content-Encoding","gzip");
    conn.send();
}



