function GetXmlHttpObject()
{
if (window.XMLHttpRequest)
  {
  // code for IE7+, Firefox, Chrome, Opera, Safari
  return new XMLHttpRequest();
  }
if (window.ActiveXObject)
  {
  // code for IE6, IE5
  return new ActiveXObject("Microsoft.XMLHTTP");
  }
return null;
}

function cotiza(producto)    
{
	
	//document.getElementById('img_rbd').style.display = 'block';
	var variables,ajax;
    //var valor 	 = document.getElementById('rbd').value;

	variables = "carro=carro";
	variables += "&valor="+producto;
    
	ajax=GetXmlHttpObject();
    ajax.open("POST","ajax_meldic.php",true);
    ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");

    ajax.onreadystatechange=function() 
    {
		if (ajax.readyState==4) 
		{
		    if (ajax.status==200)
		     {
				document.getElementById('visor').innerHTML=ajax.responseText;
		     }
		}
    }
    ajax.send(variables);

} 

function del(indice)    
{
	
	//document.getElementById('img_rbd').style.display = 'block';
	var variables,ajax;
    //var valor 	 = document.getElementById('rbd').value;

	variables = "carro_del=carro_del";
	variables += "&valor="+indice;
    
	ajax=GetXmlHttpObject();
    ajax.open("POST","ajax_meldic.php",true);
    ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");

    ajax.onreadystatechange=function() 
    {
		if (ajax.readyState==4) 
		{
		    if (ajax.status==200)
		     {
				document.getElementById('visor').innerHTML=ajax.responseText;
		     }
		}
    }
    ajax.send(variables);

} 

function producto_ver(cat)    
{
	document.getElementById('loading').style.display = 'block';
	document.getElementById('img_inicio').style.display = 'none';
	var variables,ajax;
    //var valor 	 = document.getElementById('rbd').value;

	variables = "producto=producto";
	variables += "&valor="+cat+'&division='+document.getElementById('tipo_pro').value;;
	ajax=GetXmlHttpObject();
    ajax.open("POST","productos_ajax.php",true);
    ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");

    ajax.onreadystatechange=function() 
    {
		if (ajax.readyState==4) 
		{
		    if (ajax.status==200)
		     {
				document.getElementById('productos').innerHTML=ajax.responseText;
		     }
		}
    }
    ajax.send(variables);
} 
function yeah()
    {
		//$("#mostrar").click(function(event) {
		//event.preventDefault();
		$("#carro").slideToggle();
		//});
    };
function cot_efect(id){
	//mover
		$("#image_"+id).fadeIn("fast")
		.animate({opacity: "0.5", marginLeft: "+=400"}, "normal")
		.animate({opacity: "0.0", marginTop: "-=120", height: "20", width: "20"}, "normal")
		.animate({opacity: "0.0", marginTop: "+=120", height: "100", width: "100"}, "fast")
		.animate({opacity: "0.0", marginLeft: "-=400"}, "fast")
	
	//efecto btn
		//$("#img_cot1_"+id).fadeOut("slow",function () {$("#img_cot2_"+id).fadeIn("slow",function () {$("#img_cot2_"+id).fadeOut("slow",function () {$("#img_cot3_"+id).fadeIn("slow",function () {$("#img_cot3_"+id).fadeOut("slow",function () {$("#img_cot1_"+id).fadeIn("slow")})})})})})
		$("#img_cot1_"+id).animate({opacity: "0.2"}, "slow")
 		.animate({opacity: "1.0"}, "slow")
	//efecto carro
		$("#visor").animate({ backgroundColor: "#fff568" }, "slow")
		.animate({ backgroundColor: "#d9dbdd" }, "slow")
		return false;
	
};
function cot_efect_mini(id){
	//mover
		$("#image_"+id).fadeIn("fast")
		.animate({opacity: "0.5", marginLeft: "+=400"}, "normal")
		.animate({opacity: "0.0", marginTop: "-=120", height: "20", width: "20"}, "normal")
		.animate({opacity: "0.0", marginTop: "+=120", height: "100", width: "100"}, "fast")
		.animate({opacity: "0.0", marginLeft: "-=400"}, "fast")
	//efecto btn
		$("#img_cot1_"+id).animate({opacity: "0.2"}, "slow")
 		.animate({opacity: "1.0"}, "slow")
		return false;
	
};
function cotiza_mini(producto)    
{
	
	//document.getElementById('img_rbd').style.display = 'block';
	var variables,ajax;
    //var valor 	 = document.getElementById('rbd').value;

	variables = "carro=carro";
	variables += "&valor="+producto;
    
	ajax=GetXmlHttpObject();
    ajax.open("POST","ajax_meldic.php",true);
    ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");

    ajax.send(variables);

} 


