function delicious() {
    window.open('http://del.icio.us/post?v=4&noui&jump=close&url='+encodeURIComponent('http://milemeter.com')+'&title='+encodeURIComponent(document.title + ' [Auto Insurance Buy the Mile]'), 'delicious','toolbar=no,width=700,height=400'); 
    return false;
}  

function selectNav() {
	var loc = window.location.pathname.match(/^\/\w+/);
	var anchor = "nav_";
	if (null == loc) {
		anchor += "index";
	} else {
		loc = loc.toString().replace(/\//, "");
	
		if(loc == "error") {
		   anchor += "index";
		} else if(loc == "purchase") {
			anchor += "quote";
		} else if(loc == "policy") {
			anchor += "account";
		} else if(loc == "privacy_policy") {
			anchor += "about";
		} else if (loc == "thanks") {
			anchor += "contact";
		} else if (loc == "at_a_glance") {
			anchor += "about";
		} else if (loc == "social_responsibility") {
			anchor += "about";
		} else if (loc == "management_team") {
			anchor += "about";
		} else if (loc == "board_of_directors") {
			anchor += "about";
		} else if (loc == "news") {
			anchor += "news";
		} else if (loc == "commercials") {
			anchor += "about";
		} else if (loc == "press_media") {
			anchor += "about";
		} else if (loc == "spanish") {
			anchor += "about";
		} else if (loc == "site_map") {
			anchor += "about";
		} else if (loc == "demo") {
			anchor += "about";
		} else if (loc == "your_state") {
			anchor += "about";
		} else if (loc == "signup") {
			anchor += "account";
		} else {
			anchor += loc;
		}
	}
	$(anchor).className += " active"
}
Event.observe(window, 'load', selectNav );


function displayThrobber() {
    if ($('throbber')) {
      $('throbber').show();
    }
};
	

function hideThrobber() {
  if ($('throbber')) {
      $('throbber').hide();
  }
};

// Polling support for periodically_call_remote

if (poll == undefined) {
	var poll = new Array();
}

function startPolling(id) {
	poll[id] = true;
}

function stopPolling(id) {
	poll[id] = false;
}

function polling(id) {
	return poll[id];
}
