/* Active or not the ajax navigation and ajax forms */
var enableAjax = false;

var ant = {
	se: {},
	social: {}
};

ant.se.changeType = function(type) {
	$('#search').attr('action', '/' + type);
}

ant.se.addToBrowser = function(host)
{
  if (window.external && ('AddSearchProvider' in window.external)) {
		window.external.AddSearchProvider(host + '/ext/xml/ant.xml');
  } else if (window.sidebar && ('addSearchEngine' in window.sidebar)) {
		alert('window.sidebar');
		window.sidebar.addSearchEngine(host + '/ext/xml/ant.src',
			host + '/favicon.ico', 'Ant.com', '');
  }
}

ant.social.sideads = function(query, page, nbr) {
	if (page == null)
		page = 1;
	if (nbr == null)
		nbr = 6;
	if (query.constructor == Array)
		query = query[Math.floor(Math.random() * query.length)];
	$("#side_ads").load("/ads/side/" + escape(query) + '/' + nbr + '/' + page);
}

ant.social.addToBookmark = function() {
	if (document.all) { // ie
		window.external.AddFavorite(document.location, document.title);
		return false;
  }
}

ant.social.setAsHomePage = function(a) {
  a.style.behavior = 'url(#default#homepage)';
  a.setHomePage(document.location);
}
