// for some reason none of this is working in IE
var ABBLOGS = {};

ABBLOGS.openSite = function() {
	window.open("http:\/\/www.clubophelia.com", "_self");	
}

ABBLOGS.onLoadFunctions = function() {
	
	// uncomment the next line to remove the Blogger toolbar from top of page
	//$("navbar").remove();
	
	// change the header so it clicks through to the Club Ophelia site
	if ($("Header1")) {
		var header = $("Header1");
		Event.observe(header, "click", ABBLOGS.openSite);
	}
	
	// change book image's a tag so it opens page in new window
	if ($("Image1_img")) {
		$("Image1_img").up().target = "_blank";
	}
	
	/* loop through all sidebar links and remove any elements
	 * that show ABMW profile (as identified by their containment
	 * of a link to ABMW profile
	 */
	var sidebarLinks = $A($("sidebar").getElementsByTagName("li"));
	sidebarLinks.each(function(i){
		if (i.innerHTML.match(/http:\/\/www.blogger.com\/profile\/15476928904678688996/)){
			/*var containingEl = i.up();
			if (containingEl.tagName == "div" || containingEl.tagName == "DIV"){
				var itemToRemove = i.previous();
				itemToRemove.remove();
				i.remove();
				i.hide();
			} else if (containingEl.tagName == "li" || containingEl.tagName == "LI"){
				containingEl.remove();
				containingEl.hide();
			}*/
			i.style.display = "none";
			//i.remove();
		}
	});
	
}

// for mozilla-based browsers, we can hide the ABMW profile before it even is rendered:
Event.observe(window, "dom:loaded", ABBLOGS.onLoadFunctions);
// for IE we have to wait for the page to load:
Event.observe(window, "load", ABBLOGS.onLoadFunctions);
