////////////////////////////////////////////////////////////////////////
// Breeze Website Builder
// Copyright Silver Dolphin Solutions, LLC, Edward Lemmers, P.E.
// For licensing, see license.txt.
// Created: 1/13/2015	ELL
// Revised:	2/2/2012	ELL
// Fixed bug of "Save As" not creating new file.

window.parent.document.title = document.title;

function OpenHelpWindow()
{
	window.open("http://breezewebsitebuilder.com/docs/cms/help.html#copy_rename_page", "Help", "scrollbars=1,resizable=1,status=0,toolbar=0,menubar=0,location=0,height=700,width=800");
}

function CheckPageName(page_name)
{
	if ((page_name.length > 0) && (page_name != " "))
		document.getElementById("copy_rename_btn").className = "button_console_edit";
	else
		document.getElementById("copy_rename_btn").className = "button_console_edit_disabled";
}

function	EnableDisableCreateNewTemplateCheckbox(mode)
{
	if (mode == "copy")	{
		document.getElementById("create_new_template").disabled = false;
		document.getElementById("create_new_template_label").style.color = "#000000";
		document.getElementById("copy_radio_btn").className = "radio_button";
		document.getElementById("copy_radio_btn").className += " checked";
		document.getElementById("rename_radio_btn").className = "radio_button";
	}
	else	{
		document.getElementById("create_new_template").checked = false;
		document.getElementById("create_new_template").disabled = true;
		document.getElementById("create_new_template_label").style.color = "#A6A6A6";
		document.getElementById("copy_radio_btn").className = "radio_button";
		document.getElementById("rename_radio_btn").className = "radio_button";
		document.getElementById("rename_radio_btn").className += " checked";
	}
}

function TransferPageNameOnCheck(checkbox_el)
{
	if (checkbox_el.checked === true)	{
		document.getElementById("new_name").value = document.getElementById("page_name").value;
		CheckPageName(document.getElementById("new_name").value);
		document.getElementById("create_new_template").value = 1;
	}
	else
		document.getElementById("create_new_template").value = 0;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////
function ResizeWorkspace(mainWidth, mainHeight, menuWidth, headerHeight) {

}

function DisplayNotSavedMessage(btn)	{
	// Needed to complete call when deleting unsaved page.
	window.parent.SetWorkSavedNotSaved(true);
	window.parent.next_btn = btn;
	window.parent.DoNextClick();
}