
var entrylookup = new Object();

itdr.classes.CommentSpace.__toggle = itdr.classes.CommentSpace.toggle;
itdr.classes.CommentSpace.toggle = function (entryid, type) {
	itdr.classes.CommentSpace.__toggle(entryid, type);
	itdr.classes.Comments.showForm(entryid);
	if (entrylookup[entryid]==undefined) {
		// this is the first call for this entry
		// assume eveything is off except for the logo bar
		var obj = {
			cw_on: false,
			cfw_on: false
		}
		entrylookup[entryid] = obj;
	}
	if (type=="CommentsWrapper") {
		entrylookup[entryid].cw_on = !entrylookup[entryid].cw_on;
		if (entrylookup[entryid].cw_on) entrylookup[entryid].cfw_on = !entrylookup[entryid].cw_on;
	} else {
		entrylookup[entryid].cfw_on = !entrylookup[entryid].cfw_on;
		if (entrylookup[entryid].cfw_on) entrylookup[entryid].cw_on = !entrylookup[entryid].cfw_on;
	}	
	var logoVisible = !entrylookup[entryid].cw_on && !entrylookup[entryid].cfw_on;
	var logo = itdr.func.getElementsByClassName("border", "div", document.getElementById(entryid))[0];
	logo.style.display = logoVisible ? "block" : "none";
}



// make all external links popup in new window
itdr.func.DOMLoad(itdr.func.createExternalLinks);

// setup flash header
with (itdr.classes.FlashHeader) {
	use(true);
	setTransparency(true);
	setFlashVersion("7.0.0");
}

// setup twitter
with (itdr.classes.TwitterFeed) {
	use(true);
	setTwitterer("lukeedmonson", "15094421");
	setAutoHide(false);
	setStringTable({
		loading: "loading my tweets ...",
		anchor: "follow us",
		title: "Twitter Updates"
	});
}

// setup image replacement
with (itdr.classes.ImageReplace) {
	setDefaults({
		wordwrap: false,
		font: "blog/fonts/Avant_Garde_Book.ttf",
		color: "#fff",
		size: 20,
		backgroundColor: "#000",
		transparent: false,
		aliasing: 3	});
	addRule({
		selector: ".TitleReplace"
	});
	addRule({
		selector: ".DateReplace",
		size: 11,
		color: "#009933"
	});
	addRule({
		selector: ".TrackbacksCommentsReplace",
		size: 15
	});
}


// setup comment space toggle
with (itdr.classes.CommentSpace) {
	comments (true, true, true); // hideOnLoad, allowToggle, hideIfZero
	trackbacks (false, true); // hideOnLoad, allowToggle
	form (true, true); // hideOnLoad, allowToggle
}
