function objetoAjax(){
	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 getcontent(menu)
{
	ajax=objetoAjax();	
	var div= document.getElementById('form-center');
    ajax.open("post", "showform.php",true);
    ajax.onreadystatechange=function(){
	    if (ajax.readyState==4) 
	    {
	    	div.innerHTML = ajax.responseText;
	    }
    }
    ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
    ajax.send("idfunction="+menu);
    
}

function NewWindow(mypage,myname,galeria) 
{	
	LeftPosition = (screen.width) ? (screen.width-screen.width)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-screen.height)/2 : 0;
	settings ='height='+screen.height+',width='+screen.width+',top='+TopPosition+',left='+LeftPosition+',scrollbars=1,resizable' 
	mypage = mypage + "?galeria="+galeria;
	win = window.open(mypage,myname,settings);
}
function logme()
{
	ajax=objetoAjax();
    var usuario =document.getElementById("user").value;
    var password = document.getElementById("password").value;	
    var div= document.getElementById('form-center');	
	if (usuario!="" && password !="")
	{	    	
		ajax.open("post", "showform.php",true);
		ajax.onreadystatechange=function(){
		    if (ajax.readyState==4) 
		    {
		    	div.innerHTML = ajax.responseText;
		    }
	    }
	    ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	    ajax.send("idfunction=login&user="+usuario+"&pass="+password);
	}else
	{
		alert("Usuario/Password no completados");
	}
}
