	// PageLoad function
	// This function is called when:
	// 1. after calling $.historyInit();
	// 2. after calling $.historyLoad();
	// 3. after pushing "Go Back" button of a browser
	function pageload(hash) {
		// hash doesn't contain the first # character.
		if(hash) {
			// restore ajax loaded state
			$("#load").load("bridge/neue/" + hash + ".php"); 
$("td.navigator > div").not("#n" + hash).removeClass();

$("#n" + hash).addClass(hash);


		}
else {
			// start page
			$("#load").load("bridge/neue/home.php");
$("#nhome").addClass("home");
		}
	}
	
	$(document).ready(function(){
		// Initialize history plugin.
		// The callback is called at once by present location.hash. 
		$.historyInit(pageload);
		
		// set onlick event for buttons
		$("a[rel='history']").click(function(){
			// 

$('#load').show();

			var hash = this.href;
			hash = hash.replace(/^.*#/, '');
			// moves to a new page. 
			// pageload is called at once. 
			$.historyLoad(hash);
			return false;
		});
$().ajaxSend(function(r,s){  
$("#contentLoading").show();  
});  
  
$().ajaxStop(function(r,s){  
$("#contentLoading").fadeOut("fast");
});  

	});

function getElemRefs(id) {
	var el = (document.getElementById)? document.getElementById(id): (document.all)? document.all[id]: (document.layers)? getLyrRef(id,document): null;
	if (el) el.css = (el.style)? el.style: el;
	return el;
} 

function showIma(id) {
  var lyr = getElemRefs(id);
  if (lyr && lyr.css) lyr.css.display = "block";
}

function hideIma(id) {
  var lyr = getElemRefs(id);
  if (lyr && lyr.css) lyr.css.display = "none";
}

function swapIt(id, newclass) {
document.getElementById(id).className = newclass; 
}