function nuevoAjax(){
	var xmlhttp=false;
 	try {
 		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
 	} catch (e) {
 		try {
 			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
 		} catch (E) {
 			xmlhttp = false;
 		}
  	}

	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
 		xmlhttp = new XMLHttpRequest();
	}
	return xmlhttp;
}

function cargar($form,$url,$method,$div,$back)
{
	
	if($back==1)
{
document.bgColor="#000000";
}

if($back==2)
{
document.bgColor="#000000";
}
if($back==3)
{
document.bgColor="red";
}
	var flo,submission_string;
	//proceder a leer todas las variables del formulario si existe el formulario
	//document.write($form);
	if ($form!="")//si hay formulario que cargar toma todas las vars
	{
		for (var form_loop=0; form_loop<document.forms.length; form_loop++) 
  		{
    		for (var elems=0; elems<document.forms[form_loop].length;elems++)
    		{
      			if (document.forms[form_loop].elements[elems].name != "")
      			{
        			submission_string += document.forms[form_loop].elements[elems].name + "=" +
        	  		document.forms[form_loop].elements[elems].value + "&";
      			}
    		}
		}
		$url+=submission_string;
		//document.write(submission_string);
	}
	
	ajax=nuevoAjax(); // crea el objeto ajax para el xmlhttprequest
	contenedor = document.getElementById($div);//lee el indice del contenido
	if ($method=="GET")
	{
		ajax.open("GET",$url, true);
		ajax.onreadystatechange=function()
		{
			
			if (ajax.readyState==1)
	 		{
	 			contenedor.innerHTML = "<table width='100%' height='357' border='0'><tr><td valign='middle' align='center'><font face='Pristina' color='#00001' size='5'><img border='0'  src='indicator.gif'></font></td></tr></table>";
	 		}
			
			if (ajax.readyState==4) 
			{
			contenedor.innerHTML = ajax.responseText
	 		}
	 	
	 	
		}
		
		ajax.send(null);
		
		
	}
	//$back=1;


}
function img($a)
{
	var button=document.getElementById("button");
	
	if ($a=='2')
	{
		button.innerHTML="<img src='Images/quienes.png' />";
	}
	if ($a=='1')
	{
		button.innerHTML="<img src='Images/home.png' />";
	}
	if ($a=='3')
	{
		button.innerHTML="<img src='Images/productos.png' />";
	}
	if ($a=='4')
	{
		button.innerHTML="<img src='Images/contacto.png' />";
	}
}
function show()
{
	document.getElementById("prod").style.visibility="visible";
}
function hide()
{
	document.getElementById("prod").style.visibility="hidden";
}
function showa()
{
	document.getElementById("cont").style.visibility="visible";
}
function hidea()
{
	document.getElementById("cont").style.visibility="hidden";
}

function ampliar($img)
{
	
	var con=document.getElementById('ver');
	con.style.visibility="visible";
	document.getElementById('tabla').disabled=true;
	//document.getElementById('tabla').style="background: transparent; background-color: #FEFFE6; opacity: .8; filter:alpha(opacity=70);"; 
	document.getElementById('tabla').style.opacity= ".3";
	//document.getElementById('tabla').style.filter.alpha= "30";
	con.innerHTML="<table border='0' width='500' height='400'><tr><td align='center' valign='center'><img src='"+$img+"' /><br><a href='#' onclick='cerrar()'>::Cerrar::</a></td></tr></table>";
}
function cerrar()
{
	var con=document.getElementById('ver');
	con.style.visibility="hidden";
	document.getElementById('tabla').style.opacity= "1";
	//document.getElementById('tabla').style=""; 
}