var xmlHttp=null;

function GetXmlHttpObject()
{
	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;
}

function stateChanged() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		result = xmlHttp.responseText;
		document.getElementById(span).innerHTML = result;    
	} 
}

function ajax(span1,url,poststr)
{
	span=span1;
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request");
		return;
	}
	xmlHttp.onreadystatechange=stateChanged;
	xmlHttp.open('POST',url,true);
	xmlHttp.send(poststr);
}

function closeajax(span1)
{
	document.getElementById(span1).innerHTML = '&nbsp;';
}

function menuover(idDiv){
//	alert(document.getElementById(idDiv).style.backgroundColor);
	 document.getElementById(idDiv).style.backgroundColor="#4aa9d9"; 
//      document.getElementById(idDiv).style.color="";

//	document.getElementById(idDiv).style.display = "block";

}
function menuout(idDiv){
	 document.getElementById(idDiv).style.backgroundColor=""; 
      document.getElementById(idDiv).style.color="";

//	document.getElementById(idDiv).style.display = "block";

}
function mostrar(divid)
{
	var i ;
	var totaldivs=	document.getElementById("totaldivs").value;
	for(i=1;i<=totaldivs;i++)
	{		
		if ( document.getElementById('D'+i) )
		{ 
			if('D'+i !=divid)
			{
				if(document.getElementById('D'+i).style.display=='')
				{
					document.getElementById('D'+i).style.display='none';
				}
			}
		}		
	}
	if(document.getElementById(divid).style.display=='none')
	{
		document.getElementById(divid).style.display='';
	}
	else
	{
		document.getElementById(divid).style.display='none';
	}
}
