// Sets ccTop so it can be used instead of window.top
// (Helpful when the app is in somebody else's frameset)

var ccTop = window;

//debugger;
while (ccTop) {
	if (ccTop.ccMenuFrame) {
		ccTop = ccTop.ccMenuFrame.parent;
		break;
	}

	// (window.top == window.top.parent) is always true	
	if (ccTop == ccTop.parent) {
		ccTop = null;
		break;
	}
	
	ccTop = ccTop.parent;
}

if (!ccTop) {
	ccTop = window;
}