// DEPRECATED

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 Mostrar_Form_submit(url,id,valores)
{
	var contenido;
	contenido = document.getElementById(id);
	/*var about = document.getElementById('content_about');
	var amerisourcing = document.getElementById('content_amerisourcing');
	//var services = document.getElementById('content_services');
	var portfolio = document.getElementById('content_portfolio');
	var explore = document.getElementById('content_explore');
	var testimonials = document.getElementById('content_testimonials');
	var contact = document.getElementById('content_contact');*/

	/*amerisourcing.style.display = 'none';
	services.style.display = 'none';
	portfolio.style.display = 'none';
	explore.style.display = 'none';
	about.style.display = 'none';
	testimonials.style.display = 'none';*/

	contenido.style.display = 'block';

	ajax=NuevoAjax();
	ajax.open("POST", url,true);
	ajax.onreadystatechange=function(){
		if(ajax.readyState==1){
			contenido.innerHTML = "Loading...";
			contenido.style.background = "url('../imagenes/indicator.gif') center center no-repeat";
		}else if(ajax.readyState==4){
			if(ajax.status==200){
				contenido.innerHTML = ajax.responseText;
				contenido.style.background = "url('loaded.gif') center center no-repeat";				
			}else if(ajax.status==404){
				contenido.innerHTML = "The URL doesn't exists";
				contenido.style.background = "url('loaded.gif') center center no-repeat";
			}else{
				contenido.innerHTML = "Error:".ajax.status;
				contenido.style.background = "url('loaded.gif') center center no-repeat";
			}
		}
	}

	ajax.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
	ajax.send(valores);
}

function Cargar(url,id)
{
	var contenido;
	contenido = document.getElementById(id);
	/*var about = document.getElementById('content_about');
	var amerisourcing = document.getElementById('content_amerisourcing');
	var services = document.getElementById('content_services');
	var portfolio = document.getElementById('content_portfolio');
	var explore = document.getElementById('content_explore');
	var testimonials = document.getElementById('content_testimonials');
	var contact = document.getElementById('content_contact');*/


	ajax=NuevoAjax();
	ajax.open("GET",url,true);

	ajax.onreadystatechange=function()
	{
		if(ajax.readyState==1){
			contenido.innerHTML = "Loading...";
			contenido.style.background = "url('../imagenes/indicator.gif') center center no-repeat";
		}
		else if(ajax.readyState==4)
		{
			if(ajax.status==200)
			{
				contenido.innerHTML = ajax.responseText;
				contenido.style.background = "none";
				
				// Setup the shadowbox
				Shadowbox.setup("a.shadowbox");
			}
		}
	}
	ajax.send(null);
}

function load_service(url, div){
	var content;
	content = document.getElementById(div);
	ajax=NuevoAjax();
	ajax.open("GET", url,true);
	ajax.onreadystatechange=function(){
		if(ajax.readyState==1)
		{
			content.innerHTML = "<span class='loading'>Loading...</span>";
			content.style.background = "#FFFFFF url('../imagenes/indicator.gif') no-repeat center center";
		}
		else if(ajax.readyState==4)
		{
			if(ajax.status==200)
			{
				content.innerHTML = ajax.responseText;
				// replace the background image for the indicator.gif
				content.style.background = "url(../../imagenes/wm_portfolio.gif) no-repeat 10px 0";
			}
		}
	}
	ajax.send(null);
}

var uniquepageid=window.location.href.replace("http://"+window.location.hostname, "").replace(/^\//, "") //get current page path and name, used to uniquely identify this page for persistence feature

