document.body.focus();

var temp = parent;
var vcs = null;

for(i=0;i < 100; i++) {
	if(temp.document != document) {
		temp = temp.parent;
	}
	else {
		break;
	}
		
	for(var frameDepth = 0; frameDepth < temp.frames.length; frameDepth++) {
		if(typeof(temp.frames[frameDepth].PageInit) == "function") {
			vcs = temp.frames[frameDepth];
			break;
		}
	}
}

if(vcs != null) {
	vcs.PageInit(document);
}


function document.onkeydown() {
	if(vcs != null) {	
		if(event.ctrlKey) {event.returnValue = false;}
		vcs.EventHandler(event);
	}
}


function document.onmouseup() {
	if(vcs != null) {
		vcs.MouseClickHandler(event);
	}
}



function document.body.onunload() {
	if(vcs != null) {
		try {
			vcs.StopNow();
		}
		catch(e) {}
	}
}