//Carregar o texto no conteúdo

//$(document).ready(function(){		
//	$('#carregando').hide();
//});	

//function CarregandoMostra(obj){
	//$('#'+obj).show();
//}

//function CarregandoOculta(obj){
	//$('#'+obj).hide();
//}	

var parUrl = "";

var hashURL='/';
var aux;

window.onload = function() { ajaxHistory.activateBrowserHistory(); };

<!-- Ativando os botões do histórico para navegação via ajax -->
//window.onload = function() { ajaxHistory.activateBrowserHistory(); };
//function readFile(url, htm){
//	var req = new XMLHttpRequest();
//	req.open("GET", url ,false);
//	req.send(null);
//	return req.status == '200' ? (htm ? req.responseText : req.responseXML) : null;
//}
//	
//function loadContent(url) {
//	var txt = readFile(url, true);
//	if(txt) {
//	document.getElementById('stage').innerHTML = txt;
//	var htxt = txt.replace(/\'/g, "\\'").replace(/[\r\n\s]/g, " ");
//	ajaxHistory.add("document.getElementById('stage').innerHTML = '"+htxt+"';");
//	} else alert('Se houve algum problema');
//}
function historico(url) {
	var txt = readFile(url, true);
	if(txt) {
	document.getElementById('stage').innerHTML = txt;
	var htxt = txt.replace(/\'/g, "\\'").replace(/[\r\n\s]/g, " ");
	ajaxHistory.add("document.getElementById('conteudo').innerHTML = '"+htxt+"';");
	} else alert('Se houve algum problema');
}
<!-- / fim dos arquivos utilizados pelo jQuery histórico para navegação -->

<!-- Ativando o jQuery lightBox plugin -->
function InicializaImagem(){	
	//alert("entrou");	
	$(function() {
			$('#imagem a').lightBox();
	});
}

<!-- Ativando o jQuery SlidePanel plugin -->
function InicializaSildePanel(){	
	//alert("entrou");	
	$(function() {
		//$('.slide3').slidePanel({status:'open'});
		//$('.acc').slidePanel({role:'accordion'});
		$('.acc').slidePanel({status:'open', role:'dep'});
	});
}	

function CarregaAjax(url, divRetorno, parametros, funcaoRetorno) {
	
	parUrl=url;
	//CarregandoMostra(carregando);		
	//$('#'+divRetorno).fadeOut();
	$('#'+divRetorno).html('<table width="100%"><tr><td width="50%" align="right"><img src="img/loading1.gif" border="0" /></td><td><div class="carregando">Carregando...</div></td></tr></table>');
	//$('#'+divRetorno).fadeIn();
	$.post(url, parametros, 
		function(response){ 
			//$('#'+divRetorno).fadeOut(); //funciona mostra conteudo, mas nao funciona mudar fonte	
			//RetornoAjax(divRetorno, escape(response)); 
			//setTimeout("RetornoAjax(divRetorno, '"+escape(response)+"')", 400)
			//setTimeout("RetornoAjax('conteudo', '"+escape(response)+"')", 1000);
			setTimeout("RetornoAjax('"+divRetorno+"', '"+escape(response)+"')", 400);  
		});
}

function RetornoAjax(divRetorno, response) {
		//CarregandoOculta(carregando);
	var retorno = unescape(response);
	$('#'+divRetorno).html(unescape(response));		
	//$('#'+divRetorno).fadeIn();	
	//$('#conteudo').html(unescape(response));		
	//$('#conteudo').fadeIn();
	//alert(parUrl);
	if (parUrl == "asp/equipes.asp"){
		InicializaSildePanel();
	}
	if (parUrl == "asp/localizacao.asp"){
		InicializaImagem();	
	}
	if (parUrl == "asp/estrutura.asp"){
		InicializaImagem();	
	}
	if (parUrl == "asp/equipes.asp"){
		InicializaImagem();	
	}
	if (parUrl == "asp/imagens_interessantes.asp"){
		InicializaImagem();	
	}
	if (parUrl == "asp/topicos_patologia.asp"){
		InicializaImagem();	
	}
	
	var htxt = retorno.replace(/\'/g, "\\'").replace(/[\r\n\s]/g, " ");	
	ajaxHistory.add("document.getElementById('conteudo').innerHTML = '"+htxt+"';","Medicina Digital");
}	

/*************** Enviar o formulário ***************/
function Contato(orl){	
	alert(orl.responseText);	
	$('cmdContato').disabled = false;
	$('statuscontato').update('');	
	document.formulario.reset();
}

function EnviaContato(){
	if(!ValidaCampo(document.getElementById('nome'),'Digite o nome!')){return false};	
	if(!ValidaCampo(document.getElementById('email'),'Digite o e-mail!')){return false};	
	if(!ValidaEmail('email','Digite um e-mail valido!')){return false};	
	if(!ValidaCampo(document.getElementById('cidade'),'Digite a cidade!')){return false};	
	if(!ValidaCampo(document.getElementById('estado'),'Selecione o estado!')){return false};		
	//if(!ValidaCampo(document.getElementById('telefone'),'Digite o telefone!')){return false};
	if(!ValidaCampo(document.getElementById('mensagem'),'Digite um mensagem!')){return false};		
	
	$('cmdContato').disabled = true;
	VerificaFormulario();
	//aux += '&mensagem='+$('mensagem').value;
	aux += '&mensagem=' + document.getElementById('mensagem').value;	
	
	var vtext = aux
  var n = vtext.length;
  for (var i = 1; i <=n; i++) {
    vtext = vtext.replace(" ","#*#");
  }
  //textonovo = vtext
  aux = vtext
	
	//$('statuscontato').update('Enviando...');
	CarregaAjax('asp/confirma_contato.asp','conteudo', aux, Contato)
}
/*************** Fim Enviar o formulário ***************/

/*************** Enviar o formulário Pedido de Material ***************/
function Pedido(orl){	
	alert(orl.responseText);	
	$('cmdPedido').disabled = false;
	$('statusPedido').update('');	
	document.formulario.reset();
}

function EnviaPedido(){
	if(!ValidaCampo(document.getElementById('nome'),'Digite o nome!')){return false};	
	if(!ValidaCampo(document.getElementById('email'),'Digite o e-mail!')){return false};	
	if(!ValidaEmail('email','Digite um e-mail valido!')){return false};	
	if(!ValidaCampo(document.getElementById('telefone'),'Digite o telefone!')){return false};
	if(!ValidaCampo(document.getElementById('endereco'),'Digite um endereço!')){return false};		
	
	$('cmdPedido').disabled = true;
	VerificaFormulario_Pedido();
	//aux += '&mensagem='+$('mensagem').value;
	aux += '&mensagem=' + document.getElementById('mensagem').value;
	
	var vtext = aux
  var n = vtext.length;
  for (var i = 1; i <=n; i++) {
    vtext = vtext.replace(" ","#*#");
  }
  //textonovo = vtext
  aux = vtext
  //alert(textonovo)
  
	//alert(aux);	
	//$('statuscontato').update('Enviando...');
	CarregaAjax('asp/confirma_pedido_material.asp','conteudo', aux, Pedido)
}
/*************** Fim Enviar o formulário Pedido de Material ***************/

/*************** Resultado de exame ***************/
function div_over(tmp_status) {
	if (tmp_status) {
			document.getElementById('div_over').style.display = '';
	}
	else { 
			document.getElementById('div_over').style.display = 'none';
	}
}
	
//function Show(tmp_what) {
	//if (tmp_what == 'medico') {
		//document.getElementById('paciente').style.display = '';
		//document.getElementById('medico').style.display = 'nome';
	//}
	//else { 
	//	document.getElementById('paciente').style.display = 'nome';
	//	document.getElementById('medico').style.display = '';
	//}
//}
	
function Verifica_Campo_Paciente(){	 
	var exame       = document.frm.exame;
	var senha       = document.frm.senha_paciente; 
	document.frm.action = "https://secure.defferrari.com.br/laudomedico/asp/acesso_paciente.asp";
	
	if (exame.value == ""){
	alert("Preencha o campo Numero do Exame para poder realizar o acesso.");
	exame.focus();
	return false;
	}
	
	if (isNaN(exame.value)){
		alert("Preencha o campo Numero do Exame apenas com numeros.");
		exame.focus();
		return false;
	}
	
	if (senha.value == ""){
	alert("Preencha o campo Senha para poder realizar o acesso.");
	senha.focus();
	return false;
	}	  	  
	document.frm.reset();
}

function Verifica_Campo_Laboratorio(){
	//var numero      = document.frm.numero;
	//var senha       = document.frm.senha_medico;
	//document.frm.action = "https://secure.defferrari.com.br/laudomedico/asp/grava_cookies.asp";
	
	var numero      = document.frm.numero;
	var senha       = document.frm.senha;
	document.frm.action = "https://secure.defferrari.com.br/laudomedico/asp/grava_cookies.asp";		
	
	//alert(numero);
	//alert(senha);	
	
	if (numero.value == ""){
		alert("Preencha o campo Número do Exame para poder realizar o acesso.");
		numero.focus();
    return false;
  }

  if (isNaN(numero.value)){
		alert("Preencha o campo Número do Exame apenas com números.");
		numero.focus();
		return false;
  }

  if (senha.value == ""){
		alert("Preencha o campo Senha para poder realizar o acesso.");
		senha.focus();
		return false;
  }	
  
}
/*************** Fim Resultado de exame ***************/

function VerificaFormulario(){
	var parameters = "";
	var checkbox_ant = "";
	aux = "";		
	
	for(i=0;i<document.formulario.getElementsByTagName("input").length;i++){
		if(document.formulario.getElementsByTagName("input")[i].type != "button" && document.formulario.getElementsByTagName("input")[i].type != "submit"){
			parameters += "&"+document.formulario.getElementsByTagName("input")[i].name+"="+document.formulario.getElementsByTagName("input")[i].value;
						
		}
	}
	
	for(i=0;i<document.formulario.getElementsByTagName("select").length;i++){
		parameters += "&"+document.formulario.getElementsByTagName("select")[i].name+"="+document.formulario.getElementsByTagName("select")[i].value;
	}		
			
	aux += parameters;		
			
}

function VerificaFormulario_Pedido(){
	var parameters = "";
	var checkbox_ant = "";
	aux = "";		
	
	for(i=0;i<document.formulario.getElementsByTagName("input").length;i++){
		if(document.getElementsByTagName('input')[i].type == 'checkbox') {
  		if(document.getElementsByTagName('input')[i].checked) {
  			parameters += "&"+document.formulario.getElementsByTagName("input")[i].name+"="+document.formulario.getElementsByTagName("input")[i].checked;
  		}
  	} 
  	if(document.formulario.getElementsByTagName("input")[i].type != "button" && document.formulario.getElementsByTagName("input")[i].type != "submit"){
			parameters += "&"+document.formulario.getElementsByTagName("input")[i].name+"="+document.formulario.getElementsByTagName("input")[i].value;
  	}
	}
	
	for(i=0;i<document.formulario.getElementsByTagName("select").length;i++){
		parameters += "&"+document.formulario.getElementsByTagName("select")[i].name+"="+document.formulario.getElementsByTagName("select")[i].value;
	}		
			
	aux += parameters;		
			
}

/*************** Funcões Diversas ***************/
function ValidaCampo(campo, mensagem){
	//if ($(campo).value == "" ){
	if ((campo).value == "" ){			
		$(campo).focus();
		alert(mensagem);		
		return false;
	}
 return true;		
}

function ValidaEmail(campo, mensagem){
	if (document.getElementById(campo).value != "" ){
		if (!document.getElementById(campo).value.match(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9._-]+)/gi)){
			alert(mensagem);
			document.getElementById(campo).focus();
			return false;
		}
	}
	return true;
}