// cancel context menu
//document.oncontextmenu=new Function("return false");
// cancel selection for non-editable objects
document.onselectstart=new Function("return CancelSelection()");
// cancel help button
document.onhelp = new Function("return false;");
// when window receive focus set focus to movie
window.onfocus = SetFocusToMovie;

function CancelSelection()
{
	if (!event.srcElement) return true;
	if (event.srcElement.isContentEditable) return true;
	return false;	
}	

function SetFocusToMovie(){
	if(engine)
		engine.focus();
}

function DisplayElement(objName, show){
	var obj = null;
	if (document.getElementById) {
		obj = document.getElementById(objName);
	}
	else if (document.all) {
		obj = document.all(objName);
	}
	else if (document.layers) {
		obj = document.layers[objName];
	}
	if(obj)
		obj.style.display=(true==show ? "block" : "none");
}

function SetElementText(objName, text){
	if (document.getElementById) {
		document.getElementById(objName).innerText = text;
	}
	else if (document.all) {
		document.all(objName).innerText = text;
	}
	else if (document.layers) {
		document.layers[objName].document.write(text);
		document.layers[objName].document.close();
	}
}

function SetElementHTML(objName, content){
	if (document.getElementById) {
		document.getElementById(objName).innerHTML = content;
	}
	else if (document.all) {
		document.all(objName).innerHTML = content;
	}
	else if (document.layers) {
		document.layers[objName].document.write(content);
		document.layers[objName].document.close();
	}
}
function ShowSlideNo(no)
{
}
function OpenDialog(url, args, width, height){
	window.showModalDialog(url, args, "status:no; center:yes; help:no; minimize:no; maximize:no; scroll:no; border:thin; statusbar:no; dialogWidth:" + width + "px; dialogHeight:" + height + "px");
}
function OpenFixedSizeWindow(sUrl, name, width, height)
{
	var left, top;
	left = (screen.availWidth-width)/2;
	top = (screen.availHeight-height)/2;
	w = window.open(sUrl, name,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=' + width + ',height=' + height + ',left=' + left + ',top=' + top);
	window.onerror = new Function("return true;");
	w.focus();
	window.onerror = new Function("return false;");
}
function OpenResizableWindow(sUrl, name, width, height)
{
	var left, top;
	left = (screen.availWidth-width)/2;
	top = (screen.availHeight-height)/2;
	w = window.open(sUrl, name,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=' + width + ',height=' + height + ',left=' + left + ',top=' + top);
	window.onerror = new Function("return true;");
	w.focus();
	window.onerror = new Function("return false;");
}
function OpenFullScreenWindow(sUrl, name)
{
	var settings;
	settings = 'fullscreen=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no';
	window.open(sUrl,name,settings);
}
function OpenCustomWindow(sUrl, name, settings)
{
	window.open(sUrl,name,settings);
}

