/*var $j = jQuery.noConflict();
var $ = {};*/

// 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(hash + ".html");
	} else {
		// start page
		//$("#load").empty();
	}
}

$(document).ready(function(){
	// Initialize history plugin.
	// The callback is called at once by present location.hash. 
	$.history.init(pageload);
});

// set onlick event for buttons
function historyClick(_this, _hash, _section) {

	if ($(_this).attr("rel") == 'history' ||  $(_this).attr("rel") == 'history2') {
		
		if ($(_this).attr("rel") == 'history') {
			pageTracker._trackPageview(URL_RUBRIQUE+'/');
		}
		
		if ($(_this).attr("rel") == 'history2') {
			pageTracker._trackPageview(URL_RUBRIQUE+'/'+URL_SECTION);
		}
	
		
		//var hash = this.href;
		var hash = "/"+strtolower(_hash);
		hash = hash.replace(/^.*#/, '');
		// moves to a new page. 
		// pageload is called at once. 
		$.history.load(hash);
		
		
		
	}
	
	
}
