////////////////////////////////////////////////////////////////////////
// Breeze Website Builder
// Copyright Silver Dolphin Solutions, LLC, Edward Lemmers, P.E.
// For licensing, see license.txt.
// Created: 11/21/2014	ELL
// Revised: 21/1/2014	ELL
// Added edit is source view checkbox.
// Revised: 5/20/2016	ELL
// Added ability to use either desktop styles or mobile styles.

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

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

function SetEditorMode(mode)
{
	var xmlhttp;
	xmlhttp = getXmlHttpRequestObject();

	if (xmlhttp.readyState == 4 || xmlhttp.readyState == 0)
	{
		xmlhttp.open("POST","set_editor_mode.php",true);
		xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		xmlhttp = UpdateMessage(xmlhttp);
		
		if (document.getElementById(mode).checked == true)
			params = mode + "=1";
		else
			params = mode + "=0";
		
		xmlhttp.send(params);
	}
}

function UpdateMessage(xmlhttp)
{
	var status_msg;
	xmlhttp.onreadystatechange=function()
	{
		if (xmlhttp.readyState==4)
			status_msg = "query complete";
		else if (xmlhttp.readyState==1)
			status_msg = "query read to send";
		else if (xmlhttp.readyState==2)
			status_msg = "query sent";
		else if (xmlhttp.readyState==3)
			status_msg = "query starting";
	}
	return (xmlhttp);
}

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

}

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