var e_StudioMax_ID = null;
function e_StudioMax_edit() {
	e_StudioMax_ID = this.id;
	window.open("fullscreeneditor.html", "EDITOR",
		    "resizable=yes,width=640,height=480,toolbar=no,scrollbar=no,statusbar=no,location=no,menubar=no");
};

function e_StudioMax_edit2() {
	e_StudioMax_ID = this.id;
	lastOpenPanel = "open"
	window.open("fullscreeneditor.html", "EDITOR",
		    "resizable=yes,width=640,height=480,toolbar=no,scrollbar=no,statusbar=no,location=no,menubar=no");
};

function e_StudioMax_edit_remoteCall(which) {
	e_StudioMax_ID = which;
	window.open("fullscreeneditor.html", "EDITOR",
		    "resizable=yes,width=640,height=480,toolbar=no,scrollbar=no,statusbar=no,location=no,menubar=no");
};

function e_StudioMax_installEditable(div) {
	if (!div.id) {
		alert("Found editable without an ID.  This is not good.  Following is the HTML text inside it:\n\n" +
		      div.innerHTML);
		return;
	}
	div.title = "Double-click to edit page content.";
	div.onmouseover = function() { this.className += " editable-hover"; };
	div.onmouseout = function() { this.className = "editable"; };
	div.ondblclick = e_StudioMax_edit;
};

function e_StudioMax_installEditable2(div) {
	if (!div.id) {
		alert("Found editable without an ID.  This is not good.  Following is the HTML text inside it:\n\n" +
		      div.innerHTML);
		return;
	}
	div.title = "Double-click to edit content.";
	div.ondblclick = e_StudioMax_edit2;
};

function e_StudioMax_initEditables() {
	var DIVS = document.getElementsByTagName("div");
	for (var i = 0; i < DIVS.length; ++i) {
		var div = DIVS[i];
		if (/(^|\s)editable(\s|$)/.test(div.className))
			if (div.id=="editable-9"){
				e_StudioMax_installEditable2(div);
			}else{
				e_StudioMax_installEditable(div);
			}
	}
};

function e_StudioMax_publishEditables() {
	var form = document.getElementById("frmEdit");
	form.submit();
};
