var boolIsChanged=0;
function UpdateItem(type, prop, me){
	eval("document.all." + type + me + "." + prop + "=document.all." + me + ".value");
	UpdateChangedStatus(1);
}

function UpdateChangedStatus(isChanged){
	if (isChanged){
		boolIsChanged=1;
		document.all.tblSaveButton.style.visibility="visible";
	}
	else{
		boolIsChanged=0;
		document.all.tblSaveButton.style.visibility="hidden";	
	}
}

function ProcessMenu(me){
	var t = eval("document.all.tbl" + me + ".style");
	if (t.display == "none")
		t.display = "block";
	else
		t.display = "none";
}

function CheckChanges(){
	if(boolIsChanged)
		if(AskToSaveChanges() == 6)
			Save();
		else
			return;
}

function JumpMasters(id){
	if (!isNaN(id))
		location.href='/_editor/homepage/editor_masters.asp?id='+id;
}

function JumpTranslations(id, subsid, subname){
	if (!isNaN(id))
		location.href='/_editor/homepage/editor_translations.asp?id='+id+'&subsid='+subsid+'&subname='+subname;
}

function Save(){
	if(boolIsChanged){
		window.open("", "SaveWindow", "toolbars=yes,address=yes,status=no,width=200,height=170,top="+(window.event.screenY-85)+",left="+(window.event.screenX-100));
		var frm = document.forms["frmEditor"]
		frm.target = "SaveWindow";
		frm.submit();
		boolIsChanged=0;
	}
}

function MaxChars(me, maxVal){
	if (me.value.length > maxVal){
		alert("Please do not use more than " + maxVal + " characters for this field.");
		me.value = me.value.substr(0, maxVal);
		me.focus();
	}
}

